Game Development Community

Need materials help

by Johnathan Moore · in Torque Game Engine Advanced · 10/29/2006 (11:18 am) · 5 replies

Hey, im having a problem with materials. I define my material and run the engine but it keeps appearing with the no material sign or the object completly dissapears and just leaves a shadow. The material diffinition is as follows.
new Material(SwampGrass01)
{
   mapTo = "SwampGrass01.png";
   baseTex[0] = "~/data/shapes/terrain/SwampGrass01";
};

the two files in the directry are SwampGrass01.dts & SwampGrass01.png

I dont know anything about the materials and cant find whats wrong on TDN so its probably simple.

thanks!

#1
10/29/2006 (11:26 am)
The way max and maya export texture names are different and require changes to the material definition. For example, if you were exporting from 3dsMax the materials would look like this:
// where texture is MyMaterial.png and in the same folder as the DTS model
new Material( MyMaterial ) {
   mapTo = MyMaterial;
   baseTex[0] = MyMaterial;
};

If you were exporting from Maya then it would look like this:
// where texture is MyMaterial.png and in the same folder as the DTS model
new Material( MyMaterial ) {
   mapTo = "MyMaterial.png";
   baseTex = "MyMaterial.png";
};

There is also this TDN post which explains materials in detail. Hope that helps.
#2
10/29/2006 (11:42 am)
It is from maya and i changed it to this
new Material(SwampGrass01)
{
   mapTo = "SwampGrass01.png";
   baseTex[0] = "SwampGrass01.png";
};

but it still doesnt work
#3
10/29/2006 (2:48 pm)
Try putting the materials.cs file in the same directory as the texture if you have no path specified.
#4
11/26/2006 (5:36 am)
OK, I have the latest http download version of TSE with 1.5. But it doesnt work

It is from maya

the files are
SwampGrass01.dts
SwampGrass01.png

The materials.cs is in the same folder

this is the material defenition

new Material(SwampGrass01)
{
   mapTo = "SwampGrass01.png";
   baseTex[0] = "SwampGrass01.png";
   pixelSpecular[0] = true;
   specular[0] = "0.1 0.1 0.1 0.1";
   specularPower[0] = "8.0";
};

Edit:
OOOOOOOOOOOPS IT IS FROM MAX
#5
11/26/2006 (7:47 am)
I was having a similar problem with Blender
http://garagegames.com/mg/forums/result.thread.php?qt=53968

I think it was due to having multiple names for materials and objects. HTH