Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: GLSL Shadow Map code sample.

  1. #1
    Intern Newbie
    Join Date
    Nov 2008
    Location
    Toronto, ON
    Posts
    48

    GLSL Shadow Map code sample.

    Hello guys,

    I've been tinkering a lot with shadowmap and GLSL lately, here are a few binaries with source code:

    Raw shadow mapping

    Percentage Closer Filtering shadow mapping

    Variance Shadow Mapping

    It uses GLUT for portability so it works on Win32, Mac and Linux.
    Hope it will help someone !


  2. #2
    Member Regular Contributor remdul's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands
    Posts
    335

    Re: GLSL Shadow Map code sample.

    Cool!

  3. #3
    Intern Newbie
    Join Date
    Dec 2008
    Posts
    41

    Re: GLSL Shadow Map code sample.

    Oh man, just got my bug fixed with my shadow maps. Looking to implement VSM's so that tut will be GREAT. thanks a lot!

  4. #4
    Junior Member Regular Contributor
    Join Date
    Apr 2006
    Location
    Kyoto.
    Posts
    126

    Re: GLSL Shadow Map code sample.

    Great stuff,

    I struggled a bit when I first did my shadow maps in OpenGL. someone on here was kind enough to link me to their tutorial on how to do it, and I had to strip his source down to the basics and see where I was making mistakes.

    Since then I had always planned on doing a Very Simple Shadows tutorial on GLSL shadow-mapping in GLUT, but it seems you have beaten me to it

  5. #5
    Intern Newbie
    Join Date
    Dec 2008
    Posts
    41

    Re: GLSL Shadow Map code sample.

    nevermind lol

  6. #6
    Junior Member Newbie
    Join Date
    Mar 2009
    Posts
    7

    Re: GLSL Shadow Map code sample.

    Thanks for the great tutorial Nicolas! One question though... how can you pull off this same thing without the extra GL_TEXTURE matrix translation? I can't seem to get it to work with that.

    Also, in the code, you're polling for a xPixelOffset and a yPixelOffset uniform that don't appear to exist in the shaders.

  7. #7
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,262

    Re: GLSL Shadow Map code sample.

    nicolasbol, thanks for the nice tutorials! Keep up the good work, we appreciate it a lot

  8. #8
    Junior Member Newbie
    Join Date
    Mar 2012
    Posts
    3

    Re: GLSL Shadow Map code sample.

    Why is the code with the PCF not working? I see no shadow(s)

  9. #9
    Junior Member Newbie
    Join Date
    Mar 2012
    Posts
    3

    Re: GLSL Shadow Map code sample.

    I found some informations: The PCF Code is only working on nvidia hardware. Any idea why?
    I found no extentions or something for that result

  10. #10
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,891

    Re: GLSL Shadow Map code sample.

    Quote Originally Posted by AMDFX
    I found some informations: The PCF Code is only working on nvidia hardware. Any idea why?
    I found no extentions or something for that result
    Check AMD's docs on enabling PCF shadow comparisons. NVidia may be allowing it for a combination of state that AMD is rejecting.

Posting Permissions

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