From 5666e0254653543398b8441acc00eb68bf1733ea Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 3 Jun 2015 02:21:41 +0200 Subject: [PATCH] Fix for dark terrain in some cases --- components/terrain/material.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/terrain/material.cpp b/components/terrain/material.cpp index 17acd940b..ddfa10f12 100644 --- a/components/terrain/material.cpp +++ b/components/terrain/material.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -67,6 +68,12 @@ namespace Terrain stateset->setTextureAttributeAndModes(texunit, new osg::TexMat(texMat)); + osg::ref_ptr texEnvCombine (new osg::TexEnvCombine); + texEnvCombine->setCombine_RGB(osg::TexEnvCombine::REPLACE); + texEnvCombine->setSource0_RGB(osg::TexEnvCombine::PREVIOUS); + + stateset->setTextureAttributeAndModes(texunit, texEnvCombine, osg::StateAttribute::ON); + ++texunit; }