• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

SOLVED how to get a shader to affect all, but one?

A

Adry

Guest
Hi! Its been a while since I've been on here. so, hello hello!

I've currently run into a problem that I'm desperate to solve.. I currently have a shader that de-saturates the screen via gui. The problem is I want one object to remain with color. how can I draw that object without it being affected by the shader?

Note: I also tried to use the shader as a "draw event," but that didn't work - it got glitchy and the output gave me this message "Trying to set texture that is also bound as depth buffer - bailing.."

Anyways, if anyone could help that would be amazing :) here's my code from draw GUI event:

if (player_health.hp < 1) {
shader_set(sh_desaturate);

shader_set_uniform_f(u_desaturate, toChangeValue);

draw_surface(application_surface, 0, 0 );

shader_reset();

}
 

Zhanghua

Member
GUI layer is the top, so you can't do that in gui layer.
Unless, you draw the normal object to the gui.
 
A

Adry

Guest
draw the normal object?
when I draw the object that I want excluded from the shader in the gui it's still becomes desaturated..
 
A

Adry

Guest
Oh! I forget to add
GML:
draw_self();
to my objects GUI.. 🤦‍♂️ Thanks for the help!
 
Top