Last Updated: February 25, 2016
·
881
· pmynlabgames

Dynamic Shadows Windows Phone 7 / 8.

http://www.catalinzima.com/2013/01/dynamic-2d-shadows-for-windows-phone-7/

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:

From:

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

To:

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