I am trying to play a little with lettering, outline and lights and I am trying to simulate some neon letters that can light up and appear to glow.
I used the blur filter to achieve the glow effect. However, the frame rate decreases considerably when I use the filter. Is there anyway around this?
This is what I have done so far:
boolean on = true;
PGraphics pg;
void setup() {
size(400, 400, P3D);
}
void draw() {
background(240);
println(frameRate);
color outglow = on ? color(255, 0, 0) : color(150);
fill(outglow);
int p = 50;
textFont(createFont("Comic Sans MS", 30));
for (int x = -2; x < 2; x++) {
text("LIKE THIS A!", p+x, p);
text("LIKE THIS A!", p, p+x);
}
int blurAmount = on ? 4 : 2;
filter(BLUR, blurAmount);
color inLight = on ? color(255) : color(200);
fill(inLight);
text("LIKE THIS A!", p, p);
}
void keyPressed() {
on = !on;
println("ON = " + on);
}
@PhySan Hi, have a look at the examples in menu, its under topics, shaders, blur, its a far more efficient blurring shader than the default blur filter
In the example file, youll have to goto the sketch folder and grab the file blur.glsl and paste that into your sketch folder in order for the filter to work otherwise you’ll get an error when trying to load the shader