Commit 28c19035 authored by Jan Möbius's avatar Jan Möbius

Merge branch 'dev_mh2' into 'master'

Fix facesColoredPerFaceFlatShaded rendering, avoid runtime warnings

See merge request !13
parents cbd0e3b6 c44f2820
......@@ -806,7 +806,9 @@ void VolumeMeshNodeT<VolumeMeshT>::getCellRenderObjects(IRenderer* _renderer, GL
ro.vertexDecl = cellsBufferManager_.getVertexDeclaration();
ro.glDrawArrays(GL_TRIANGLES, 0, cellsBufferManager_.getNumOfVertices());
_renderer->addRenderObject(&ro);
if (cellsBufferManager_.getNumOfVertices() > 0) {
_renderer->addRenderObject(&ro);
}
}
template<class VolumeMeshT>
......@@ -858,6 +860,12 @@ void VolumeMeshNodeT<VolumeMeshT>::getFaceRenderObjects(IRenderer* _renderer, GL
ro.shaderDesc.numLights = -1;
ro.shaderDesc.shadeMode = SG_SHADE_GOURAUD;
}
else if (_drawMode & drawModes_.facesColoredPerFaceFlatShaded)
{
ro.shaderDesc.vertexColors = true;
ro.shaderDesc.numLights = -1;
ro.shaderDesc.shadeMode = SG_SHADE_FLAT;
}
else
{
ro.shaderDesc.numLights = 0;
......@@ -868,7 +876,9 @@ void VolumeMeshNodeT<VolumeMeshT>::getFaceRenderObjects(IRenderer* _renderer, GL
ro.vertexDecl = facesBufferManager_.getVertexDeclaration();
ro.glDrawArrays(GL_TRIANGLES, 0, facesBufferManager_.getNumOfVertices());
_renderer->addRenderObject(&ro);
if (facesBufferManager_.getNumOfVertices() > 0) {
_renderer->addRenderObject(&ro);
}
}
template<class VolumeMeshT>
......@@ -914,7 +924,9 @@ void VolumeMeshNodeT<VolumeMeshT>::getEdgeRenderObjects(IRenderer* _renderer, GL
ro.vertexDecl = edgesBufferManager_.getVertexDeclaration();
ro.glDrawArrays(GL_LINES, 0, edgesBufferManager_.getNumOfVertices());
_renderer->addRenderObject(&ro);
if (edgesBufferManager_.getNumOfVertices() > 0) {
_renderer->addRenderObject(&ro);
}
}
template<class VolumeMeshT>
......@@ -957,7 +969,9 @@ void VolumeMeshNodeT<VolumeMeshT>::getVertexRenderObjects(IRenderer* _renderer,
ro.vertexDecl = verticesBufferManager_.getVertexDeclaration();
ro.glDrawArrays(GL_POINTS, 0, verticesBufferManager_.getNumOfVertices());
_renderer->addRenderObject(&ro);
if (verticesBufferManager_.getNumOfVertices() > 0) {
_renderer->addRenderObject(&ro);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment