Monday 2 January 2012

My fun with shadow mapping

The first thing I noticed when trying to adapt the shadow mapping example from Msdn was it extends the model render content pipeline again.

No big deal as I've already done this to get my bounding boxes so I've just ripped out the new custom effect rendering code and added it to my existing custom content pipeline.

This example uses a custom effect and not the standard basic effect. From what I can tell, this custom effect is responsible for figuring out which pixel should be in shadow from the shadow map.

Once I had added the code to my custom content processor extension I started getting some strange long error messages about the effect is null.

It turns out that if you have a custom content processor that uses a custom effect, you have to tell visual studio that the model using the custom content processor also knows the name of the custom effect file. You just do this in the properties explorer.

So my initial implementation of the shadow map didn't work as planned. Partly because I had no idea what I was doing and blindly copy and pasting and hoping for the best.

No comments:

Post a Comment