Directional lighting fix
getLights modified to use points rather than triangles based on the configuration. This fixes point lights (with directional disabled) on AMD
This commit is contained in:
parent
2fe60c9635
commit
ab8795f6dc
@ -280,9 +280,18 @@ SGLightFactory::getLights(const SGDirectionalLightBin& lights)
|
|||||||
//stateSet->setRenderBinDetails(POINT_LIGHTS_BIN, "DepthSortedBin");
|
//stateSet->setRenderBinDetails(POINT_LIGHTS_BIN, "DepthSortedBin");
|
||||||
//stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
|
//stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
|
||||||
|
|
||||||
|
|
||||||
|
static SGSceneFeatures* sceneFeatures = SGSceneFeatures::instance();
|
||||||
|
bool useTriangles = sceneFeatures->getEnableTriangleDirectionalLights();
|
||||||
|
|
||||||
osg::DrawArrays* drawArrays;
|
osg::DrawArrays* drawArrays;
|
||||||
|
if (useTriangles)
|
||||||
drawArrays = new osg::DrawArrays(osg::PrimitiveSet::TRIANGLES,
|
drawArrays = new osg::DrawArrays(osg::PrimitiveSet::TRIANGLES,
|
||||||
0, vertices->size());
|
0, vertices->size());
|
||||||
|
else
|
||||||
|
drawArrays = new osg::DrawArrays(osg::PrimitiveSet::POINTS,
|
||||||
|
0, vertices->size());
|
||||||
|
|
||||||
geometry->addPrimitiveSet(drawArrays);
|
geometry->addPrimitiveSet(drawArrays);
|
||||||
return geometry;
|
return geometry;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user