Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mipmapping #27

Open
claudeha opened this issue Sep 4, 2018 · 2 comments
Open

mipmapping #27

claudeha opened this issue Sep 4, 2018 · 2 comments

Comments

@claudeha
Copy link

claudeha commented Sep 4, 2018

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

@ojack
Copy link
Member

ojack commented Sep 4, 2018

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

and here: https://github.com/ojack/hydra-synth/blob/cdbb882a3c9cecac5cf8d3024c8a64f3b71d7e61/src/GeneratorFactory.js#L234

@ojack
Copy link
Member

ojack commented Sep 4, 2018

ok, looking at the code again its pretty messy because I was trying things out! Will clean it up and post updates here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants