Skip to content

Commit

Permalink
Prevent duplicate textures being loaded in displacement map
Browse files Browse the repository at this point in the history
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
  • Loading branch information
srmainwaring committed Jan 2, 2025
1 parent df5d46d commit 0b0c787
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gz-waves/src/systems/waves/Ogre2DisplacementMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void Ogre2DisplacementMap::InitTextures()

// Create displacement texture
gzmsg << "Create HeightMap texture\n";
mHeightMapTex = ogre2TextureManager->createTexture(
mHeightMapTex = ogre2TextureManager->createOrRetrieveTexture(
"HeightMapTex(" + std::to_string(this->entity) + ")",
Ogre::GpuPageOutStrategy::SaveToSystemRam,
Ogre::TextureFlags::ManualTexture,
Expand All @@ -153,7 +153,7 @@ void Ogre2DisplacementMap::InitTextures()

// Create normal texture
gzmsg << "Create NormalMap texture\n";
mNormalMapTex = ogre2TextureManager->createTexture(
mNormalMapTex = ogre2TextureManager->createOrRetrieveTexture(
"NormalMapTex(" + std::to_string(this->entity) + ")",
Ogre::GpuPageOutStrategy::SaveToSystemRam,
Ogre::TextureFlags::ManualTexture,
Expand All @@ -167,7 +167,7 @@ void Ogre2DisplacementMap::InitTextures()

// Create tangent texture
gzmsg << "Create TangentMap texture\n";
mTangentMapTex = ogre2TextureManager->createTexture(
mTangentMapTex = ogre2TextureManager->createOrRetrieveTexture(
"TangentMapTex(" + std::to_string(this->entity) + ")",
Ogre::GpuPageOutStrategy::SaveToSystemRam,
Ogre::TextureFlags::ManualTexture,
Expand Down

0 comments on commit 0b0c787

Please sign in to comment.