David's Blog

Mostly Hobby Stuff

Lights and Shadows

leave a comment »

OK, today I got the chance to do a bit on lights. In particular I fixed issues with lights contained within models which have scale applied. I also added support for light filter groups, so the objects which a light is applied to can be selected.

In addition I added an option to limit the number of shadow slices which have blur applied to them. This was quite a performance win, it appears I am more fill rate limited than I thought (PerfHUD can be very misleading in this respect). Despite the fact that this was mainly an optimization, it actually improves the appearance of the shadows. Artefacts from using a constant width filter kernel between slices and over blurring in some areas are eliminated.

Still to do on shadows:

  • Most importantly I need to clamp the CSM frustum slices to a fixed grid, which should eliminate a lot of shimmering during movement.
  • Try using MSAA for shadows maps. In principle this should work with VSM and is probably a quality and performance gain. i.e. I think MSAA will require less bandwidth and be more accurate than the blur I am using at the moment(unless I am missing something).
  • Add shadow filtering in addition to light filtering, i.e. choosing which objects cast shadows etc. Although I am not sure how effective this will be since VSM needs casters and occluders to be rendered into the shadow map. Despite this the grass etc seem to receive shadows fine, despite not casting shadows.


(Note shadow map resolution is 512, Slices 4 and Blur samples 4)


Written by therealdblack

April 10, 2010 at 5:06 pm

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: