Game Development Community

Apply a simple shader on a DTS model

by Cai Yundong · in Torque Game Engine Advanced · 10/21/2008 (11:37 pm) · 1 replies

Hi guys,

Okay, I am totally newbie. Currently I need to make a new material + shader and apply the material on a DTS model ( I named it as TSStatic(XYZ) ). Here is my Materials.cs :

========================================
new CustomMaterial(XYZ)
{
texture[0] = "VolcanoMap";
shader = Volcanoshader;
version = 3.0;
};
========================================


---> Alright and here is the error:

namespace:unlinkClass - cannot unlink namespace parent linkage for XYZ for CustomMaterial
Error: cannot change namespace parent linkage of XYZ from CustomMaterial to TSStatic


Guys please help !!! Great if any1 can give link to some tutorial about this ????

#1
10/22/2008 (4:18 am)
Cai - The problem is caused you are trying to create a material called XYZ when it's already defined as a TSStatic - they need to have unique names.

For example:

You're DTS object stays being called XYZ and inside that DTS model I'm guessing you defined a number of textures to be used? including one called VolcanoMap by looking at your material definition? If so you'd define it like this

new CustomMaterial( [b]Any_Unique_name_goes_here[/b])
{
   [b]mapTo = "VolcanoMap";[/b]
   texture[0] = "VolcanoMap";
   shader = Volcanoshader;
   version = 3.0;
};

The MapTo command explicity telsl TGEA that this material should be used when looking for the VolcanoMap texture.

Hope that helps