shadow mapping

Started by
4 comments, last by Jernej.L 17 years, 5 months ago
Has anybody any idea, how can i get the image back, which is the shadow map for gl_arb_shadow (GL_DEPTH_TEXTURE_MODE_ARB & GL_COMPARE_R_TO_TEXTURE_ARB)? I tried glGetTexImage, but all i get back is null data, is there some kind of undocumented magic involved with this?

Projects: Top Down City: http://mathpudding.com/

Advertisement
Are you checking for GL errors? Calling glGetTexImage with a format of GL_DEPTH_COMPONENT should work.
With GL_DEPTH_COMPONENT i get exactly same result, null data, and glgeterror is GL_INVALID_ENUM.

Projects: Top Down City: http://mathpudding.com/

Quote:Original post by Delfi
With GL_DEPTH_COMPONENT i get exactly same result, null data, and glgeterror is GL_INVALID_ENUM.
Find out what's causing that error and fix it. GLIntercept is a great help for this.
What are you doing with the data? If you are trying to dump it to a file, the issue maybe with floating point. The data returned I think is 0 or 1 or 0-1. Either way if you dump this to a unsigned char type it will be 0 due to rounding, casting. Not sure if this is the case or not....
I dump it to file, i tried passing any constant that worked, and always get back zero data, not even floating point, it is just completely zeroed.

Projects: Top Down City: http://mathpudding.com/

This topic is closed to new replies.

Advertisement