Legacy GM Using Multiple Shaders

aereddia

Member
So I've been poking around trying to figure out how to draw a sprite with multiple shaders active, but it has been a bit unfruitful. Everyone has said it is possible for surfaces, but I'm looking to use it on an individual sprite and that's where I'm running into problems.

Is it even possible? Surely there is some way to do it without putting everything in one mega shader that joins them all together, Frankenstein style. That's what I'm trying to work around.
 

Smiechu

Member
Yes, like you said... use surfaces.
Draw sprite ona a temporary surface using one shader, then draw this temporary surface on the screen with another shader.
If you need more, add one more temporary surface and draw from one temporary surface to other with how many shaders you want.
Only thing what is tricky is the alpha blending mode, the default one is giving strange effects.
 

aereddia

Member
Yes, like you said... use surfaces.
Draw sprite ona a temporary surface using one shader, then draw this temporary surface on the screen with another shader.
If you need more, add one more temporary surface and draw from one temporary surface to other with how many shaders you want.
Only thing what is tricky is the alpha blending mode, the default one is giving strange effects.
Wow, now I just feel dumb. I guess I didn't realize that individual sprites could be drawn to a separate surface, only the application surface. Thanks!
 

Smiechu

Member
No problem, but look out. If your game is high resolution you can crash into performance problems very fast.
 
Top