Multiple Textures
by baylor wetzel · in Torque 3D Professional · 11/30/2009 (1:29 am) · 4 replies
Hi, i'm a seasoned T2D programmer making my very first T3D (or any 3D) application and have a newbie question
i have a character and i want to use multiple textures for that character. For example, on the face i'd like to show the face, some makeup and possibly a tattoo. On the chest i'd like to show perhaps a bra, mesh shirt and vest. The user dresses up the character so i can't pre-blend the images in photoshop. i can already use multiple textures on parts of the model (i.e., i can change the shirt, pants and face separately) but not on the same area. i'd love it if someone could point me in the right direction
i have a character and i want to use multiple textures for that character. For example, on the face i'd like to show the face, some makeup and possibly a tattoo. On the chest i'd like to show perhaps a bra, mesh shirt and vest. The user dresses up the character so i can't pre-blend the images in photoshop. i can already use multiple textures on parts of the model (i.e., i can change the shirt, pants and face separately) but not on the same area. i'd love it if someone could point me in the right direction
About the author
#2
Make different mesh objects for everything you want and export ALL of them together in the same model - with a little script that tells only certain ones to render.
I do remember (vaguely) a skin swapping resource pre-T3D, don't know if it's ported. In stock T3D there is also a *.setSkinName(); listed in player functions ... though I don't know what that does.
You can get a list of available player functions in the console by using your_players_name_or_id.dump();
11/30/2009 (11:42 am)
Also - %object.setmeshhidden(meshname, bool);
Make different mesh objects for everything you want and export ALL of them together in the same model - with a little script that tells only certain ones to render.
I do remember (vaguely) a skin swapping resource pre-T3D, don't know if it's ported. In stock T3D there is also a *.setSkinName(); listed in player functions ... though I don't know what that does.
You can get a list of available player functions in the console by using your_players_name_or_id.dump();
#3
i'm not familiar with IFL, but isn't that just for animation? Is there a way to use that to make two images show up on the same skinned mesh at the same time? In my case, an example would be a tattoo on a person's arm - you have the basic skin texture then a heart tattoo that says mom and then a shirt that perhaps partially covers the tattoo. So three images drawn on the same area. Is that something IFL can help me with?
Right now we use four skinned meshes (body/skin, pants, shirt, coat), as Steve suggested. It's not enough (we can't do tattoos this way) but my artist doesn't want to add more meshes (not sure why; maybe they're really slow to bone or take up too many resources or poke through each other?). Some things, like hair and mustaches, are mounts, but i'm not sure if it makes sense to mount a shirt or a tattoo (maybe it does; i'm an AI person, this 3D graphics stuff is new to me)
i thought i read somewhere that you could stuff multiple textures into one material but my artist thinks that means things like diffuse textures, not multiple normal textures rendered on top of each other. So i was looking into combining them first using OpenGL's render to texture but i don't know how to do that in Torque
For some reason, i thought the whole multi-texturing thing was built in to every engine as something super simple. Shows what i know. i was just thinking decals like bullet holes and blood on enemies and dirt on race cars and other places where they clearly stack two textures on top of each other
12/01/2009 (1:59 pm)
> Sounds like you want to do an IFL animation sequencei'm not familiar with IFL, but isn't that just for animation? Is there a way to use that to make two images show up on the same skinned mesh at the same time? In my case, an example would be a tattoo on a person's arm - you have the basic skin texture then a heart tattoo that says mom and then a shirt that perhaps partially covers the tattoo. So three images drawn on the same area. Is that something IFL can help me with?
Right now we use four skinned meshes (body/skin, pants, shirt, coat), as Steve suggested. It's not enough (we can't do tattoos this way) but my artist doesn't want to add more meshes (not sure why; maybe they're really slow to bone or take up too many resources or poke through each other?). Some things, like hair and mustaches, are mounts, but i'm not sure if it makes sense to mount a shirt or a tattoo (maybe it does; i'm an AI person, this 3D graphics stuff is new to me)
i thought i read somewhere that you could stuff multiple textures into one material but my artist thinks that means things like diffuse textures, not multiple normal textures rendered on top of each other. So i was looking into combining them first using OpenGL's render to texture but i don't know how to do that in Torque
For some reason, i thought the whole multi-texturing thing was built in to every engine as something super simple. Shows what i know. i was just thinking decals like bullet holes and blood on enemies and dirt on race cars and other places where they clearly stack two textures on top of each other
#4
12/01/2009 (2:09 pm)
Use material layers. Put the diffuse, normal, etc in layer 0, and add your tattoo/whatever diffuse to layer 1, 2, etc. The diffuse textures are alpha-blended together.
Torque Owner JesseL
Pyrotronics-Games