MaterialMapping multiple textures to a one material?
by Caylo Gypsyblood · in Torque Game Engine Advanced · 03/04/2009 (5:29 pm) · 7 replies
new Material( TerrainRocks )
{
FootstepSoundId = 1; // Hard footstep sound defined on player datablock.
ImpactSoundId = 1; // Hard impact sound.
ShowDust = true; // Show dust particles.
ShowFootprints = false; // And show footprints.
};
addMaterialMapping( "cliffsnowrock1" , "material: TerrainRocks" );
addMaterialMapping( "Clifficyrock" , "material: TerrainRocks" );
addMaterialMapping( "Cliffsnowrock2" , "material: TerrainRocks" );I dont understand why this is not working. From everything i read about MaterialMapping it should work.
#2
Now works as expected...
03/09/2009 (9:07 am)
It was a bug, find ConsoleFunction( addMaterialMapping and replace:ConsoleFunction( addMaterialMapping, void, 3, 3, "(string matName) Set up a material to texture mapping.")
{
MaterialManager::get()->mapMaterial(argv[1],argv[2]);
Con::warnf(ConsoleLogEntry::General, "addMaterialMapping= texture:%s material:%s", argv[1],argv[2]);
}Now works as expected...
#3
If so maybe we should make this work...
03/09/2009 (2:39 pm)
Humm... does this come up often? I mean the need to have the same material mapped to several different mapTo names?If so maybe we should make this work...
new Material( TerrainRocks )
{
mapTo = "cliffsnowrock1;Clifficyrock;Cliffsnowrock2";
// etc.
};
#4
would be most convenient.
I have many foliage, bark, cement, wood, terrain- ect types of material who only differ in the actual texture. For terrain textures alone, its nice to setup Material by an generic type like:
addMaterialMapping and Material inheritance ( new Material( NewSlightlyDifferent : AlredyBuiltGeneric ) have become a few of my favorite new friends.
03/09/2009 (3:17 pm)
mapTo = "cliffsnowrock1;Clifficyrock;Cliffsnowrock2";would be most convenient.
I have many foliage, bark, cement, wood, terrain- ect types of material who only differ in the actual texture. For terrain textures alone, its nice to setup Material by an generic type like:
new Material( TerrainMud )
{
bumpTex[0] = "Dirtballs_norm";
FootstepSoundId = 1;
ImpactSoundId = 1;
ShowDust = false;
ShowFootprints = true;
friction = 12.0;
};and as of right now, i simply addMaterialMapping all my 'mud' textures to the TerrainMud Material. I even use the generic TerrainMud Material on DTS and saves me the time of building new Material every time i use a different type of mud texture. addMaterialMapping and Material inheritance ( new Material( NewSlightlyDifferent : AlredyBuiltGeneric ) have become a few of my favorite new friends.
#5
12/21/2013 (7:39 am)
@Tom or anyone, I know this is a really old thread but do multiple mapto's work in the current version of T3D MIT? I have for example, 15 tunnel sections all using the same exact material but they all have different mapto names so I end up with 15 separate materials.cs entries for the same material. I suspect that's not a good thing.
#6
01/07/2014 (5:41 pm)
@Scot, What are you using for 3d modelling? If you're using 3ds Max you should define a name for your material in the material editor. Reuse the exact name for that material in different 3d projects and T3D will automatically use the existing T3D material without duplicating. However this works for Open Collada, not for DTS files. A workaround would be to duplicate the cached DTS file and use it as your model after you imported the Collada version.
#7
01/07/2014 (5:50 pm)
These aren't models I created unfortunately. I could crack them all open and rename the material I suppose. I was just looking for a shorter route like Tom was suggesting above.
Torque 3D Owner Caylo Gypsyblood
What i think is saying one may map multiple texture names( texture file names right? like a mapto= entry?) to a material. And it do not seem to be working, so im gunna call it a bug or bad DOC's.