Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
how to efficiently apply multiple shaders — Gideros Forum

how to efficiently apply multiple shaders

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

  • I still have to properly learn shaders :#
    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:
    function shader : shaders()
       -- bloom
       ...
       -- blur
       ...
       result = bloom * blur
    end
    Hope this makes sense :|
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    There’s probably not much you can do since what makes it slow is mainly the gpu usage, except if you can merge some shaders together as @MoKaLux suggested, this will avoid storing pixel to memory and sampling it again for the next pass.
  • by merging you mean guys that i combine the shader codes into one somehow?
    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.
Sign In or Register to comment.