• 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!

Shaders Help with Post Screen Crepuscular/God Rays...

Hey,

Thanks to the previous help from xygthop3 [Here: https://forum.yoyogames.com/index.php?threads/3d-position-to-2d-position.41203/], I was able to get my 3D Crepuscular Rays shader working. As said there I'm not too good when it comes to shader programming; so I'm not sure if this is possible.

Here is what I have at the minute:

This is good, but if I turn the camera around:

Light doesn't do that, and I don't want it to in the shader.

I guess what I'm asking, is how can I stop the rays from coming from any direction, rather than just from the sun? Currently Rays just come from anywhere that isn't occluded, which isn't good.

Thanks,
- TSB
 

obscene

Member
Well I have zero experience with 3D so I don't have the "right way" to fix it, but you could just fade the effect in and out based on the direction the camera is looking if you wanted to settle for a simple fix.

alpha=1-(abs(direction-sun_direction)*.012);

This would fade it to 0 by the time the camera was at 90 degrees to the sun.
 
Top