My current implementation of standard shadow mapping is similar to the nvidia demo. After rendering the lightview to a pbuffer, I use glCopyTexSubImage2D to copy the depth values of the pbuffer to a depth texture. Then I use ARB_Shadow and texgen for the shadow compare when rendering the shadow receivers. Overall everything works, but the glCopyTexSubImage2D call seems to take alot of time for a 1024x1024 depth map. I am also dissapointed by the pure black shadows. (No ARB_Shadow_Ambient on nvidia)
I was planning on implementing another version by:
- using a shader to encode the depth in a standard rgba texture
- and using ARB_Render_texture to avoid the copy
- finally, using another custom shader to do the compare when rendering receivers, this time dimming the shadows instead of pure black.
I am just looking for any validation of this approach - will it work and perform faster.
Thanks for any advice, tips, feedback,etc…