Results 1 to 2 of 2

Thread: heavy Stencil Shadows

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2014
    Posts
    17

    heavy Stencil Shadows

    Hello i am creating a 3d world with opengl and i recently apllied shadows with the stencill buffer. The shadows looks perfect but i have a problem.
    Stencil shadows are extremelly heavy rendering when i use it to all my objects in scene( i mean when all objects casts shadows ). The scene consists of buildings
    and trees and free roaming between them. Is there a way to make the shadows more easy rendering?
    I used display lists but the performace increased a little. Is there a way to store the shadow matrix in some array and use it latter.

    Thanks...

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,651
    Quote Originally Posted by aje1234l View Post
    Hello i am creating a 3d world with opengl and i recently apllied shadows with the stencill buffer. The shadows looks perfect but i have a problem.
    Stencil shadows are extremelly heavy rendering when i use it to all my objects in scene( i mean when all objects casts shadows ).
    Yep.

    The scene consists of buildings and trees and free roaming between them. Is there a way to make the shadows more easy rendering?
    There are things you can do to try and reduce the hit of stencil shadows, but there are no two ways about it: They can be very heavy on fill, if you can't bound the drivers of that fill. For instance, a tiny projected shadow from a complex object can require multiple layers of fill extending across the entire screen! Ouch!

    Some things to look at: cull your shadow volumes (if one can't intersect the view frustum, or cast a shadow on anything within it, then...), two-sided stencil, depth pass instead of depth-fail when you can, and that's just getting started.

    You may instead want to consider a shadow map-based approach. They've got their quirks, but they're not such fill pigs (or state change pigs). They're much easier on the CPU side, and the GPU-side (being depth-only) is lightning fast. You'll still want to cull objects into your shadow frustum (or frusta) intelligently, but beyond that, just toss it all at the GPU and let it sort it out.

Similar Threads

  1. Stencil Shadows
    By aje1234l in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 02-19-2014, 07:37 AM
  2. stencil shadows and fog
    By Pswin in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 02-24-2008, 03:04 PM
  3. Again stencil shadows.
    By Nikolai Timofeev in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 12-19-2006, 08:27 PM
  4. Replies: 2
    Last Post: 08-17-2003, 01:57 AM
  5. Stencil Shadows
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-21-2002, 09:23 AM

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