Results 1 to 3 of 3

Thread: Any better way to do shadows in OpenGL (as opposed to stencil shadows)

  1. #1
    Senior Member Regular Contributor
    Join Date
    Jul 2003
    Location
    London
    Posts
    163

    Any better way to do shadows in OpenGL (as opposed to stencil shadows)

    I just did Nehe's tutorial lesson 27. It describes using a stencil buffer to do the shadows... I didn't quite understand that lesson (code wasn't commented best either) and I've found the stencil shadows to be quite hard to understand. Isn't there a better way to do the shadows? Any tutorials out there?
    Perhaps an extension that would simple allow for 'glShadows(TRUE)' and everything would be done automatically? I wonder if or why not such extension is or isn't available...
    Thanks again,
    Luke

  2. #2
    Junior Member Newbie
    Join Date
    Aug 2003
    Location
    nz
    Posts
    3

    Re: Any better way to do shadows in OpenGL (as opposed to stencil shadows)

    They should do that. I saw one extention but its not on my card. Did hard shadows anyways not soft.

  3. #3
    Senior Member Regular Contributor
    Join Date
    May 2003
    Location
    Germany
    Posts
    229

    Re: Any better way to do shadows in OpenGL (as opposed to stencil shadows)

    There are no extensions that just enabled shadows, but there are some extensions like GL_ARB_shadow and GL_ARB_shadow_ambient which are usefull for shadowcasting via shadowmaps.
    Projected Shadowmaps are easier to implement than volumetric stencil shadows, so you may loo k at this kind of shadowing.There's a sample-application for this technique including Sourcecode on my page, but it's coded in Delphi so it won't be of much use for you, but projective shadowmapping isn't that hard.
    But it has some backdraws, like problems when the object exceeds the frustum of your lightsource and heavy artifacts depending of your shadowmaps size.
    If you only need static shadows, then take a look at lightmaps with precomputed shadows.

Similar Threads

  1. Stencil Shadows
    By aje1234l in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 02-19-2014, 07:37 AM
  2. OpenGL, offscreen hard shadows calculation with stencil
    By elect in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 03-11-2013, 09:35 AM
  3. OpenGL Shadows and the Stencil Buffer
    By aviel in forum OpenGL: Basic Coding
    Replies: 31
    Last Post: 05-14-2011, 10:58 PM
  4. stencil shadows and fog
    By Pswin in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 02-24-2008, 03:04 PM
  5. Again stencil shadows.
    By Nikolai Timofeev in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 12-19-2006, 08:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean