Skip to content

Commit

Permalink
Gui: do not enable lighting when rendering from image or framebuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed May 3, 2023
1 parent a0fc6bc commit d02ce19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Gui/View3DInventorViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2035,6 +2035,7 @@ void View3DInventorViewer::renderFramebuffer()
const SbViewportRegion vp = this->getSoRenderManager()->getViewportRegion();
SbVec2s size = vp.getViewportSizePixels();

glPushAttrib(GL_ALL_ATTRIB_BITS);
glDisable(GL_LIGHTING);
glViewport(0, 0, size[0], size[1]);
glMatrixMode(GL_PROJECTION);
Expand Down Expand Up @@ -2068,15 +2069,15 @@ void View3DInventorViewer::renderFramebuffer()
if (naviCubeEnabled)
naviCube->drawNaviCube();

glEnable(GL_LIGHTING);
glEnable(GL_DEPTH_TEST);
glPopAttrib();
}

void View3DInventorViewer::renderGLImage()
{
const SbViewportRegion vp = this->getSoRenderManager()->getViewportRegion();
SbVec2s size = vp.getViewportSizePixels();

glPushAttrib(GL_ALL_ATTRIB_BITS);
glDisable(GL_LIGHTING);
glViewport(0, 0, size[0], size[1]);
glMatrixMode(GL_PROJECTION);
Expand All @@ -2100,8 +2101,7 @@ void View3DInventorViewer::renderGLImage()
if (naviCubeEnabled)
naviCube->drawNaviCube();

glEnable(GL_LIGHTING);
glEnable(GL_DEPTH_TEST);
glPopAttrib();
}

// #define ENABLE_GL_DEPTH_RANGE
Expand Down

0 comments on commit d02ce19

Please sign in to comment.