FIX: Terrain Materials WashOut Cannot Find Texture

Materials, textures, lighting, postfx
5 posts Page 1 of 1
Steve_Yorkshire
Posts: 332
Joined: Tue Feb 03, 2015 10:30 pm
 
  by Steve_Yorkshire » Thu Mar 28, 2019 10:29 pm
Update:
I had the terrain's atlas texture map saving out as a JPG at a mere 90k, hence the loss of clarity. :oops:

Default is DDS (683k) and PNG (249k) is also available. Whatever you select does not update until you restart the level so you cannot just check the differences on the fly.

So if you do go looking through the drop down menu ... remember to reset it to a respectable format. :P

Image

===============================================================

When loading a terrain, the textures are washed out.
Image

In Terrain Painter, on any texture, hitting "apply" without editing any material/texture, brings the correct colour/tone/etc back.
Image

Console says it cannot find the material for the texture - even though it is displaying a "proximity" of that texture.

The crux of the problem is this error message:
[MaterialList::mapMaterials] Unable to find material for texture: rock01a_dryGroundHard80seamlAutoCon2
[MaterialList::mapMaterials] Unable to find material for texture: grassMidDark_base
[MaterialList::mapMaterials] Unable to find material for texture: grassMidDarkDryGroundMix_base
[MaterialList::mapMaterials] Unable to find material for texture: dirtyandmix_base
Yeah I have terrible naming conventions for some textures ;)

Error called from mapMaterials (~300) in materials/materialList.cpp ~338
void MaterialList::mapMaterial( U32 i )
{
    //...
   if ( materialName.isNotEmpty() )//<----- THIS IS FAILING FOR SOME REASON ... OR IS IT, IT CAN STILL DISPLAY THE TEXTURE?
   {
      Material * mat = MATMGR->getMaterialDefinitionByName( materialName );
      mMatInstList = mat ? mat->createMatInstance() : MATMGR->createWarningMatInstance();
   }
   else
   {
      if ( Con::getBoolVariable( "$Materials::createMissing", true ) )
      {
   
           //...
         }
         else
         {
            Con::errorf( "[MaterialList::mapMaterials] Unable to find material for texture: %s", mMaterialNames.c_str() );//<---- THE WARNING ~338
            mMatInstList = MATMGR->createWarningMatInstance();
         }
         //...
}


Happens on ALL copies of T3D I have, from devhead going way back to the year nth (or at least the old 3.8). :o

Anyone with any ideas? :?
Last edited by Steve_Yorkshire on Fri Mar 29, 2019 1:47 am, edited 1 time in total.
Duion
Posts: 1398
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Thu Mar 28, 2019 10:49 pm
A slight hint may be, that terrain textures are handled differently than normal textures and the terrain textures are actually mapped to the base layer, not the actual material.

Can you post your materials.cs?
Steve_Yorkshire
Posts: 332
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Fri Mar 29, 2019 1:42 am
@ Duion yep, I had the texture map saving out as a JPG. Torque actually defaults to DDS (that and PNG give the best quality). I must have clicked the drop down by mistake, and of course nothing happens until you reload the level ... ahem ...

Image

:oops:
Duion
Posts: 1398
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Fri Mar 29, 2019 9:03 am
Using JPG is quite heretical.
Another trick is to not set the file ending in the materials.cs, but just type the filename, then Torque will always use it no matter the format, unless you have the same filename in the same folder with multiple file endings, then it may get tricky.
LoLJester
Posts: 110
Joined: Thu Aug 13, 2015 5:58 pm
 
by LoLJester » Fri Aug 23, 2019 1:13 am
For anyone stumbling upon the "[MaterialList::mapMaterials] Unable to find material for texture:" warning, you should know that, to avoid this warning, there must be a material created that is mapped to the name of the texture that the warning is displaying.

So, if you have for example:

Code: Select all

new TerrainMaterial() { internalName = "TerMaterialA"; diffuseMap = "art/Textures/myTexture"; };
The corresponding material shall be:

Code: Select all

new Material(myTexture_Mat) { mapTo = "myTexture"; };
5 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests