Using materials.cs with exported DTS
by Gerald Fishel · in Torque Game Engine Advanced · 12/02/2008 (8:52 pm) · 1 replies
Hi all,
I'm trying to get my head around using the material system in TGEA. Right now I have a simple box that I exported from 3DS Max, with a material that has a diffuse texture map. So I would like to set material properties for this with materials.cs instead. What exactly do I have to do to make that happen?
Do I just put the materials.cs file in the same folder as the .dts and it will read it automatically or do I need to do something to configure the DTS to read the materials.cs?
What all do I need to do to map the material definitions to materials in the DTS?
i.e. my box object is named "box", the material in 3ds max is named 'box1mat', and the texture is plate.png. From what I've read in the docs it sounds like I need to map the material definition to the texture in 3DS Max. So I tried a mateiral definition like this in materials.cs:
basically to see that the material is working I wanted to specify a different texture, so I set baseTex[0] to b ox2 instead of plate.
But of course this doesn't work, or I wouldn't be writing this. The box is still rendered with the original plate texture.
So what is the correct way to setup a material for this?
Thanks,
Gerald
I'm trying to get my head around using the material system in TGEA. Right now I have a simple box that I exported from 3DS Max, with a material that has a diffuse texture map. So I would like to set material properties for this with materials.cs instead. What exactly do I have to do to make that happen?
Do I just put the materials.cs file in the same folder as the .dts and it will read it automatically or do I need to do something to configure the DTS to read the materials.cs?
What all do I need to do to map the material definitions to materials in the DTS?
i.e. my box object is named "box", the material in 3ds max is named 'box1mat', and the texture is plate.png. From what I've read in the docs it sounds like I need to map the material definition to the texture in 3DS Max. So I tried a mateiral definition like this in materials.cs:
new Material(plate)
{
mapTo = "plate";
baseTex[0] = "~/data/shapes/test/box2";
};basically to see that the material is working I wanted to specify a different texture, so I set baseTex[0] to b ox2 instead of plate.
But of course this doesn't work, or I wouldn't be writing this. The box is still rendered with the original plate texture.
So what is the correct way to setup a material for this?
Thanks,
Gerald
Torque Owner Gerald Fishel
Development Ninja