Game Development Community

New Materials for roads - user error or defect???

by Judy L Tyrer · in Torque 3D Professional · 07/04/2009 (6:59 pm) · 3 replies

I tried the "Create New Material" method in the documentation, but that didn't work. So I searched for the other materials listed, found them in art/environment/test, put my material in the material.cs file. I added:

new Material( GravelRoad : TerrainHard )
{
MapTo = "gravel";

// Choose a grey-ish particle color for the dust emitters.
EffectColor[ 0 ] = "0.5 0.5 0.5 1.0";
EffectColor[ 1 ] = "1.0 1.0 1.0 0.0";
}

and gravel.jpg in the same directory. Saved the file (double checked). But while all the other materials show up, GravelRoad doesn't (nor does gravel).

#1
07/04/2009 (8:49 pm)
You haven't specified the diffuse texture. You can do this with diffuse or "basetex":

singleton Material(GravelTex)
{
MapTo = "gravel";
baseTex[0] = "./gravel";
translucent = false;
//... Add whatever else you need
};

Also - is the material.cs file you put it in getting executed?
#2
07/05/2009 (1:13 pm)
Another thing, the example you give above is a faux material used to allow things like dustpuffs, stepsounds, and footprints to be used on the terrain.

#3
07/05/2009 (4:06 pm)
Yes, thanks. I got it to work when I added it to the Demo file instead of the Art Test file. I also changed it to use baseTex[0].