Game Development Community

Decals, no material

by Jean-Pierre Cuerrier · in Torque 3D Professional · 08/08/2011 (6:40 am) · 3 replies

Hi everyone.
I've been converting my TGE 1.5 project to T3D. It's been going great, but I've run into a little snag. First let me say that I've read the tutorials on decals (the click to move tut) and looked at the foot print DecalData.

I have a material created.

singleton Material(DecalMaterialTest1)
{    
   diffuseMap[0] = "art/DecalTest/testMaterial1";
   emissive[0] = true;             	
   glow[0] = "1";
};

and I follow the instructions to create the DecalData. It works, I see the decal in game. Save. Quit. Notice the change in the managedDecalData.cs file.

datablock DecalData(NewDecalData)
{
   Material = "DecalMaterialTest1";
   textureCoordCount = "1";
};

But when I start the level the decal is showing as "No Material" or the warning msg.

I've tried adding the matriel manually using the

decalManagerAddDecal( "253.722000 -119.853745 345.676239", "0.000000 -1.000000 0.000000", 0, 1, "NewDecalData", true );

which works, but I need to manually change the transform to 0.0 -1.0 0.0 again after I start the level.

Two questions. Am I doing something wrong when using the decal editor/world editor to create the decal? If not, then what could be wrong. Secondly, why to I have to rotate the decal when I clearly add it (using the decalManagerAddDecal) with the correct rotational information?

Thanks!

About the author

Software Engineer for the Department of National Defence (Canada) during the day, I work part time on game projects and attempt to do so as professionally as possible by leveraging my experience. Blog: http://instantcarnage.tumblr.com/


#1
08/08/2011 (1:15 pm)
I've added this to the AFX forums as I am unsure if it has to do with the omission of the line
decalManagerLoad( %missionName @ ".decals" );
in missionDownload_AFX.cs
#2
08/09/2011 (5:22 am)
In response to my previous post... now that I think of it, the decals load regardless of the decalManagerLoad, it has to do with the lack of material linking.

To add a little more detail. When selecting the "No Material" decal, I can still select assign the
DecalMaterialTest1
to it. So I am assuming that the material is correct.

Oh and one last thing is that the decal is being "placed" on a static object, could that be the issue? While using TGE and sgDecalProjectors it was not an issue.

Thanks again
#3
08/09/2011 (8:19 am)
posted fix Here

Thanks

EDIT: For those who do not have AFX this is the post from the link

Just to post a fix. It works if the material is in the actual game/art/decals directory. I think that I'll do a clean install and move my scripts over to see if that will correct this dependency.

Trouble shooting,
Copied the material to game/art/decals/DecalTest/testMaterial1. Created new material to point to the new path. Still didn't work. Although I could see the material in the material editor.

Copied the material to game/art/decals/testMaterial1. Created new material to point to this path. WORKED.

Used the previous material and changed the path to point to game/art/decals/DecalTest/testMaterial1. Didn't work. Changed path back to game/art/decals/testMaterial1. Worked again.