Game Development Community

Materials Showing up White in TSE 3.5

by Jack Stone · in Torque Game Engine Advanced · 07/25/2006 (8:56 pm) · 6 replies

Hi, I just downloaded the new TSE update today, and I'm merging my project into it.
I havent used materials/shaders before now, just applied the texture to the object in the standard TGE way, so all of my models now have an orange material with "No Material" written on it.

Which is ok, because Im pretty sure I know how to use materials.
I put the spaceorc folder in my data/shapes folder just to try it out, and it works fine, (added it as a static shape and the texture shows up perfectly)
I then created materials for my own shapes in the same way, but not instead of getting a "no materials" texture I get a plain white shape, no texture at all.
Ive tried this with several shapes, and its the same with all of them.
Here is the material code that Im using:

new Material(buggy)
{

baseTex[0] = "~data/shapes/buggy/buggy";
//bumpTex[0] = "~/data/shapes/SpaceOrc/Orc_Material_normal";

cubemap = WChrome;
pixelSpecular[0] = true;
specular[0] = "0.5 0.5 0.5 0.5";
specularPower[0] = 8.0;
};

Ive searched the forums and Ive done exactly what all the docs say, except that I havent used addmaterialmappings(), but Im pretty sure that not used anymore.

Im just using the standard buggy as an example, and its setup the exact same way as the spaceorc:
texture and materials.cs in the same directory as the .dts file, and materials.cs is executing.
Material is doing something, since it stops the "No Material" problem, it just doesnt seem to be loading the texture itself.

Any advice would be good, thanks.
JS

#1
07/25/2006 (9:09 pm)
You forgot the mapTo - You need to set the mapTo = "foo" where foo is the name of your texture on your object.

So, if your texture would've been "foo.png", for example, then it is probably "foo".
#2
07/26/2006 (7:13 am)
I always thought setting baseTex was enough? Since the .dts specifies that it uses the file baseTex has its value set at?
#3
07/26/2006 (7:17 am)
I never need to use mapTo.
#4
07/26/2006 (7:29 am)
What Cliff said should work. It looks like you're missing the mapTo field, which sets what texture the material should apply to - as more than one material can use the same bitmaps.
#5
07/26/2006 (11:10 am)
Juan - No, baseTex can be set to be anything you want it to be, it doesn't have to be the texture the object was originally designed with. Therefore, you gotta use the mapTo to tell it where it actually applies.
#6
07/26/2006 (11:39 am)
Yep, that seems to have done it. Thanks for the prompt replies guys.
JS