From c3313b99b205b80eb80ebb135b827da52cffe9a0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 13 Aug 2006 08:24:19 +0000 Subject: [PATCH] Changed the texture wrap mode to repeat --- src/osgPlugins/obj/ReaderWriterOBJ.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osgPlugins/obj/ReaderWriterOBJ.cpp b/src/osgPlugins/obj/ReaderWriterOBJ.cpp index a6c5c2b8a..caca8f933 100644 --- a/src/osgPlugins/obj/ReaderWriterOBJ.cpp +++ b/src/osgPlugins/obj/ReaderWriterOBJ.cpp @@ -107,6 +107,8 @@ osgDB::RegisterReaderWriterProxy g_objReaderWriterProxy; void ReaderWriterOBJ::buildMaterialToStateSetMap(obj::Model& model, MaterialToStateSetMap& materialToStateSetMap) const { + osg::Texture::WrapMode textureWrapMode = osg::Texture::REPEAT; + if (_fixBlackMaterials) { // hack to fix Maya exported models that contian all black materials. @@ -194,6 +196,9 @@ void ReaderWriterOBJ::buildMaterialToStateSetMap(obj::Model& model, MaterialToSt if (image) { osg::Texture2D* texture = new osg::Texture2D(image); + texture->setWrap(osg::Texture2D::WRAP_R, textureWrapMode); + texture->setWrap(osg::Texture2D::WRAP_S, textureWrapMode); + texture->setWrap(osg::Texture2D::WRAP_T, textureWrapMode); stateset->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON); if (material.textureReflection)