Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Writing to the depth texture in a FBO

4: Adsense

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   

1188
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!



#2 NumberXaero   Prime Members   

2608
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   GDNet+   

691
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   

50652
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   

1188
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.