Original Post
Please excuse my lack of knowledge but I am reading about stencil shadow volumes. I read about errors when using Depth-Pass algorithm and it hit me: every frame we perform raytracing test from camera to each light from which shadow volume is constructed. If ray intersects some geometry we can state that camera is in shadow volume for that particular light and we increase shadowRefCount by one. Now we set stencil buffer to shadowRefCount. If we now perform standard Depth-Pass algorithm for shadow volumes we''ll get correct values.
I know that I am missing something, but isn''t this possible?