Pages

Showing posts with label area lights. Show all posts
Showing posts with label area lights. Show all posts

Friday, 16 April 2010

Area lights 2

Thought I'd show some more progress on area lights. In the previous images, the light's position and radius had to be specified in code so my first task was to enable the export of lights directly from the max scene. This was fairly easy as it only involved exporting the lights transform matrix, color, width, length, radius (used for sphere or disc type lights) and sample count. 3DS max photometric lights have all of the above properties so there was no need to script any custom object types.

The rectangular area lights shown here are very similar to the spherical area lights shown in the previous post. The biggest difference being that these rectangular lights primarily radiate along one axis.

2 512x512 light maps render time: 2m30s

3 512x512 light maps render time: ~1m (only used 640 FG samples so the solution is a bit rough)

8 512x512 light maps render time: ~3m

8 512x512 light maps render time: ~3m

Monday, 12 April 2010

High Quality GPU soft shadows

I recently got around to trying out a high quality GPU shadow method. Whilst I'm happy with the way final gather is working it's not very good at accurate shadows. The limited number of FG rays means the shadows tend to be overly soft. Things improve with an increased ray count but it hurts render times.

The technique I'm using is a pretty straightforward extension of regular shadow mapping. It involves rendering multiple shadow maps from offset positions and averaging the results. For the sphere area light seen here, 256 randomly jittered offset vectors were generated and used to render multiple depth cube maps. The quality of the shadow map increases with the number of samples used and larger lights require more samples.

Shown below is a spherical area light. Other types of area light sources such as disc or rectangle lights are also possible.






Render times:

Sponza 13 lightmaps ~1min 30s
Cornell - Spheres 8 lightmaps ~0min 55s
Cornell - Robot1 8 lightmaps ~0min 49s
Cornell - Robot2 8 lightmaps ~0min 49s

Notes:
> Shadow map for all scenes rendered in roughly 2 seconds.
> Each lightmap is 512x512
> Roughly 2600 final gather samples used in all scenes.