Sunbeam effect - how does it work

Started by
3 comments, last by Harry Hunt 16 years, 3 months ago
I've played Crysis and now I've seen a video of the upcoming FarCry 2 and both of those games feature a pretty neat volumetric sun ray effect.Check out this screenshot to see what I mean. I'm not entirely sure how this is implemented. I read somewhere that it's done using raytracing but of course that's pretty vague. Does anybody know of any papers or articles explaining the effect? Thanks a lot in advance.
Advertisement
I believe that there is a nice article in GPU gems 3 that explains a technique that is close to, if not basically the same, as the technique used in crysis. I dont believe that the technique mentioned in GPU gems is based on raytracing, though i dont have the book on me so im not completely sure
My guess would be that they do it by blurring towards the sun, checking the depth buffer along the way for occlusion.
The article coderchris refers to is "Volumetric Light Scattering as a Post-Process" by Kenny Mitchell, in GPU Gems 3. The basic idea is to trace a ray from each pixel to the light source in image-space, and use the number of occluders you hit as an attenuation factor. There are a bunch of other small details, but that's the general idea. You can pick up a copy of the book for more information, it's definitely worth it :)
awesome. Thanks everybody!

This topic is closed to new replies.

Advertisement