Jump to content
  • Advertisement
Sign in to follow this  
maxgpgpu

OpenGL soft shadow algorithms

This topic is 3327 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What "soft shadow" algorithm gives the best combination of speed and appearance [with 3 to 8 lights] and OpenGL310/GLSL140 support? I read a few HTML and PDF soft-shadow articles recently, but most focus on their favorite approach, and none feel like an objective, unbiased review and comparison. Also, many articles assume older version APIs and shaders. I am guessing that floating-point depth buffers and other recent GPU capabilities might help some approaches considerably. Personal experiences and links to PDFs and HTML are welcome. Thanks. A related request for comments: Reading the OpenGL310/GLSL140 documents last night gave me the following idea that might speed some shadow algorithms considerably --- IF --- I understand what I've been reading about soft shadow algorithms. This idea is inspired by new features like blocks of uniform variables. What if 4 sets of transformation matrices are supplied to the GPU shaders in a large block of uniform variables - one set of transformation matrices for each of 4 light-sources (treating each light like a camera/viewpoint)? Is there any reason the shaders cannot create 4 separate depth buffers (in 4 separate FBO renderbuffers), one for each light? If so, wouldn't this be faster than a separate pass for each light? Something tells me this won't work, but I can't see why off hand.

Share this post


Link to post
Share on other sites
Advertisement
Quote:

This idea is inspired by new features like blocks of uniform variables. What if 4 sets of transformation matrices are supplied to the GPU shaders in a large block of uniform variables - one set of transformation matrices for each of 4 light-sources (treating each light like a camera/viewpoint)? Is there any reason the shaders cannot create 4 separate depth buffers (in 4 separate FBO renderbuffers), one for each light? If so, wouldn't this be faster than a separate pass for each light? Something tells me this won't work, but I can't see why off hand.


That is possible with GPUs that support geometry shaders and texture arrays, and optionally instancing. See the DX10-style acceleration in this GPU Gems 3 Article

They are using it to split the frustum of one light, but that's essentially the same as doing it for totally disjoint lights. This is also a good technique for point lights with cube-shadowmaps. The problem is that you can't do individual culling for each light on the CPU.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!