• Advertisement
Sign in to follow this  

Godrays with sprites?

This topic is 1884 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How would one create god rays in an environment with just sprites?

 

I mean I'd like something like this: Have sprites with trees in the background,and rays  racing between the gaps.

 

Is there a tutorial for this? I have basic knowledge of HLSL,but never created god rays.

Share this post


Link to post
Share on other sites
Advertisement

You can do that, it was done in a bunch of games a few years ago. Time consuming though and can't really match the detailed shapes of the occluders.

( you have your tree meshes place out, and then camera facing tri strips additively blended onto the scene manually placed to match the gaps in foliage with fixed light direction.

 

A more flexible and less time consuming approach could be tracing through your shadow maps for each pixel on screen, computing the shadow factor for a bunch of steps in the atmosphere. Great results.

A cheaper / simpler approach is the screen space one described in gpu gems 3 I think, where you effectively just do a bunch of directional blurs towards light direction, killing them off if they hit an occluder texel. 

Share this post


Link to post
Share on other sites

that looks good but all the code is in c#,and the shader code...well,it's a lot of code.Without a tutorial,I won't be able to implement it...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement