ZombieSquirrel
Member
Hi everyone.
I'm trying to build a lighting system using shaders.
I have multiple tile layers, and a couple of instance layers per room.
I also have a system instance layer at depth 0 just to have some layer
where my system instances need to go and be nicely grouped together.
This last layer contains some of my important system things, like pause menu's, mouse sprites, user interface, inventory sprites, etc...
What I want to do is have every layer and every non-gui-instance be affected by a
lighting shader.
I do not want whatever is drawn on the GUI layer to be affected.
For example, I have an inventory object that draws the player inventory using
its draw GUI event. I also have a pausesystem instance that draws a pause menu in its
draw GUI event when the game is paused, there's things like healthbars, and so on.
Naturally, I don't want whatever is drawn as GUI to be affected by the lighting shader.
I can do it however, using a very tedious strategy:
Per room, have a layer_shader do the shader magic per layer.
Then, in each instance, have its draw event go through the same shader.
This works, but it doesn't allow me do to point--lighting i think. For example, have a torch on a
wall light up the entire surrounding area surrounding area, instances included.
What I'd want to do, and what I'm asking here,
is if it is at all possible to send everything through a shader, but not things that are rendered on the GUI layer, or things that are drawn using draw GUI events. Instead of treating each layer and each instance separately, have it all be treated as one thing to change, while keeping all the GUI stuff unaffected.
I'm sure this has something to do with surfaces, but I'm afraid my scaled camera will be a real chore to fix that.
Still, is this doable? Send everything indiscriminately through a shader, but not anything draw GUI event related?
The reason I'm asking is because I can't seem to find a way to "grab" the GUI layer, like I do with any other layer using layer_shader(layer_id) for example.
I'm also a noob when it comes to surfaces, so I know i will need to learn that probably.
I'm trying to build a lighting system using shaders.
I have multiple tile layers, and a couple of instance layers per room.
I also have a system instance layer at depth 0 just to have some layer
where my system instances need to go and be nicely grouped together.
This last layer contains some of my important system things, like pause menu's, mouse sprites, user interface, inventory sprites, etc...
What I want to do is have every layer and every non-gui-instance be affected by a
lighting shader.
I do not want whatever is drawn on the GUI layer to be affected.
For example, I have an inventory object that draws the player inventory using
its draw GUI event. I also have a pausesystem instance that draws a pause menu in its
draw GUI event when the game is paused, there's things like healthbars, and so on.
Naturally, I don't want whatever is drawn as GUI to be affected by the lighting shader.
I can do it however, using a very tedious strategy:
Per room, have a layer_shader do the shader magic per layer.
Then, in each instance, have its draw event go through the same shader.
This works, but it doesn't allow me do to point--lighting i think. For example, have a torch on a
wall light up the entire surrounding area surrounding area, instances included.
What I'd want to do, and what I'm asking here,
is if it is at all possible to send everything through a shader, but not things that are rendered on the GUI layer, or things that are drawn using draw GUI events. Instead of treating each layer and each instance separately, have it all be treated as one thing to change, while keeping all the GUI stuff unaffected.
I'm sure this has something to do with surfaces, but I'm afraid my scaled camera will be a real chore to fix that.
Still, is this doable? Send everything indiscriminately through a shader, but not anything draw GUI event related?
The reason I'm asking is because I can't seem to find a way to "grab" the GUI layer, like I do with any other layer using layer_shader(layer_id) for example.
I'm also a noob when it comes to surfaces, so I know i will need to learn that probably.