• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

GMS 2 Can't use shader inside surface

Carloskhard

Member
So is this something related to GML?
I have a surface that I can draw with a shader, but if I draw that surface inside another surface, the shader doesn't apply.
Any insights?
 
Drawing a surface with a shader is completely different than drawing the contents of a surface with a shader. You'll have to directly affect the first surface before applying it to the second.
 

Carloskhard

Member
Drawing a surface with a shader is completely different than drawing the contents of a surface with a shader. You'll have to directly affect the first surface before applying it to the second.
I know, what I'm saying is that I had a surface that I could draw with a shader, but if that surface with that shader was being draw inside another surface target, then I wouldn't work.
I know it's confusing sorry.

I just went around it so it's not a problem anymore, I just want to know if it was an error of my code or it was that way by default in GML like for example the rule that you cannot stack surfaces.

Also found another strange thing, which is that when using 'draw alpha' set to 0 (inside a set target surface) and drawing with blendmode "substract" it will just erase(make black) the white areas, but if 'draw alpha' was set to 1 it would erase everything, even the dark area.
I hope this can be understood. I've been programming shaders and surfaces for 6 hours, my head is to tired right now haha
 
Ah, I see what you're saying now. It makes sense in context with the title, which I overlooked. I guess it depends on what exactly all code involved was doing as I personally haven't come across this issue.
 
Top