diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-05-12 00:41:28 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-05-12 00:41:28 +0400 |
commit | 4b4029afaf399ab5951ca237e8b5368013cc0411 (patch) | |
tree | 358a452c37d92ee2128f79098bae398c3189d6fd /source/gameengine | |
parent | 831a1fa91da31ea4e9ef9eac65cdaf745d27bcca (diff) |
patch from Charlie, bug fix (3795) , improves CubeMaps in game engine
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/BL_Texture.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 24 |
2 files changed, 21 insertions, 7 deletions
diff --git a/source/gameengine/Ketsji/BL_Texture.cpp b/source/gameengine/Ketsji/BL_Texture.cpp index e6356207225..68d2c3337a7 100644 --- a/source/gameengine/Ketsji/BL_Texture.cpp +++ b/source/gameengine/Ketsji/BL_Texture.cpp @@ -250,8 +250,8 @@ bool BL_Texture::InitCubeMap(int unit, EnvMap *cubemap ) glTexParameteri( GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); - glTexParameteri( GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_S, GL_REPEAT ); - glTexParameteri( GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_T, GL_REPEAT ); + glTexParameteri( GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); + glTexParameteri( GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); if(needs_split) { diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index af1a8ddb568..195fd5bd35f 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -470,11 +470,25 @@ void KX_BlenderMaterial::setTexMatrixData(int i) glMatrixMode(GL_TEXTURE); glLoadIdentity(); - glScalef( - mMaterial->mapping[i].scale[0], - mMaterial->mapping[i].scale[1], - mMaterial->mapping[i].scale[2] - ); +#ifdef GL_ARB_texture_cube_map + if( RAS_EXT_support._ARB_texture_cube_map && + mTextures[i].GetTextureType() == GL_TEXTURE_CUBE_MAP_ARB && + mMaterial->mapping[i].mapping & USEREFL) { + glScalef( + mMaterial->mapping[i].scale[0], + -mMaterial->mapping[i].scale[1], + -mMaterial->mapping[i].scale[2] + ); + } + else +#endif + { + glScalef( + mMaterial->mapping[i].scale[0], + mMaterial->mapping[i].scale[1], + mMaterial->mapping[i].scale[2] + ); + } glTranslatef( mMaterial->mapping[i].offsets[0], mMaterial->mapping[i].offsets[1], |