Changing Textures on a DTS
by Marc Schraffenberger · in Torque Game Engine · 04/04/2005 (7:30 am) · 6 replies
I want to dynamically/in-game generate some textures and then replace them on some
of my DTS shapes. Right now I am first owning the material list for the shapeinstance and
then changing the mMatierals array with the new TextureHandle that I generate. It seems to
work, but I was wondering if that is a good or sloppy approach?
Also, could anyone explain what a decal and skin is? I have seen those a couple
times in some classes but am not really sure what they do. I think the decal is used
in the player class for the footprints. Anyways, I would appreciate some breif descriptions
of what they are.
Thanks.
of my DTS shapes. Right now I am first owning the material list for the shapeinstance and
then changing the mMatierals array with the new TextureHandle that I generate. It seems to
work, but I was wondering if that is a good or sloppy approach?
Also, could anyone explain what a decal and skin is? I have seen those a couple
times in some classes but am not really sure what they do. I think the decal is used
in the player class for the footprints. Anyways, I would appreciate some breif descriptions
of what they are.
Thanks.
#2
04/04/2005 (3:44 pm)
There was a tutorial not too long ago that did this exact same thing. I had it bookmarked but my HD crashed and burned so if anyone could find it again, you would have my undying appreciation.
#4
04/05/2005 (8:09 am)
Nope , but it's WAY more appropo to what I need to do myself, thanks!
#5
It works great and is better then owning the material list and then
changing it. Thought I would post it incase other read this thread.
04/12/2005 (5:54 pm)
I just wanted to add that I found a method setOverrideTexture in TSShapeInstance which takes a TextureHandle as an argument.It works great and is better then owning the material list and then
changing it. Thought I would post it incase other read this thread.
#6
Let me add an addendum to your insightful comment. The setOverrideTexture approach works wonderfully UNLESS you have more than one material on a shape, in which case it will override all the materials with the given texture. In some cases this is acceptable, in others it can present a problem.
04/12/2005 (11:13 pm)
Thanks for the followup, Marc!Let me add an addendum to your insightful comment. The setOverrideTexture approach works wonderfully UNLESS you have more than one material on a shape, in which case it will override all the materials with the given texture. In some cases this is acceptable, in others it can present a problem.
Associate Kyle Carter
Decals are sprites which can be placed in the game world (for instance, as a footprint). The term is used in several places, including as a standalone object and in the TS library. Skins either refer to skinned meshes or to textures on the mesh, depending on context.