so i'd like to add multiple effects stacked on each other on my sprite hierarchy. i can add one shader, render it to a texture, display it, add another shader on that and render it to a texture etc. but this is really slow if the bitmap i work with is full-screen (which it is). is there a better way?
thanks
Comments
In my last attempts I could apply multple shaders to one sprite by multiplying the shaders in the result call.
I don't have the code right now but that was something like:
Fragmenter - animated loop machine and IKONOMIKON - the memory game
in my app i have 7 fx's and maybe more in the future which should be applied in any combination (even more than 2 of them) so there are too many combinations to hard-code them.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
https://www.shadertoy.com/view/4dcGW2#
which has buffer a, buffer b, etc.
as far as i understand with this one could combine multiple shaders into one even if they are not per-pixel computed (like @MoKaLux 's example with bloom*blur).
how can we do this in gideros glsl? if that's doable then an example would be nice (packaged with gideros examples in long term).
Fragmenter - animated loop machine and IKONOMIKON - the memory game
still seems there are still separate rendertargets there, so perhaps it is not exactly the same as buffers within a shader. @hgy29 may tell us more.
also, while i like the idea of luashaders as i can read them better, on the other hand to translate and modify e.g. a shadertoy code is even harder, thus i still prefer to wotk with glsl shaders (and also i have some of them already from the past and i'm too lazy to translate them) and so i'd need an example on how to do multiple buffers in glsl.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
In Gideros effect stack, effects are chained by default: first effect takes the Sprite input textures and draw into its assigned buffer, second effect takes previous buffer as input texture and draws into its own buffer and so on, until last effect which draws directly on screen.
If this default chaining is not what you want, you can specify input textures yourself in each effect pass descriptor (like in BloomCombine above).
About the benefit of working with luashaders and not in GLSL: if you happen to target UWP (HLSL) or iOS/macOS (MSL) in addition to Android, you don't need to write the shader in all three languages.