Copy depth texture

Started by
2 comments, last by O-san 14 years, 10 months ago
Hello! I am trying to copy a shadow map texture into another texture using glCopyTexSubImage2D but to no avail. Is it possible to copy depth data from an fbo using that function? If not, can I do it in another way? Any help appreciated.
Advertisement
Yes, it works. Is the other texture a GL_DEPTH_COMPONENT format?
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
as V-man saiz, it should work (Ive done it FWIW)
an alternative is just to draw that depth texture into the other FBO
Thanks! I must be doing something wrong then.. I just have to figure it out. :)

This topic is closed to new replies.

Advertisement