Jump to content
  • Advertisement
Sign in to follow this  
chrisendymion

Understanding a paper's shadow volume algorithm

This topic is 1467 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

Hello ;)
 
I have trouble to understand a part of an algo for shadows volumes.
The paper is from Eric Bruneton (thanks to him) and can be found here : 
 
Bruneton uses a texture for storing deltaN, deltaZ, Zmin, Zmax.
 
You have no need to understand what are deltaN or deltaZ, my problem is with Zmin.
Zmin is the distance from camera to the nearest shadow volume front face.
 
He wrotes :
 
We associate with each pixel 4 values deltaN, deltaZ, Zmin, Zmax initialized to 0, 0, INFINITY, 0. 
In a first step we decrement (resp. increment) deltaN by
1 and deltaZ by the fragment depth z, and update Zmin and Zmax
with z, for each front (resp. back) face of the shadow surface.
 
And in the rendering passes :
 
We draw the shadow volume of the terrain into a deltaN, deltaZ,
Zmin, Zmax texture. For this we use the ADD and MAX blending
functions, disable depth write, and use a geometry
shader that extrudes the silhouette edges (as seen from the
sun).
 
I understand the algorythm, all is ok except the Zmin computation.
Why it is initialized to infinity ?
Blend modes are ADD and MAX, so I suppose ADD for RGB and MAX for Alpha.
With that deltaN (Red), deltaZ (Green) and Zmax (Alpha) are easy to compute.. 
But ADD with Zmin (Blue) ? How to get it ?
 
I have some workarounds for this problem, but I'm interested to understand how Bruneton did it.
 
Hope I was clear and sorry for my poor english ;)
 
Thank you,
 
Chris
Edited by chrisendymion

Share this post


Link to post
Share on other sites
Advertisement

I haven't read the paper, but what value would you assume zmin to be initialized to? think about what you clear your depthtarget to before drawing with basic forward renderer.

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!