Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: can't do shadow mapping correctly

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2011
    Posts
    22

    can't do shadow mapping correctly

    Hi all,

    I've beening trying to do shadow mapping with glsl for a week, But I can't get the correct scene. I guess if it's because I didn't render the depth to texture correctly. and to clamp the coordinates of pixel into [0, 1] for texture look-up, do Ineed to multiply biasMatrix first then divide w or should I divide w then multiply biasMatrix? and can someone provide sample codes that be be built and run? Tnanks.
    Last edited by Sobeit; 05-06-2013 at 05:57 PM.

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Mar 2009
    Location
    Singapore
    Posts
    800
    Have u googled for something?
    The first 2 hits gave me these which show u everything u need.

    http://www.fabiensanglard.net/shadowmapping/index.php
    http://www.opengl-tutorial.org/inter...hadow-mapping/
    Regards,
    Mobeen

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2011
    Posts
    22
    thanks for attention. but yes, I have searched on the net for a while, either of tutorial you mentioned is using deprecated opengl api or I can't build it in VS2012.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Mar 2009
    Location
    Singapore
    Posts
    800
    OK here is the link to a more modern shadow mapping implementation from chapter 7 of the book OpenGL 4 shading language cookbook
    https://github.com/daw42/glslcookboo...ster/chapter07
    Regards,
    Mobeen

  5. #5
    Junior Member Newbie
    Join Date
    Aug 2011
    Posts
    22
    Thanks, I'll try that later.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •