Jump to content

FIX: Terrain Materials WashOut Cannot Find Texture


Recommended Posts

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


nothing-to-dsee.gif


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


When loading a terrain, the textures are washed out.

BxZ9GvT.jpg


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

o3HfRdo.jpg


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? :?

Edited by Steve_Yorkshire
Link to post
Share on other sites

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.

Link to post
Share on other sites
  • 4 months later...

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:

new TerrainMaterial()
{
  internalName = "TerMaterialA";
  diffuseMap = "art/Textures/myTexture";
};

 

The corresponding material shall be:

 

new Material(myTexture_Mat)
{
mapTo = "myTexture";
};

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...