I'm working with modern opengl, and my goal is to debug a viewing frustum culling. In order to achieve this, I created another viewport, so I can look at my entire model and my frustum moving while I'm moving in my principal program.
It works, but there is still a strange behaviour I don't understand... my viewport are :
glViewport(0,0, screenWidth, screenHeight)
//render my program with motionned camera
glViewport(screenWidth/2, screenHeight/2, screenWidth/2, screenHeight/2)
//render my MotionLess Camera
Since I'm stacking them, I'm wondering if it creates an undefined behavior? Because my result isn't what I expected. (Here's the better draw you'll see ever! : )
In fact, What I thought is that my screen would be like the part red and darker red => My program is rendered on the red part, and my motionless camera on the darker red. But the yellow part appeared => My motionned camera is rendered on the red screen, it's ok. But my motionless camera is rendered in the yellow part, and the rest of the darker red is black.
I show you with my real example :
Do you know from where does it come from?
** EDIT : ** As datenwolf mentionned, my problem is due to the face that I'm rendering to FBO. And it seems that you do not want to use a glViewport offset other than (0,0) when you render in FBO (see this : HereIsAnAnswer).