Commit 6bf1081c authored by Jan Möbius's avatar Jan Möbius
Browse files

Comment out not compilable code

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14924 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 3327be2f
...@@ -576,174 +576,174 @@ void ACG::SceneGraph::MeshNodeT<Mesh>::getRenderObjects( IRenderer* _renderer, G ...@@ -576,174 +576,174 @@ void ACG::SceneGraph::MeshNodeT<Mesh>::getRenderObjects( IRenderer* _renderer, G
{ {
//RenderObject ro = {0}; // zeromem //RenderObject ro = {0}; // zeromem
// TODO : RIGHT initialization // TODO : RIGHT initialization
ro.initFromState(&_state); // ro.initFromState(&_state);
//
// shader gen setup (lighting, shademode, vertex-colors..) // // shader gen setup (lighting, shademode, vertex-colors..)
//
for (unsigned int i = 0; i < _drawMode.getNumLayers(); ++i) // for (unsigned int i = 0; i < _drawMode.getNumLayers(); ++i)
{ // {
const DrawModes::DrawModeProperties* props = _drawMode.getLayer(i); // const DrawModes::DrawModeProperties* props = _drawMode.getLayer(i);
//
// reset renderobject // // reset renderobject
ro.priority = 0; // ro.priority = 0;
ro.depthRange = Vec2f(0.0f, 1.0f); // ro.depthRange = Vec2f(0.0f, 1.0f);
ro.depthTest = true; // some previous node disabled depth testing // ro.depthTest = true; // some previous node disabled depth testing
ro.depthWrite = true; // ro.depthWrite = true;
ro.depthFunc = GL_LESS; // ro.depthFunc = GL_LESS;
//
// ------------------------ // // ------------------------
// 1. setup drawMesh based on property source // // 1. setup drawMesh based on property source
//
//
if (props->flatShaded()) // if (props->flatShaded())
drawMesh_->setFlatShading(); // drawMesh_->setFlatShading();
else // else
drawMesh_->setSmoothShading(); // drawMesh_->setSmoothShading();
//
//
ro.shaderDesc.vertexColors = true; // ro.shaderDesc.vertexColors = true;
//
switch (props->colorSource()) // switch (props->colorSource())
{ // {
case DrawModes::COLOR_PER_VERTEX: drawMesh_->usePerVertexColors(); break; // case DrawModes::COLOR_PER_VERTEX: drawMesh_->usePerVertexColors(); break;
case DrawModes::COLOR_PER_FACE: drawMesh_->usePerFaceColors(); break; // case DrawModes::COLOR_PER_FACE: drawMesh_->usePerFaceColors(); break;
default: // default:
{ // {
drawMesh_->disableColors(); // drawMesh_->disableColors();
ro.shaderDesc.vertexColors = false; // ro.shaderDesc.vertexColors = false;
} break; // } break;
} // }
//
switch (props->normalSource()) // switch (props->normalSource())
{ // {
case DrawModes::NORMAL_PER_VERTEX: drawMesh_->usePerVertexNormals(); break; // case DrawModes::NORMAL_PER_VERTEX: drawMesh_->usePerVertexNormals(); break;
case DrawModes::NORMAL_PER_HALFEDGE: drawMesh_->usePerHalfedgeNormals(); break; // case DrawModes::NORMAL_PER_HALFEDGE: drawMesh_->usePerHalfedgeNormals(); break;
default: break; // default: break;
} // }
//
ro.shaderDesc.textured = true; // ro.shaderDesc.textured = true;
//
switch (props->texcoordSource()) // switch (props->texcoordSource())
{ // {
case DrawModes::TEXCOORD_PER_VERTEX: drawMesh_->usePerVertexTexcoords(); break; // case DrawModes::TEXCOORD_PER_VERTEX: drawMesh_->usePerVertexTexcoords(); break;
case DrawModes::TEXCOORD_PER_HALFEDGE: drawMesh_->usePerHalfedgeTexcoords(); break; // case DrawModes::TEXCOORD_PER_HALFEDGE: drawMesh_->usePerHalfedgeTexcoords(); break;
default: // default:
{ // {
ro.shaderDesc.textured = false; // ro.shaderDesc.textured = false;
}break; // }break;
} // }
//
// ------------------------ // // ------------------------
// 2. prepare renderobject // // 2. prepare renderobject
//
//
// enable / disable lighting // // enable / disable lighting
ro.shaderDesc.numLights = props->lighting() ? 0 : -1; // ro.shaderDesc.numLights = props->lighting() ? 0 : -1;
//
// TODO: better handling of attribute sources in shader gen // // TODO: better handling of attribute sources in shader gen
if (props->flatShaded()) // if (props->flatShaded())
ro.shaderDesc.shadeMode = SG_SHADE_FLAT; // ro.shaderDesc.shadeMode = SG_SHADE_FLAT;
//
switch (props->lightStage()) // switch (props->lightStage())
{ // {
case DrawModes::LIGHTSTAGE_SMOOTH: ro.shaderDesc.shadeMode = SG_SHADE_GOURAUD; break;; // case DrawModes::LIGHTSTAGE_SMOOTH: ro.shaderDesc.shadeMode = SG_SHADE_GOURAUD; break;;
case DrawModes::LIGHTSTAGE_PHONG: ro.shaderDesc.shadeMode = SG_SHADE_PHONG; break;; // case DrawModes::LIGHTSTAGE_PHONG: ro.shaderDesc.shadeMode = SG_SHADE_PHONG; break;;
case DrawModes::LIGHTSTAGE_UNLIT: ro.shaderDesc.shadeMode = SG_SHADE_UNLIT; break;; // case DrawModes::LIGHTSTAGE_UNLIT: ro.shaderDesc.shadeMode = SG_SHADE_UNLIT; break;;
} // }
//
//
// handle 'special' primitives (wireframe, hiddenline, primitives in sysmem buffers).. // // handle 'special' primitives (wireframe, hiddenline, primitives in sysmem buffers)..
//
if (props->primitive() == DrawModes::PRIMITIVE_WIREFRAME) // if (props->primitive() == DrawModes::PRIMITIVE_WIREFRAME)
{ // {
ro.shaderDesc.shadeMode = SG_SHADE_UNLIT; // ro.shaderDesc.shadeMode = SG_SHADE_UNLIT;
drawMesh_->disableColors(); // drawMesh_->disableColors();
//
add_line_RenderObjects(_renderer, &ro); // add_line_RenderObjects(_renderer, &ro);
} // }
//
if (props->primitive() == DrawModes::PRIMITIVE_HIDDENLINE) // if (props->primitive() == DrawModes::PRIMITIVE_HIDDENLINE)
{ // {
// First: // // First:
// Render all faces in background color to initialize z-buffer // // Render all faces in background color to initialize z-buffer
//
ro.priority = -1; // priority allows sorting for layers // ro.priority = -1; // priority allows sorting for layers
//
ro.shaderDesc.shadeMode = SG_SHADE_UNLIT; // ro.shaderDesc.shadeMode = SG_SHADE_UNLIT;
//
// color mask = none // // color mask = none
// depth mask = enabled // // depth mask = enabled
ro.glColorMask(0,0,0,0); // ro.glColorMask(0,0,0,0);
ro.depthTest = true; // ro.depthTest = true;
ro.depthWrite = true; // ro.depthWrite = true;
ro.depthFunc = GL_LESS; // ro.depthFunc = GL_LESS;
//
ro.fillMode = GL_FILL; // ro.fillMode = GL_FILL;
//
drawMesh_->disableColors(); // drawMesh_->disableColors();
//
ro.depthRange = Vec2f(0.01f, 1.0f); // ro.depthRange = Vec2f(0.01f, 1.0f);
//
add_face_RenderObjects(_renderer, &ro); // add_face_RenderObjects(_renderer, &ro);
//
//
// Second // // Second
// Render the lines. All lines not on the front will be skipped in z-test // // Render the lines. All lines not on the front will be skipped in z-test
ro.priority = 0; // render after z cullers // ro.priority = 0; // render after z cullers
//
ro.glColorMask(1,1,1,1); // ro.glColorMask(1,1,1,1);
ro.depthTest = true; // ro.depthTest = true;
ro.depthWrite = true; // ro.depthWrite = true;
ro.depthFunc = GL_LEQUAL; // ro.depthFunc = GL_LEQUAL;
//
ro.depthRange = Vec2f(0.0f, 1.0f); // ro.depthRange = Vec2f(0.0f, 1.0f);
//
add_line_RenderObjects(_renderer, &ro); // add_line_RenderObjects(_renderer, &ro);
} // }
//
if (props->colored() && props->primitive() == DrawModes::PRIMITIVE_EDGE) // if (props->colored() && props->primitive() == DrawModes::PRIMITIVE_EDGE)
{ // {
ro.shaderDesc.shadeMode = SG_SHADE_UNLIT; // ro.shaderDesc.shadeMode = SG_SHADE_UNLIT;
ro.shaderDesc.vertexColors = true; // ro.shaderDesc.vertexColors = true;
//
// note: colored edges are in sysmem, so they are directly bound to the VertexDeclaration // // note: colored edges are in sysmem, so they are directly bound to the VertexDeclaration
ro.vertexDecl = drawMesh_->getEdgeColoredVertexDeclaration(); // ro.vertexDecl = drawMesh_->getEdgeColoredVertexDeclaration();
ro.glDrawArrays(GL_LINES, 0, mesh_.n_edges() * 2); // ro.glDrawArrays(GL_LINES, 0, mesh_.n_edges() * 2);
//
_renderer->addRenderObject(&ro); // _renderer->addRenderObject(&ro);
//
// skip other edge primitives for this drawmode layer // // skip other edge primitives for this drawmode layer
continue; // continue;
} // }
//
if (props->primitive() == DrawModes::PRIMITIVE_HALFEDGE) // if (props->primitive() == DrawModes::PRIMITIVE_HALFEDGE)
{ // {
ro.shaderDesc.shadeMode = SG_SHADE_UNLIT; // ro.shaderDesc.shadeMode = SG_SHADE_UNLIT;
//
// buffers in sysmem // // buffers in sysmem
if (props->colored()) // if (props->colored())
ro.vertexDecl = drawMesh_->getHalfedgeVertexDeclaration(); // ro.vertexDecl = drawMesh_->getHalfedgeVertexDeclaration();
else // else
ro.vertexDecl = drawMesh_->getHalfedgeColoredVertexDeclaration(); // ro.vertexDecl = drawMesh_->getHalfedgeColoredVertexDeclaration();
//
ro.glDrawArrays(GL_LINES, 0, mesh_.n_halfedges() * 2); // ro.glDrawArrays(GL_LINES, 0, mesh_.n_halfedges() * 2);
//
_renderer->addRenderObject(&ro); // _renderer->addRenderObject(&ro);
} // }
//
//
// ----------------------------------------------------- // // -----------------------------------------------------
// take care of all the other primitives // // take care of all the other primitives
//
ro.depthRange = Vec2f(0.01f, 1.0f); // ro.depthRange = Vec2f(0.01f, 1.0f);
//
switch (props->primitive()) // switch (props->primitive())
{ // {
case DrawModes::PRIMITIVE_POINT: add_point_RenderObjects(_renderer, &ro); break; // case DrawModes::PRIMITIVE_POINT: add_point_RenderObjects(_renderer, &ro); break;
case DrawModes::PRIMITIVE_EDGE: add_line_RenderObjects(_renderer, &ro); break; // case DrawModes::PRIMITIVE_EDGE: add_line_RenderObjects(_renderer, &ro); break;
case DrawModes::PRIMITIVE_POLYGON: add_face_RenderObjects(_renderer, &ro); break; // case DrawModes::PRIMITIVE_POLYGON: add_face_RenderObjects(_renderer, &ro); break;
} // }
} // }
} }
......
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