|
|
@@ -1470,7 +1470,7 @@ class DARKER extends Shader { |
|
|
|
name = "fxDarker"; |
|
|
|
params.add(new Param("count", INTVAL, 1, 4, new int[]{TRIANG, SINE, RAMPUPDOWN, TAN, TANINVERSE})); |
|
|
|
params.add(new Param("threshold", INTVAL, 60, 180, new int[]{SAWTOOTH, TRIANG, SINE, TAN, TANINVERSE, RAMPUPDOWN, RAMP, RAMPINVERSE})); |
|
|
|
params.add(new Param("frequency", INTVAL, 140, 220, new int[]{TRIANG, SINE, RAMPUPDOWN })); |
|
|
|
params.add(new Param("darken", INTVAL, 140, 220, new int[]{TRIANG, SINE, RAMPUPDOWN })); |
|
|
|
params.add(new Param("mode", INTVAL, 0, 1, new int[]{SQUAR, RANDOM})); |
|
|
|
|
|
|
|
|
|
|
@@ -1528,7 +1528,55 @@ class DARKER extends Shader { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
BRIGHTER |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
class BRIGHTER extends Shader { |
|
|
|
|
|
|
|
float thresh = 120; |
|
|
|
float thresh2 = 150; |
|
|
|
float brighten = 180; |
|
|
|
float speed; |
|
|
|
BRIGHTER() { |
|
|
|
name = "fxBrighter"; |
|
|
|
params.add(new Param("threshold", INTVAL, 0, 255, new int[]{SAWTOOTH, TRIANG, SINE, TAN, TANINVERSE, RAMPUPDOWN, RAMP, RAMPINVERSE})); |
|
|
|
params.add(new Param("threshold 2", INTVAL, 0, 255, new int[]{SAWTOOTH, TRIANG, SINE, TAN, TANINVERSE, RAMPUPDOWN, RAMP, RAMPINVERSE})); |
|
|
|
params.add(new Param("brighten", INTVAL, 0, 255, new int[]{TRIANG, SINE, RAMPUPDOWN })); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void apply() { |
|
|
|
brighten = int(params.get(2).value); |
|
|
|
thresh2 = int(params.get(1).value); |
|
|
|
thresh = int(params.get(0).value); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
renderer.beginDraw(); |
|
|
|
renderer.colorMode(HSB); |
|
|
|
colorMode(HSB); |
|
|
|
renderer.loadPixels(); |
|
|
|
for (int i = 0; i < renderer.width*renderer.height; i++) { |
|
|
|
float hue = hue(renderer.pixels[i]); |
|
|
|
float sat = saturation(renderer.pixels[i]); |
|
|
|
float bright = brightness(renderer.pixels[i]); |
|
|
|
if (bright < thresh && bright > thresh2) { |
|
|
|
bright += brighten; |
|
|
|
constrain(bright, 0, 255); |
|
|
|
} |
|
|
|
color c = color(hue, sat, bright); |
|
|
|
renderer.pixels[i] = c; |
|
|
|
} |
|
|
|
renderer.colorMode(RGB); |
|
|
|
renderer.updatePixels(); |
|
|
|
renderer.endDraw(); |
|
|
|
colorMode(RGB); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|