• 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 A question about shaders and surfaces.

In my game I have a surface that is used for some simple lighting and 90% of the time it works well.
However. There is an enemy in my game that caused (deliberate) graphical glitches which are created using a shader that affects the application surface.
The problem I have is that when the enemy is present the shader doesn't affect the lighting surface.
If I understand surfaces correctly when you set the surface target all further draw commands are drawn to that surface and then the surface is drawn to the screen until the surface target is reset.
Is there a way that I can draw my lighting surface to the application surface so that it is affected by the shader?
 

Gizmo199

Member
If you just draw your lighting surface in the regular draw events (draw begin, draw, and draw end) it *should automatically draw it to the application surface. Then in the GUI event you can draw the application surface with your effects shader applied to it. But if you are drawing the lighting surface in the gui event that could be the cause. Hard to know without further context of your draw orders. Hope this helps! :)

edit: After reading it again, from what I gather it works perfectly fine without the enemy? I'm curious what the enemy is doing to cause this? do you have specific draw stuff happening in the enemy itself?
 
Last edited:
*sigh* Unfortunately I really struggle to articulate what I'm trying to say/mean and get really frustrated with myself so I've just spent ages typing out a long reply trying to explain what is happening. To help me try to explain I was watching a video of the game when I realised that what I thought was happening wasn't, and it only seems to be one particular object that is affected and seems to have nothing to do wit the shader at all. At least now I've got a starting point of where to look.
Thanks for taking the time to try and help anyway.
 

Gizmo199

Member
*sigh* Unfortunately I really struggle to articulate what I'm trying to say/mean and get really frustrated with myself so I've just spent ages typing out a long reply trying to explain what is happening. To help me try to explain I was watching a video of the game when I realised that what I thought was happening wasn't, and it only seems to be one particular object that is affected and seems to have nothing to do wit the shader at all. At least now I've got a starting point of where to look.
Thanks for taking the time to try and help anyway.
That's okay! Yeah sometimes errors are just impossible to explain. Haha. One of those "you have to see it to undestand" type things. Haha. Best of luck!
 
Top