Commits (2)
......@@ -444,30 +444,49 @@ getRenderObjects(IRenderer* _renderer, GLState& _state , const DrawModes::DrawM
}
ro.setMaterial(&localMaterial);
ro.shaderDesc.shadeMode = SG_SHADE_PHONG;
size_t n_layers = _drawMode.getNumLayers();
for (size_t i = 0; i < n_layers; ++i)
{
const auto layer = _drawMode.getLayer(i);
switch (primitives_[i].type) {
case SPHERE:
switch (layer->lightStage())
{
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_UNLIT:
ro.shaderDesc.shadeMode = SG_SHADE_UNLIT;
break;
}
// Sphere
ro.debugName = std::string("glutprimitive.sphere no ") + std::to_string(i) + ": " + name();
switch (primitives_[i].type)
{
case SPHERE:
sphere_->addToRenderer(_renderer, &ro, primitives_[i].size);
break;
// Sphere
ro.debugName = std::string("glutprimitive.sphere no ") + std::to_string(i) + ": " + name();
case CONE:
//Cone
ro.debugName = std::string("glutprimitive.cone no ") + std::to_string(i) + ": " + name();
cone_->addToRenderer(_renderer, &ro, primitives_[i].innersize);
break;
sphere_->addToRenderer(_renderer, &ro, primitives_[i].size);
break;
default:
// TODO: The other glut primitives are not yet supported by the advanced renderers
std::cerr << "Sorry, but the glut renderer objects are not available for this renderer yet!" << std::endl;
break;
case CONE:
//Cone
ro.debugName = std::string("glutprimitive.cone no ") + std::to_string(i) + ": " + name();
cone_->addToRenderer(_renderer, &ro, primitives_[i].innersize);
break;
default:
// TODO: The other glut primitives are not yet supported by the advanced renderers
std::cerr << "Sorry, but the glut renderer objects are not available for this renderer yet!" << std::endl;
break;
}
}
}
}
......