Open claudeha opened 6 years ago
Right now it is using linear filtering, but it shouldn't be hard to expose the texture filtering options.
I am hoping to implement blur and other convolution filters using multi-pass rendering. The idea is that some functions, instead of all becoming part of the same shader, would become a separate render pass. I need to revisit it, but somehow I wasn't getting the expected results.
I started to work on it here: https://github.com/ojack/hydra-synth/blob/master/src/renderpass-functions.js
ok, looking at the code again its pretty messy because I was trying things out! Will clean it up and post updates here.
could be nice if mipmaps were generated for output textures (maybe they are already?), and to expose a way to set the bias parameter of texture2d() for blur effects (a small bias could be used for reaction-diffusion stuff, a very large bias could be used to get the average colour of the whole image for things like equalisation).
I tried implementing a blur by adding scrolled copies, but failed miserably.
generating mipmaps is an expensive operation, so it should probably be optional...
https://webglfundamentals.org/webgl/lessons/webgl-3d-textures.html (about 2/5 of the way down the page) http://docs.gl/es2/glGenerateMipmap http://docs.gl/el3/texture