Accelerate 3D rendering with VBO support

*First step to move Part rendering using VBO instead of direct rendering
*Update comments inside the code
*Assume VBO is available if OpenGL > 3.0 is detected
*Add initial Color support to VBO rendering !
*Initial full feature VBO rendering implementation
*Modify some include issue for linux build
*Try to fix linux include header
*Reupdate header include for linux support
*Fix compilation on linux
*Fix linux and MacoOS build
*Fix glGetString definition
*Fix Windows build
*Add VBO support as an option into the Preference menu
*Fix crash while running FreeCAD test bench with new VBO rendering infrastructure (in both cases)
*Improve performances
*Compute material index only when a VBO update is required (improve frame rate by 10%)
*Clean the code
*Fix Travis compilation warning
*Try to fix Windows compilation issue
*Update include for Windows
This commit is contained in:
Jean-Marie Verdun
2017-02-05 21:10:57 +01:00
committed by wmayer
parent b5ad50abfd
commit 44af3629db
9 changed files with 488 additions and 57 deletions

View File

@@ -787,6 +787,11 @@ void View3DInventorViewer::setEnabledFPSCounter(bool on)
fpsEnabled = on;
}
void View3DInventorViewer::setEnableduseVBO(bool on)
{
vboEnabled = on;
}
void View3DInventorViewer::setAxisCross(bool on)
{
SoNode* scene = getSceneGraph();
@@ -1339,7 +1344,10 @@ void View3DInventorViewer::actualRedraw()
break;
}
}
bool View3DInventorViewer::get_vbo_state()
{
return vboEnabled;
}
void View3DInventorViewer::renderFramebuffer()
{
const SbViewportRegion vp = this->getSoRenderManager()->getViewportRegion();
@@ -1408,7 +1416,7 @@ void View3DInventorViewer::renderGLImage()
glEnable(GL_DEPTH_TEST);
}
//#define ENABLE_GL_DEPTH_RANGE
// #define ENABLE_GL_DEPTH_RANGE
// The calls of glDepthRange inside renderScene() causes problems with transparent objects
// so that's why it is disabled now: http://forum.freecadweb.org/viewtopic.php?f=3&t=6037&hilit=transparency
@@ -1442,6 +1450,7 @@ void View3DInventorViewer::renderScene(void)
SoGLRenderActionElement::set(glra->getState(), glra);
glra->apply(this->backgroundroot);
navigation->updateAnimation();
try {