This commit is contained in:
Jack Armitage
2019-03-21 10:50:27 +00:00
parent cca6b794c6
commit b4b9f8685f
3 changed files with 109 additions and 12 deletions
+26
View File
@@ -77,6 +77,12 @@ noise(3,0.1).colorama( ({time}) => Math.sin(time/5) ).out(o0)
Invert color.
#### Example
```javascript
solid(1,1,1).invert([0,1]).out(o0)
```
### luma
`.luma( threshold, tolerance )`
@@ -84,9 +90,29 @@ Invert color.
* `threshold` :: float (default `0.5`)
* `tolerance` :: float (default `0.1`)
#### Example
```javascript
// default
osc(10,0,1).luma(0.5,0.1).out(o0)
osc(10,0,[0,0.5,1,2]).luma([0.1,0.25,0.75,1].fast(0.25),0.1).out(o0)
```
### thresh
`.thresh( threshold, tolerance )`
* `threshold` :: float (default `0.5`)
* `tolerance` :: float (default `0.04`)
#### Example
```javascript
// default
noise(3,0.1).thresh(0.5,0.04).out(o0)
noise(3,0.1)
.thresh( ({time})=>Math.sin(time/2) , [0.04,0.25,0.75,1].fast(0.25) )
.out(o0)
```
+53 -1
View File
@@ -35,7 +35,16 @@ Pixelate texture with `pixelX` segments and `pixelY` segments.
#### Example
```javascript
// default
noise().pixelate(20,20).out(o0)
noise()
.mult(osc(10,0.25,1))
.scrollY(1,0.25)
.pixelate([100,40,20,70].fast(0.25))
.modulateRotate(src(o0).scale(0.5),0.125)
.diff(src(o0).rotate([-0.05,0.05].fast(0.125)))
.out(o0)
```
### rotate
@@ -50,14 +59,18 @@ Rotate texture.
#### Example
```javascript
osc(50).rotate( ({time}) => time%360 ).out(o0)
osc(10,1,1)
.rotate( ({time}) => time%360, ({time}) => Math.sin(time*0.1)*0.05 )
.out(o0)
```
### scale
`.scale( size, xMult, yMult )`
* `size` :: float (default `x`)
* `size` :: float (default `1.5`)
* `xMult` :: float (default `1.0`)
* `yMult` :: float (default `1.0`)
@@ -66,7 +79,16 @@ Scale texture.
#### Example
```javascript
// default
shape().scale(1.5,1,1).out()
shape().scale(1.5,[0.25,0.5,0.75,1].fast(0.25),[3,2,1])
.invert([0,1].fast(0.25))
.kaleid(5)
.kaleid(12)
.scale( ({time})=>Math.sin(time/5)*0.5 )
.rotate(1,1)
.out(o0)
```
### scrollX
@@ -79,7 +101,22 @@ Scale texture.
#### Example
```javascript
// default
osc(10,0,1).scrollX(0.5,0).out()
// x position
osc(10,0,1).scrollX([0,0.25,0.5,0.75,1].fast(4),0).out()
// scroll speed
gradient(1).scrollX(0, ({time}) => Math.sin(time*0.05)*0.05 ).out()
gradient(0.125)
.scrollX(0, ({time}) => Math.sin(time*0.05)*0.05 )
.scrollY(0, ({time}) => Math.sin(time*0.01)*-0.07 )
.pixelate([5,2,10],[15,8])
.scale(0.15)
.modulate(noise(1,0.25))
.out()
```
### scrollY
@@ -92,5 +129,20 @@ Scale texture.
#### Example
```javascript
// default
osc(10,0,1).scrollY(0.5,0).out()
// y position
osc(10,0,1).scrollY([0,0.25,0.5,0.75,1].fast(4),0).out()
// scroll speed
gradient(1).scrollY(0, ({time}) => Math.sin(time*0.05)*0.05 ).out()
gradient(0.125)
.scrollX(0, ({time}) => Math.sin(time*0.05)*0.05 )
.scrollY(0, ({time}) => Math.sin(time*0.01)*-0.07 )
.pixelate([5,2,10],[15,8])
.scale(0.15)
.modulate(noise(1,0.25))
.out()
```