forked from mirror/openmw-tes3mp
Fix incorrect setting of TexMat in terrain material
This commit is contained in:
parent
a759ef5d2e
commit
62cc091414
1 changed files with 3 additions and 3 deletions
|
@ -21,13 +21,14 @@ namespace Terrain
|
||||||
osg::ref_ptr<osg::TexMat> texMat = texMatMap[blendmapScale];
|
osg::ref_ptr<osg::TexMat> texMat = texMatMap[blendmapScale];
|
||||||
if (!texMat)
|
if (!texMat)
|
||||||
{
|
{
|
||||||
texMat = new osg::TexMat;
|
|
||||||
osg::Matrixf matrix;
|
osg::Matrixf matrix;
|
||||||
float scale = (blendmapScale/(static_cast<float>(blendmapScale)+1.f));
|
float scale = (blendmapScale/(static_cast<float>(blendmapScale)+1.f));
|
||||||
matrix.preMultTranslate(osg::Vec3f(0.5f, 0.5f, 0.f));
|
matrix.preMultTranslate(osg::Vec3f(0.5f, 0.5f, 0.f));
|
||||||
matrix.preMultScale(osg::Vec3f(scale, scale, 1.f));
|
matrix.preMultScale(osg::Vec3f(scale, scale, 1.f));
|
||||||
matrix.preMultTranslate(osg::Vec3f(-0.5f, -0.5f, 0.f));
|
matrix.preMultTranslate(osg::Vec3f(-0.5f, -0.5f, 0.f));
|
||||||
|
|
||||||
|
texMat = new osg::TexMat(matrix);
|
||||||
|
|
||||||
texMatMap[blendmapScale] = texMat;
|
texMatMap[blendmapScale] = texMat;
|
||||||
}
|
}
|
||||||
return texMat;
|
return texMat;
|
||||||
|
@ -39,8 +40,7 @@ namespace Terrain
|
||||||
osg::ref_ptr<osg::TexMat> texMat = texMatMap[layerTileSize];
|
osg::ref_ptr<osg::TexMat> texMat = texMatMap[layerTileSize];
|
||||||
if (!texMat)
|
if (!texMat)
|
||||||
{
|
{
|
||||||
texMat = new osg::TexMat;
|
texMat = new osg::TexMat(osg::Matrix::scale(osg::Vec3f(layerTileSize,layerTileSize,1.f)));
|
||||||
texMat->setMatrix(osg::Matrix::scale(osg::Vec3f(layerTileSize,layerTileSize,1.f)));
|
|
||||||
|
|
||||||
texMatMap[layerTileSize] = texMat;
|
texMatMap[layerTileSize] = texMat;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue