Jump to content
  • Advertisement
Sign in to follow this  
LordSputnik

Multiple viewports

This topic is 3794 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I'm using two viewports an orthographic view, the size of the whole screen, and a perspective view which is a smaller size. My problem is this: When I try to draw a quad in the orthographic viewport onto the portion of the screen that also uses the perspective viewport, it doesn't show up. I don't understand this, as I'm allowing the ortho one access to the whole screen, and rendering into it after the perspective one, so shouldn't any quads be drawn over the top? Many Thanks, Sputty.

Share this post


Link to post
Share on other sites
Advertisement
most likely the stuff is failing the depthtest
solution - clear the depth buffer before each of the viewport views

Share this post


Link to post
Share on other sites
Changing the viewport doesn't clear the depthbuffer. If you draw a quad using another projection matrix the depth test might fail, like zedz indicated.

It should work if you either clear the depth buffer, disable depth testing for the quads or depth writes for the smaller viewport, set the appropiate coordinates to 0 for the quad (resulting in depth 0). What is appropriate depends on your needs.

Share this post


Link to post
Share on other sites
... Guess what? It turns out I was giving the orthographic one the wrong co-ordinates... :P Thanks for your suggestions anyway :S

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!