Jump to content

  • Log In with Google      Sign In   
  • Create Account


How implements Sun Shafts[S.T.A.L.K.E.R.: Clear Sky Method]


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 ken2240   Members   -  Reputation: 146

Like
0Likes
Like

Posted 23 November 2012 - 10:00 AM

Hi, All

I know how to implement the Sun Shafts of screen space that is used in CryEngine.

However, this way is ineffective if the sun does not exist in a screen.

I want to implement a Sun Shafts that are used in the Stalker.

How does this method implement it?

If you may know some, please teach me.

I am glad when there are documents and source code.

Sponsor:

#2 MrDaaark   Members   -  Reputation: 3551

Like
0Likes
Like

Posted 23 November 2012 - 11:02 AM

Aren't those properly called God Rays? These seems to be a lot of good stuff on Google about them.

#3 ken2240   Members   -  Reputation: 146

Like
0Likes
Like

Posted 23 November 2012 - 11:55 AM

I search it by the word Sun Shafts,God Rays and Crepuscular rays.
However, I am found only for implementation of CryEngine.
Please Help!

#4 wildboar   Members   -  Reputation: 281

Like
0Likes
Like

Posted 23 November 2012 - 12:52 PM

there are a few demos with full source code in google just search 'screen space god rays' or 'screen space sun-shafts' and look at results on first page. I have used those when making it in my engine.

#5 ATEFred   Members   -  Reputation: 1056

Like
1Likes
Like

Posted 23 November 2012 - 01:14 PM

One technique to get volumetric shadows / godrays that are present even when the light source is not visible is marching through the shadowmap.
So for sun/directional light for example you would do a full screen pass, potentially downres-ed for performance reasons, where for each pixel you step through the scene from pixel pos to scene pos, sampling the shadow map at each step. This gives you the atmosphere amount in shadow.

#6 ken2240   Members   -  Reputation: 146

Like
0Likes
Like

Posted 23 November 2012 - 01:14 PM

I found only one information. Crepuscular rays of X-Ray Engine seems to be using the depth map.

I want to know the implementation crepuscular rays are visible even when the sun does not exist in the screen.

#7 ken2240   Members   -  Reputation: 146

Like
0Likes
Like

Posted 23 November 2012 - 01:22 PM

Thanks for the detailed reply.
I'll try to practice.

#8 theagentd   Members   -  Reputation: 557

Like
0Likes
Like

Posted 24 November 2012 - 11:11 AM

Posted Image
Uploaded with ImageShack.us
You mean this? Ray marching is the way to go! It's not even that expensive compared to a radial blur as long as you use a small shadow map. You can even do it in half resolution and blur it like SSAO.

#9 Tsus   Members   -  Reputation: 1025

Like
0Likes
Like

Posted 26 November 2012 - 08:11 AM

Kenny Mitchell published an article in GPU Gems 3, called Volumetric Light Scattering as a Post-Process.
There is also some code in this chapter.
Best regards

Acagamics e.V. – IGDA Student Game Development Club (University of Magdeburg, Germany)


#10 Coluna   Members   -  Reputation: 282

Like
0Likes
Like

Posted 26 November 2012 - 09:55 AM

I posted something similar on my blog some time ago:

jcoluna.wordpress.com/2012/06/05/light-shafts-tone-mapping/

The source code+assets are available for download, hope it helps.
-J.Coluna

Edited by Coluna, 26 November 2012 - 10:12 AM.


#11 ATEFred   Members   -  Reputation: 1056

Like
0Likes
Like

Posted 26 November 2012 - 01:22 PM

The problem with those techniques vs the marching through the SM is that you need a visible light source on screen / occluders on screen to get proper light shafts.
Using the shadow map information means they will be correct regardless of where the light source and occluders are. Your main issue becomes dealing with occluders which are not in the sm range. You can also use the ray marching pass to compute atmospheric scattering, which is a nice added bonus.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS