Monday, July 6, 2015

New shadow implementation

To this point MoonBase69 implemented a shadow technique called 'Stencil-shadows'. It is easy to set up, yields accurate shadows and supports self-shadowing. There are however two drawbacks:
  • Stencil shadows are calculated on the CPU and becomes more expensive in terms of computation time. With the new high-poly meshes from makehuman the framerate suffers. In fact, the performance was essentially limited by the CPU even before the new meshes.
  • Stencil shadows do not work well with transparent materials. I do however want to have transparent materials, maybe for clothing but surely for windows instead of walls to give the station a more open look.
Because of this the shadow technique is currently being changed to 'Texture-shadows'. They are calculated on the GPU and can handle transparent materials. They do have however other issues, notably they require some efforts to enable self-shadowing.

Getting this system working took a while and is not finalized, but the result for a demo scene do look good and a early implementation in the main scene does indicate a significant drop in terms of CPU load.

No comments:

Post a Comment