Understanding a paper's shadow volume algorithm

Started by
0 comments, last by Burnt_Fyr 9 years, 7 months ago
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
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.

This topic is closed to new replies.

Advertisement