Last Updated: February 25, 2016
· pmynlabgames

Dynamic Shadows Windows Phone 7 / 8.

I tested this solution and on some device (HTC 8X, HTC7, LUMIA710) and 7/8 OS version and we can have something problems. We can resolve it by change RenderTarget2D parameters:


lightMap = new RenderTarget2D(GraphicsDevice, pp.BackBufferWidth, pp.BackBufferHeight, false, pp.BackBufferFormat, pp.DepthStencilFormat, pp.MultiSampleCount,RenderTargetUsage.DiscardContents);


lightMap = new RenderTarget2D(Director.GraphicsDevice, pp.BackBufferWidth, pp.BackBufferHeight, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8, pp.MultiSampleCount,RenderTargetUsage.DiscardContents);