Commit faa9ce67 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - WGETextureUtils now uses the transformation of the texture as...

[CHANGE] - WGETextureUtils now uses the transformation of the texture as default. This fixes some problems with unitialized texture matrices
parent d05fd742
......@@ -171,7 +171,7 @@ void wge::bindTexture( osg::ref_ptr< osg::Node > node, osg::ref_ptr< WGETexture<
wge::bindTexture< T >( node, osg::ref_ptr< T >( texture ), unit, prefix );
// set the texture matrix to the stateset
osg::TexMat* texMat = new osg::TexMat( osg::Matrix::identity() );
osg::TexMat* texMat = new osg::TexMat( texture->transformation()->get() );
// use a callback to update the tex matrix if needed according to transformation property of texture
texMat->setUpdateCallback( new WGEPropertyTransformationCallback< osg::StateAttribute, osg::TexMat >( texture->transformation() ) );
node->getOrCreateStateSet()->setTextureAttributeAndModes( unit, texMat, osg::StateAttribute::ON );
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment