Game Development Community

Multiple shaders on a model.

by JamesOrlando · in Game Design and Creative Issues · 04/11/2009 (12:54 pm) · 3 replies

Is it possible to apply multiple shaders or materials to a single model. For example, if I have an armored knight, would I be able to apply a shader to the areas of the model that represent armor and a separate shader to the areas of the model that represent his skin? Can I apply a separate custom material and a Torque material to the same model?

#1
04/11/2009 (1:27 pm)
yes. Apply your image(s) to the model and map a shader to that image in your materials.cs. You can use the same image in many shaders/material blocks or a diff. image per shader...etc.

Be weary of performance when creating something like a 5000 triangle character with many shaders. :P
#2
04/11/2009 (1:46 pm)
By "image(s)" do you mean textures? I always assumed a shader would apply an effect to the entire texture and therefore the entire model. But is it possible to target only a specific part of a texture map? Would I need to have separate textures for each part of the model that I wanted to apply a separate shader to?
#3
04/11/2009 (3:49 pm)
technically, I could give you answers all day long...but I do not use TorqueX and I would hate to give you wrong advice. Is this for TorqueX ?

Hopefully someone will come and help you on this.