Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


Member Since 26 Dec 2012
Offline Last Active Jan 19 2013 02:39 PM

Topics I've Started

Scene rendering entirely shadowed with shadow maps

26 December 2012 - 12:38 AM

After quite a bit of tinkering, I finally got an accurate depth image rendered to my FBO/into a texture. However, I can't seem to get the actual shadows to cast. I'm using http://fabiensanglard.net/shadowmapping/index.php as a reference.


Attached File  depth_shadow.png   4.95KB   54 downloads


This is my depth map as drawn from the lights POV, as per gDebugger after adjusting the slider to represent roughly .50 out of 1.0.  Here is how my scene looks after rendering.


Attached File  scene.png   23.34KB   58 downloads


I've got my matrices, shaders, etc. setup exactly as presented in Fabien Sanglards tutorial. I'm not necessarily looking for answer, but rather a point in to what would be causing my entire scene to be gray, rather than have shadows applied.


The only thing I can think of is how I have my perspective established:

       //set pers settings
       (800.0f) / (600.0f),10.0f,40000.0f);
       //load pers into matrix

Perhaps my zNear(10.0f) is too small? Or perhaps zFar(40000.0f) is too large? The depthmap shown in gDebugger looks alright to me, though. I'm using VBOs and AssImp if that affects anything; I can post my final scene rendering code(or any requested portion tongue.png) if that would aid in determining what's going on; I didn't want to clutter my first post too much tongue.png Thank you!