1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 18:19:55 +00:00

Set the osg::Material on the terrain root node

This commit is contained in:
scrawl 2016-02-19 01:45:28 +01:00
parent 6000e48bba
commit ca0e1fe0e0
2 changed files with 4 additions and 4 deletions

View file

@ -154,10 +154,6 @@ namespace Terrain
, mBlendmapScale(blendmapScale) , mBlendmapScale(blendmapScale)
, mLayerTileSize(layerTileSize) , mLayerTileSize(layerTileSize)
{ {
osg::ref_ptr<osg::Material> material (new osg::Material);
material->setColorMode(osg::Material::AMBIENT_AND_DIFFUSE);
getOrCreateStateSet()->setAttributeAndModes(material, osg::StateAttribute::ON);
selectTechnique(0); selectTechnique(0);
} }

View file

@ -3,6 +3,7 @@
#include <memory> #include <memory>
#include <osg/UserDataContainer> #include <osg/UserDataContainer>
#include <osg/Material>
#include <OpenThreads/ScopedLock> #include <OpenThreads/ScopedLock>
@ -56,6 +57,9 @@ TerrainGrid::TerrainGrid(osg::Group* parent, Resource::ResourceSystem* resourceS
, mCache((storage->getCellVertices()-1)/static_cast<float>(mNumSplits) + 1) , mCache((storage->getCellVertices()-1)/static_cast<float>(mNumSplits) + 1)
, mUnrefQueue(unrefQueue) , mUnrefQueue(unrefQueue)
{ {
osg::ref_ptr<osg::Material> material (new osg::Material);
material->setColorMode(osg::Material::AMBIENT_AND_DIFFUSE);
mTerrainRoot->getOrCreateStateSet()->setAttributeAndModes(material, osg::StateAttribute::ON);
} }
TerrainGrid::~TerrainGrid() TerrainGrid::~TerrainGrid()