Click here to Skip to main content
15,885,885 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I've been following these tutorials: rastertek.com but I have encountered an issue while doing tutorial #48, for some reason the shadows don't match the shape of the objects and are random glitches on the terrain, I've tried everything, copy+pasting files and shaders from the tutorials, I went over the code about 100 times checking it was right, but I can't get it to work correctly, I hope someone can help!

(Link to VS2010 project): Mediafire

EDIT: I believe this is an issue the render-to-texture setup or the shadow-shaders, I set the texture of a plane model to the render-to-texture output and all it showed was a large black image with a small white-to-black gradient in the center, that was slowly rotating, also, the terrain and shading looked absolutely nothing like what I saw on the render-to-texture, which lead me to believe the shadow shader wasn't reading the shadowmap properly

If you can't be bothered running the code, here's an image of my problem:
<img src="http://i.imgur.com/4YpzVyW.png" title="Hosted by imgur.com"/>

As you can see, the shadows are pretty retarded.
Posted
Updated 19-Oct-13 11:59am
v3
Comments
RedDk 18-Oct-13 21:27pm    
Have you tried backing down to the Dx10 example of the same tutorial, run the executable downloadable as-is? What is the sepcific error encountered? Does the same thing happen after downgrade to Dx10? Specific things like this will aid in solving posted problems here in Q&A.

http://www.codeproject.com/Forums/387159/Graphics.aspx

Might flip through this forum and find some more interesting ideas.
HuggableAlien 18-Oct-13 21:37pm    
I haven't tried the DX10 version, but when I run the exe provided the shadows work fine, which leads me to believe that it's an error in my code, if you download the project files and run them you will see what I mean, the shadows of the trees look like random morphing splodges on the ground along with what should be the terrain shadows. I'm not sure wether or not it's caused by me rendering the terrain in the shadowmap but that shouldn't break it. Now that you mention it, I will see what the difference is in the code between the Dx11 and Dx10 tutorials.
HuggableAlien 18-Oct-13 22:54pm    
I just had a look at the Dx10 code, it's highly impractical to try use some of the code in it, the difference in coding between Dx11 and Dx10 and also the HLSL coding is way too much, if there is anyone who could have a look at my code and maybe find something I missed, that would be great.

1 solution

I managed to fix it by downloading the source code off of the website and changing it to suit what I needed to render.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900