November 16, 2012

God Rays

by Niklas Hansson

For this week we have something exciting to share with you if you have watched our windows earlier they have been kinda boring a yellowish light only that you can’t see through. This was never intended to be a permanent solution but rather a”Well it’s better than it being black” solution. But it stuck around for surprisingly long. We recently started doing a bit of work where we cast rays from the camera through the corners of the window and use this to texture map a quad with the directions from the sky box. There was some issues with the normal lightning kicking in too because it’s a deferred rendering engine but they where solvable.

So after this we had our artists go in and add some really nice volumetric lightning effects by using additive polygonal planes. This started to looking really nice but to try to enhance the effect we decided to tru to create an implementation of crepuscular rays aka God Rays that we hoped would do two things. Once is filling out the artist made volumetric rays to create an even stronger feeling when you where looking into a window, But also to get some actual coloring depending on the light on the outside in the effect.

The basic implementation was a simple matter it’s basically a biased radial blur with some occlusion added in, very similar to the Kenny Mitchell article. However we apply the area to blur quite differently. We use all our windows as sun colors and even add in fr each window an approximation of how much sunlight would reach it even if the sun wasn’t visible. we also had to do some nice clipping of values to create a consistent look.


We are also working very hard on getting two of our new environments up and ready for use in real levels and they are looking really promising. And a lot of different game play tweaks and system changes, things really are moving well along and we hope to have even more exciting news to share with you shortly.

Share this

God Rays God Rays God Rays God Rays