GL_ARB_depth_texture info
Hi!
I'm working on an engine that displays pre-renderer background images.
I have the depth values for the image. I know about the depth texture extension but i don't know whether it suits my purpose or not. Can I use it to store the depth values in a texture and then render it to the depth-buffer?
Thanks!
IIRC depth texture allows you to do exactly the opposite -- that is, write depth into a texture.
One thing I can think of is using a pixel shader to write out Z based on a texture read, and draw a full screen quad like that. I can't say what the performance implications would be though, and it won't run on old hardware, which seems like where it would be the most useful.
One thing I can think of is using a pixel shader to write out Z based on a texture read, and draw a full screen quad like that. I can't say what the performance implications would be though, and it won't run on old hardware, which seems like where it would be the most useful.
Hey, thanks a lot.
I was actually using glDrawPixels(..., GL_DEPTH_COMPONENT, ...). After reading some threads on the forum, I think it wasn't working because i had the near plane at 0.1 and far plane at 1000 (!). I wanted another solution and came upon depth texture.
Thanks again for the reply.
I was actually using glDrawPixels(..., GL_DEPTH_COMPONENT, ...). After reading some threads on the forum, I think it wasn't working because i had the near plane at 0.1 and far plane at 1000 (!). I wanted another solution and came upon depth texture.
Thanks again for the reply.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement