Texture problem in TSE
by Chan Chi Kit · in Torque Game Engine Advanced · 11/01/2006 (10:12 am) · 2 replies
Can I have multiple textures on one model in TSE...?
For example, one texture for the head, one texture for the body, one texture for the hands and one texture for the legs.
How to add those textures to material.cs?
Thanks !
For example, one texture for the head, one texture for the body, one texture for the hands and one texture for the legs.
How to add those textures to material.cs?
Thanks !
#2
This is not very accurate. You can have multiple textures on one material given different layers in the shader.
11/01/2006 (11:39 am)
Quote:
Basically, for each texture you have, you create a material object. Any object that uses that textures does so via the material that texture is linked to. You can add loads of cool shader stuff to the material as well so that those bits of the model which use that texture will be affected by the graphic properties you add to the materials object.
This is not very accurate. You can have multiple textures on one material given different layers in the shader.
Torque Owner Amr Bekhit
All you need to do is create a material for each texture. In my case I had a ship with 3 textures called ship.bmp, sails.bmp and extras.bmp. I created the following simple materials.cs file:
//Galleon materials new Material(GalleonMaterial) { baseTex[0]="./ship.bmp"; }; new Material(SailMaterial) { baseTex[0]="./sails.bmp"; }; new Material(ExtrasMaterial) { baseTex[0]="./extras.bmp"; };The materials.cs file goes in the same directory as your DTS model and the engine will automaically run the script when it comes to loading your model.
Basically, for each texture you have, you create a material object. Any object that uses that textures does so via the material that texture is linked to. You can add loads of cool shader stuff to the material as well so that those bits of the model which use that texture will be affected by the graphic properties you add to the materials object.
--Amr