diff --git a/simgear/scene/tgdb/pt_lights.cxx b/simgear/scene/tgdb/pt_lights.cxx index c1bb3d61..16279d2f 100644 --- a/simgear/scene/tgdb/pt_lights.cxx +++ b/simgear/scene/tgdb/pt_lights.cxx @@ -280,9 +280,18 @@ SGLightFactory::getLights(const SGDirectionalLightBin& lights) //stateSet->setRenderBinDetails(POINT_LIGHTS_BIN, "DepthSortedBin"); //stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); + + static SGSceneFeatures* sceneFeatures = SGSceneFeatures::instance(); + bool useTriangles = sceneFeatures->getEnableTriangleDirectionalLights(); + osg::DrawArrays* drawArrays; - drawArrays = new osg::DrawArrays(osg::PrimitiveSet::TRIANGLES, - 0, vertices->size()); + if (useTriangles) + drawArrays = new osg::DrawArrays(osg::PrimitiveSet::TRIANGLES, + 0, vertices->size()); + else + drawArrays = new osg::DrawArrays(osg::PrimitiveSet::POINTS, + 0, vertices->size()); + geometry->addPrimitiveSet(drawArrays); return geometry; }