Game Development Community

[1.1 Beta Bug] Terrain Texture Detail Map - LOGGED

by Ryan Mounts · in Torque 3D Professional · 02/11/2010 (11:05 am) · 9 replies

After creating a new terrain in the World Editor, the terrain looks fine (top image). But after leaving the World Editor, the detail map only displays in patches (bottom image). If I go back into the World Editor, enter the Terrain Painter, and apply a different terrain texture and then re-apply the original texture, the texture does not mess up anymore.

Note: With a fresh install of the beta, the same issue happened with the existing terrain in the Deathball Desert example, until I assigned a new terrain texture and then re-assigned the sand texture.

Intel Core 2, ~1.99 Ghz
NVIDIA Quadro NVS 135M

i291.photobucket.com/albums/ll284/rmounts/Terrain_Texture_Bug.jpg

#1
02/11/2010 (2:59 pm)
Thanks for the report Ryan. I think some changes we made to support DirectX9Ex caused this problem. I'll post a fix soon.

THREED-875
#2
02/12/2010 (12:44 am)
Ditto...lots of odd terrain texture anomalies

EDIT: The other thing that I'm noticing is that it looks like the distance I set on the detail map doesn't work. My mountains are all just smeared looking from a distance now, as if there's no detail map.
#3
02/12/2010 (2:53 pm)
Yeah mine is doing something similar, I have an ATI HD4870, AMD Quad, and 1066 RAM, and here is a screenshot of the... output:O)
i129.photobucket.com/albums/p220/lmaceleighton/BUG1.png
Forgot to add that this is a new terrain, and everything looks perfect until i switch to the editor then it all goes like this.

#4
02/17/2010 (7:56 pm)
As a side note, this doesn't happen unless I change to any edit mode, when i run in full-screen as a game it works fine....any chance there is a fix for this yet, i have not had time to fix myself, so I guess this is a thread bump:O)
#5
02/26/2010 (5:57 pm)
Ok... have a fix for this.

In engine\source\terrain\terrData.cpp around line 165 in function TerrainBlock::_onTextureEvent():

void TerrainBlock::_onTextureEvent( GFXTexCallbackCode code )
{
   if ( code == GFXZombify )
   {
      if (  mBaseTex.isValid() &&
            mBaseTex->isRenderTarget() )
         mBaseTex = NULL;

      mLayerTex = NULL; // ADDED!
      mLightMapTex = NULL;
   }
}

Then in engine\source\terrain\terrRender.cpp around line 354 in function TerrainBlock::_renderBlock():

// Did the detail layers change?
   if ( mDetailsDirty )
   {   
      _updateMaterials();
      mDetailsDirty = false;
   }

   if ( mLayerTex.isNull() || mLayerTexDirty ) // ADDED!
      _updateLayerTexture();  // ADDED!

   // Do we need to update the textures?
   if ( mLayerTexDirty || mBaseTex.isNull() )
   {
      // REMOVED! _updateLayerTexture();
      _updateBaseTexture( false );
      mLayerTexDirty = false;
   }

Please give that fix a shot.
#6
02/26/2010 (11:39 pm)
Thank you for the fix, it works for my levels.
#7
02/27/2010 (8:38 am)
Looks good for me.
#8
02/27/2010 (9:35 pm)
Thanks Tom...Works great so far!
#9
03/10/2010 (11:54 am)
Bless you Tom!