Fix for unnecessary terrain texture coordinate arrays

c++11
scrawl 10 years ago
parent 71509d2497
commit e046119487

@ -162,7 +162,8 @@ void TerrainGrid::loadCell(int x, int y)
textureCompileDummy->getOrCreateStateSet()->setTextureAttributeAndModes(0, layerTextures.back()); textureCompileDummy->getOrCreateStateSet()->setTextureAttributeAndModes(0, layerTextures.back());
} }
for (unsigned int i=0; i<blendmapTextures.size()+1; ++i) // use texture coordinates for both texture units, the layer texture and blend texture
for (unsigned int i=0; i<2; ++i)
geometry->setTexCoordArray(i, mCache.getUVBuffer()); geometry->setTexCoordArray(i, mCache.getUVBuffer());
osg::ref_ptr<osgFX::Effect> effect (new Terrain::Effect(layerTextures, blendmapTextures)); osg::ref_ptr<osgFX::Effect> effect (new Terrain::Effect(layerTextures, blendmapTextures));

Loading…
Cancel
Save