Game Development Community

Terrain Base Texture problem

by Gerry "Hermetic" Smith · in Torque 3D Professional · 05/02/2009 (7:15 pm) · 18 replies

This is not the same as those other problems related to switching to basic lighting. I tried those fixes, and the deleting of the prefs.cs to no avail. This problem is present whether advanced lighting is set or not. The base texture of the terrain is just not showing up on my laptop. I found a temporary fix, for a session, but when the level is reloaded the problem shows up again.

Screen caps will show what I mean. This first one shows what things look like when first loading the Warrior Camp level:

thoughtfish.net/~carv/images/sample-1.jpg

( First off below notice the green bars, which show up when first entering the editor, on the top and bottom of the display in the editor. ? )
I can get the terrain to look right by going into the editor and selecting the terrain and then setting the baseTexSize to another value - doesn't matter what value - and then setting it back. Already the terrain changes appearance but not to how it should look.

thoughtfish.net/~carv/images/sample-2.jpg

But when hitting F11 to get out of the editor the terrain appears the way it should.

thoughtfish.net/~carv/images/sample-3.jpg

But even if I save the level, even with other baseTexSize values, the level will appear again like the first picture and one will have to go through that process again.

And this happens with terrain I put into projects I create and not just the sample Warrior Camp levels. Check out the colorful series doing the above process on my own project terrain:

When first loaded:
thoughtfish.net/~carv/images/sample-4.jpg

After changing the baseTexSize in the editor ( although no green bars this time ):
thoughtfish.net/~carv/images/sample-5.jpg

And, after leaving the editor, back to how it should look:
thoughtfish.net/~carv/images/sample-6.jpg


----------------------------------------
Core 2 Duo T5450 @ 1.66 GHz ( laptop )
2 GB RAM
GeForce 8600M GT 512 MB

#1
05/03/2009 (1:39 am)
@Gerry - Try this...

First load the mission, set the terrain to 1024 baseTexSize, save and quit.

Then go into the levels folder and delete the XXXXX_basetex.dds file... that is the cached DDS compressed base texture.

Now restart the game. Since the cached texture is gone it has to regenerate one at startup.

What i've seen is people getting into a cycle where things look bad at startup because the cached texture failed to be generated properly on their box. You then get accurate detail texturing but the base looks wrong. And until the .ter file is changed and saved... it never regens the base texture.

I plan to revisit all that and try to get a more robust base texture update and better invalidation of the cached DDS.
#2
05/03/2009 (10:06 am)
Nope that didn't work. The original value for baseTexSize in the Warrior Camp is 2048 isn't it? I tried setting it back to that and quitting and deleting the WarriorCamp_basetex.dds file but it still didn't show right on starting up again. Tried it a few times with 1024 and 2048.

When it is set to 2048 that dds file is 1.67 MB and when I set it to 1024, and I tried it without deleting that file to see what would happen, it was changed to 683 KB, so it seems there is no problem with that file not being updated with the change of baseTexSize.

And I couldn't try it in the new project I created because it doesn't even have a dds file in its levels folder... but it will have the right texture and look right after that little tweak I mention in my post above so the texture obviously exists... just doesn't show up right when starting the level.
#3
05/03/2009 (3:56 pm)
I had this issue, and I resolved it by selecting the terrain painter tool, and clicking once on the terrain. The terrain immediatly displayed it proper colours. I then Saved the level, and it has been fine ever since.
#4
05/03/2009 (6:39 pm)
Thanks Jack. Using the terrain painter will fix the terrain texture just like adjusting the baseTexSize, but when I save and restart the level its terrain base texture is all screwed up again... even the part I painted.
#5
05/04/2009 (8:26 am)
Try a smaller size.... change it to 512, delete the basetex.dds, and try again.
#6
05/04/2009 (9:19 am)
512, 128, 64... none of those values work. And if it might help to narrow the problem down I should also mention that I notice that some of the wrong colors and patterns I see showing up on the warrior camp terrain come from the other levels... the marble blast one, the den, and even the plain grey of the blank room... other times the base is just black.

I was going to try a recompile once I figure out how to do that with vc++ express.
#7
05/04/2009 (9:29 am)
recompile doesn't fix this on mine

win vista 32
intel centrio 2 duo
4g ram
ati mobility radeon 3470
#8
05/04/2009 (9:35 am)
I am having this same problem.
#9
05/04/2009 (9:42 am)
Helpful to see that it isn't just me and my particular computer. What are your system specs Jesse?

confirm: recompile doesn't help
#10
05/04/2009 (9:45 am)
I also had the problem where a new terrain I added to the blank room produced weird graphic problems in all of the levels under FPS genre. My problems seem only to be under advanced lighting however.
#11
05/04/2009 (10:49 am)
I have this problem as well.

Oddly, I don't see any files ending in ".dds" in my /levels folder, so deleting them wasn't the fix. I'll run through the whole stack of suggestions above when I get home tonight, to see if I get different results, unless a fix has surfaced by then.
#13
06/10/2009 (1:49 pm)
Hey guys.

Any of you still experiencing this issue as of beta 2?

Maybe give this change a try although i don't think it would resolve this particular issue:

In code/terrain/terrRender.cpp in function TerrainBlock::_updateLayerTexture()...

void TerrainBlock::_updateLayerTexture()
{   
   const U32 layerSize = mFile->mSize;
   const Vector<U8> &layerMap = mFile->mLayerMap;
   const U32 pixelCount = layerMap.size();

   if (  mLayerTex.isNull() ||
         mLayerTex.getWidth() != layerSize ||
         mLayerTex.getHeight() != layerSize )
      mLayerTex.set( layerSize, layerSize, GFXFormatR8G8B8A8, &GFXDefaultPersistentProfile, "" ); // PROFILE CHANGED!

Thanks for your help in resolving this one.
#14
06/10/2009 (3:15 pm)
I am still experiencing this issue in Beta2. I will report back after I try the fix.
#15
06/10/2009 (3:16 pm)
Quote:Any of you still experiencing this issue as of beta 2?
Yes, definitely.

I tried that change and it doesn't help with this issue.

I doubt if this will help but I was reading somewhere about how gimp's dds creation tool has different results on different systems because it uses hardware compression... it was just mentioned in passing and didn't give any details and so I never bookmarked the article. Is hardware compression used in T3D for the creation of that WarriorCamp_basetex.dds? And if so could that possibly have something to do with this issue?
#16
06/10/2009 (3:39 pm)
didn't help me either. Should I put it back how it used to be or does it matter?
#17
06/10/2009 (3:42 pm)
You can revert it for now. Beta 3 will include a similar change which resolves a different issue.
#18
07/04/2009 (3:13 am)
FYI.

For anyone following this thread this bug has been fixed.