Forum Discussion
DoZo1971
11 years agoExplorer
Another "hidden" OpenGL state change in OculusSDK 0.3.1
Hi,
After a call to ovrHmd_EndFrame(), the vertex arrays in my own render loop no longer showed up.
Took me another hour to find that glBindBuffer(GL_ARRAY_BUFFER, ...) kept its specific binding.
This is now my code surrounding ovrHmd_EndFrame():
Does anyone have / know of some kind of OpenGL state snapshot functionality so that I can take a before / after "picture" and compare the two?
Thanks,
Daniel Dekkers
After a call to ovrHmd_EndFrame(), the vertex arrays in my own render loop no longer showed up.
Took me another hour to find that glBindBuffer(GL_ARRAY_BUFFER, ...) kept its specific binding.
This is now my code surrounding ovrHmd_EndFrame():
glDisable(GL_CULL_FACE); // Oculus wants CW orientations, avoid the problem by turning of culling...
glDisable(GL_DEPTH_TEST); // Nothing is drawn with depth test on...
ovrHmd_EndFrame(l_Hmd);
glBindBuffer(GL_ARRAY_BUFFER, 0); // Unbind GL_ARRAY_BUFFER for my own vertex arrays to work...
glEnable(GL_CULL_FACE); // Turn back on...
glEnable(GL_DEPTH_TEST); // Turn back on...
glClearDepth(1); // Oculus set this to 0 (the near plane), return to normal...
glUseProgramObjectARB(0); // Oculus shader is still active, turn it off...
Does anyone have / know of some kind of OpenGL state snapshot functionality so that I can take a before / after "picture" and compare the two?
Thanks,
Daniel Dekkers
3 Replies
- ElectricMucusExplorerDo you know this tutorial? Very helpful imo, I think that might solve your problem(s) but I'm not certain.
http://www.antongerdelan.net/opengl/glcontext2.html - DoZo1971ExplorerYes, something like that.
But I'm not expert enough to handle all the peculiarities of all the different OpenGL versions.
So I would end up with "some state", or "state that seems important for this particular project".
I guess GLEW would be a good placeholder. I'll drop it at their mailing list. - cyberealityGrand ChampionWe are working to resolve these issues with GL state changes in the next release of the SDK.
I'll be sure that the engineers are aware of this specific case. Thanks.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 5 months ago
- 6 months ago