What exactly to store/restore for OpenGL state?
Hi,
I am working on an integration of NoesisGUI into the C4 engine. According to your to your integration docs, the GPU state has to be stored/restored before/after calls to Render(). Now, the OpenGL state is quite a beast - is there a more specific list, what exactly has to be stored/restored or invalidates? I know of the wrapper for the Leadwerks engine - is their implementation of OpenGLState::Store() and Restore() the way to go?
I am working on an integration of NoesisGUI into the C4 engine. According to your to your integration docs, the GPU state has to be stored/restored before/after calls to Render(). Now, the OpenGL state is quite a beast - is there a more specific list, what exactly has to be stored/restored or invalidates? I know of the wrapper for the Leadwerks engine - is their implementation of OpenGLState::Store() and Restore() the way to go?
Re: What exactly to store/restore for OpenGL state?
Yes, Store() and Restore() functions written for the wrapper are correct. Although it is not the ideal path. The best way, is having a way to invalidate the state cache to avoid setting all the states to the GPU, but it seems that there is now way to do that in LeadWerks.
By the way, I wonder why you need another integration instead of reusing the existing one. We could improve it if you need it.
By the way, I wonder why you need another integration instead of reusing the existing one. We could improve it if you need it.
Re: What exactly to store/restore for OpenGL state?
You mean another integration into Leadwerks? No, I'm itegrating this into the C4 Engine. Or is there an integration for that already?By the way, I wonder why you need another integration instead of reusing the existing one. We could improve it if you need it.
Re: What exactly to store/restore for OpenGL state?
No, sorry for the confusion. C4 engine, ok. Let me help with any trouble you find.
Re: What exactly to store/restore for OpenGL state?
What function calls are you thinking of for invalidating the state cache? I am not really an OpenGL guru, and the only functions for invalidating something are for framebuffers. But I don't know if there is a function call for invalidating the state cache as a whole or even parameter by parameter. Is there?
Re: What exactly to store/restore for OpenGL state?
The cache invalidation functionality must be provided by the engine itself, C4 in this case. Engines usually have a cache of states to avoid redundant calls. If there is no way to do that in C4, then you have to follow the LeadWerks way.
Re: What exactly to store/restore for OpenGL state?
OK. However, it seems I am currently stuck - I get exception during the initialization phase (invalid GLenums e.g.), probably because I am using 1.1.0 which isn't conpatible with OpenGL3+ ?
Will the OSX version of 1.2beta be out soon?
Will the OSX version of 1.2beta be out soon?
Re: What exactly to store/restore for OpenGL state?
Yes, you need v1.2. The windows version can be already downloaded. Could you test on Windows?
If you need OSX, please tell me and I will contact you in private with an internal version.
If you need OSX, please tell me and I will contact you in private with an internal version.
Re: What exactly to store/restore for OpenGL state?
Ok, I'll test on Windows, and if the initialization works there wirh C4 I'll PM you for the OSX version.
One further question: The Leadwerks wrapper creates its own framebuffer - is that necessary? What for? Do I have to do any render-to-texture stuff?
One further question: The Leadwerks wrapper creates its own framebuffer - is that necessary? What for? Do I have to do any render-to-texture stuff?
Re: What exactly to store/restore for OpenGL state?
You don't need a new framebuffer is you are rendering to the screen. LeadWerks wrapper is creating a new FrameBuffer when rendering to a texture. This functionality is optional.
You can use the same framebuffer bound by C4 when rendering with NoesisGUI, but, very important, make sure that there is Stencil active in that framebuffer.
You can use the same framebuffer bound by C4 when rendering with NoesisGUI, but, very important, make sure that there is Stencil active in that framebuffer.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 2 guests