Archive

Posts Tagged ‘Parallel Split Shadow Maps’

Opacity Shadow Maps in Crystal Space

After roughly a month of coding I managed to implement the render manager (RM) for opacity shadow maps (OSM).

The basic idea with OSM is slicing through the translucent object(s), with planes perpendicular to the light’s direction, and rendering to texture multiple times. These maps store the translucency amount (obtained using additive alpha blending) at particular distances and are used to approximate the translucency of every point from the object (the opacity function from the following picture).

Picture taken from OSM.

At the moment the OSM RM only supports a linear splitting scheme (interpolation), though it supports both multiple objects and lights. Next I will work on some more advanced splitting schemes, that should get rid of the visual artefact from linear splitting and also do some optimizations regarding the rendering targets and the collision test for each split.

Below you can find a comparison between OSM with 4 and 8 slices and the parallel split shadow maps implementation (PSSM) from CS:

  • PSSM

  • OSM with 4 splits

  • OSM with 8 splits

Advertisements

Setting up the scene

Before developing the new render manager (RM) for opacity shadow maps (OSM) I built a scene that can show the difference between various RM in CS. This scene contains some translucent objects, such as grass and a cloud made out of spheres. I built the scene using Blender 2.49 and exported it via blender2crystal.

Here is the scene rendered by 4 different RM:

  • unshadowed – this is the default RM in CS, and it renders the scene without any shadows

  • shadow_pssm – a parallel split shadow map implementation (PSSM), which is the only shadow RM present in CS

  • osm – a prototype of what I am going to implement, which is just a striped version of the unshadowed RM at the moment

As a side note PSSM are basically the same thing as Cascaded Shadow Maps (CSM), which I also wanted to implement for this project because they use multiple shadow maps and rendering positions, similar from this point of view to OSM. However, because they are already implemented I went directly to writing the OSM RM.