Closed cansik closed 7 years ago
Hi this is a great idea for a library
I was wondering about blending shaders would be in the scope of this lib ?
Sometime ago I played with blending shaders and got a little processing app to experiment with different kind of blending : https://github.com/b2renger/Processing_Blends_Shaders
The code is not really good and I always thought I should find a way to refactor those. Your post-fx lib seems perfect for this job. Would you be open to me working on that ?
@b2renger Yep sounds like a good idea. I think some blending shaders are already implemented in processing:
blendMode(BLEND);
But I will check out your blending shaders 👍
Ah ok, now I know what you mean with blending shaders :) Yeah I will check out your shaders.
@cansik I was not aware of the blendMode() function, before I used blend(). I think blend() was computed on the cpu, It looks like blendMode still computes from arrays of pixels in java https://github.com/processing/processing/commit/1ff98f928a31334a003cb567a6febae4736a4a31
maybe a faster implementation with shaders could be cool, let me know what you think. (I didn't write those shader myself, sadly I'm not capable of doing so, yet :) )
@cansik , ok then maybe it's not usefull to bother with blends then. Let me know what you decide, and If you think I can help I'd be glad to do so.
The problem is that we are using P3D
and P2D
textures and set the blend mode there. And I think because of that, it will be done with the compositing methods of OpenGL, but I will check that :)
How do you think, should the API look like for the blend modes with this library? Something like that:
PGraphics texture1;
PGraphics texture2;
fx.render(texture1)
.brightnessContrast(0.1f, 1.0f)
.blend(BlendMode.SCREEN, texture2)
.compose(passResult);
If we really implement it here :)
Yes definitely something like that !
I've implemented now a lot of useful shaders (about 11). I think that's enough for the current version ;)
Add more default shaders to the library:
Color
Reconstruction
Effects