mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-09 04:49:43 -05:00
Make sure model rendering works with an odd number of atmospheres
This commit is contained in:
@@ -65,6 +65,10 @@ public:
|
||||
* for all RenderBins. However, it cannot be used at the same time as the Deferred
|
||||
* Caster Tasks. The size of the texture is the resolution of the viewport.
|
||||
*
|
||||
* NOTE (malej 2023-FEB-21): The currently NOT used pingPongTexture might change
|
||||
* depending on where in the render cycle you are. Especially after the Deferred
|
||||
* Caster Tasks.
|
||||
*
|
||||
* \return GLuint identifier of the currently NOT used pingPongTexture
|
||||
*/
|
||||
GLuint additionalColorTexture1();
|
||||
|
||||
@@ -624,7 +624,7 @@ void RenderableModel::initializeGL() {
|
||||
// Check status
|
||||
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||
if (status != GL_FRAMEBUFFER_COMPLETE) {
|
||||
LERROR("Framebuffer is not complete!");
|
||||
LERROR("Framebuffer is not complete");
|
||||
}
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
|
||||
@@ -787,6 +787,21 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) {
|
||||
// Prepare framebuffer
|
||||
GLint defaultFBO = ghoul::opengl::FramebufferObject::getActiveObject();
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, _framebuffer);
|
||||
|
||||
// Re-bind first texture to use the currently not used Ping-Pong texture in the
|
||||
// FramebufferRenderer
|
||||
glFramebufferTexture(
|
||||
GL_FRAMEBUFFER,
|
||||
GL_COLOR_ATTACHMENT0,
|
||||
global::renderEngine->renderer()->additionalColorTexture1(),
|
||||
0
|
||||
);
|
||||
// Check status
|
||||
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||
if (status != GL_FRAMEBUFFER_COMPLETE) {
|
||||
LERROR("Framebuffer is not complete");
|
||||
}
|
||||
|
||||
glDrawBuffers(3, ColorAttachmentArray);
|
||||
glClearBufferfv(GL_COLOR, 1, glm::value_ptr(glm::vec4(0.f, 0.f, 0.f, 0.f)));
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
Reference in New Issue
Block a user