MaterialMapping multiple textures to a one material?
by Caylo Gypsyblood · in Torque Game Engine Advanced · 03/04/2009 (5:29 pm) · 4 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.
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.