I have a small request, I need a very simple 2D Filter. It should be controlled by a property, and blur the entire view. Can someone please write this? I am bad at coding
wrong forum section, please ask in the support and discussion section. Ask a mod to move this thread.
You’re right, pretty simple.
Properties are automatically assigned to uniforms in the shader, so that’s easy.
I did here, it’s a simple box blur controlled by two properties.
Amount is how many pixels to blur in all 4 directions.
Multiplier is how for to get each pixel from.
Then now’s the time to start coding, because it’s really fun.
Attachments
2dfilter_boxblur.blend (510 KB)
Hey, I was needing just this: very simple blur… but this FX darken the image. Why and how should I avoid that?
Moguri fixed the code. The last line must be:
gl_FragColor = sum / pow(amount * 2 + 1, 2);
Thank you for the code!