Jump to content

  • Log In with Google      Sign In   
  • Create Account


Writing to the depth texture in a FBO


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Wilhelm van Huyssteen   Members   -  Reputation: 964

Like
0Likes
Like

Posted 08 January 2013 - 05:05 PM

Hi.

 

I have an FBO with several normal textures and one depth texture. I want to copy one of the normal textures to the depth texture. I've tried this by attempting to draw a full screen quad directly to the depth texture but it seems I cant use the depth texture as a render target.

 

How should I do this?

 

Thanks in Advance!



Sponsor:

#2 NumberXaero   Prime Members   -  Reputation: 1429

Like
0Likes
Like

Posted 08 January 2013 - 07:00 PM

Could use some more info on what youre trying to do, why cant you use the depth texture as a render target? are you getting errors? or is it just not rendering anything?



#3 Nyssa   Members   -  Reputation: 426

Like
0Likes
Like

Posted 08 January 2013 - 09:14 PM

Edit : My answer wouldn't give you what your after wacko.png . The post below is right :)  


Edited by Nyssa, 08 January 2013 - 09:35 PM.


#4 Hodgman   Moderators   -  Reputation: 29712

Like
3Likes
Like

Posted 08 January 2013 - 09:28 PM

You can use gl_FragDepth to write out your own depth-values instead of using the ones generated by the rasterizer.

 

n.b. this generally disables Hi-Z optimizations for that depth-buffer until the next clear, as the Hi-Z buffers are generally populated by the rasterizer (which is incorrect in the case where you've replaced it's depth values).



#5 Wilhelm van Huyssteen   Members   -  Reputation: 964

Like
0Likes
Like

Posted 09 January 2013 - 10:05 AM

Thanks for the reply thats what I needed.

Edited by Wilhelm van Huyssteen, 09 January 2013 - 02:12 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS