Any hint why my shadow map is color red ?

My Clear color before render to texture is Black
My Clear color before render the scene with shadow map is CornFlowerBlue

EDIT : Also why is my shadow color white : - D

Fixed the RenderTarget to white now by changing RenderTarget, but still the Scene is red and the shadow is still white T __ T

 _RenderTarget = new RenderTarget2D
                (_Device.Renderer.GraphicDevice,
                    2048, 
                    2048,
                    true, _Device.Renderer.GraphicDevice.DisplayMode.Format, 
                    DepthFormat.Depth24
                );

I don’t think anyone can help you without the code you use.

1 Like

The shaders implementation is riemiers shadow maps, which can be found here http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series3/Shadow_map.php
but I have a very very large engine posting it here is not feasible : - D

Maybe a hint like check your graphics setting, null the graphics texture somewhere or maybe you should use this kind of Blend state or at end of rendering change your state something state to this or that ^_^y.

But most likely your right Jagg, I have mess on some part of my engine that cause the artifacts and probably not the custom effect since it’s almost identical to remier’s implementation.

I’ll dig into my engine thoroughly and find the causes ^_^y Thanks.

Since you’ve ported an XNA tutorial, you should check the common issue with shaders first. Most notably making sure that the vertex input matches what your shader expects and the output of the vertex shader and input of the pixel shader also match exactly (in both cases the order should be the same, rather than depending on the semantics).

1 Like

Nice hint Sir Jagg … I’ll check it out ^_^y …

:slight_smile: It’s working now… I’ve use XNA Shadow Mapping sample found here : http://xbox.create.msdn.com/en-US/education/catalog/sample/shadow_mapping_1 instead of riemers and following your Vertex/Pixel Order ^_^y Thanks…

1 Like