mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Disable specularity for negative lights
This commit is contained in:
parent
debc37d93a
commit
e0e4b84e40
3 changed files with 16 additions and 4 deletions
|
@ -117,19 +117,23 @@ namespace SceneUtil
|
|||
configureLight(light, radius, isExterior);
|
||||
|
||||
osg::Vec4f diffuse = esmLight.mColor;
|
||||
osg::Vec4f specular = esmLight.mColor; // ESM format doesn't provide specular
|
||||
if (esmLight.mNegative)
|
||||
{
|
||||
diffuse *= -1;
|
||||
diffuse.a() = 1;
|
||||
// Using specular lighting for negative lights is unreasonable
|
||||
specular = osg::Vec4f();
|
||||
}
|
||||
light->setDiffuse(diffuse);
|
||||
light->setAmbient(ambient);
|
||||
light->setSpecular(diffuse); // ESM format doesn't provide specular
|
||||
light->setSpecular(specular);
|
||||
|
||||
lightSource->setLight(light);
|
||||
|
||||
osg::ref_ptr<SceneUtil::LightController> ctrl(new SceneUtil::LightController);
|
||||
ctrl->setDiffuse(light->getDiffuse());
|
||||
ctrl->setSpecular(light->getSpecular());
|
||||
if (esmLight.mFlicker)
|
||||
ctrl->setType(SceneUtil::LightController::LT_Flicker);
|
||||
if (esmLight.mFlickerSlow)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue