Game Development Community

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

#1
11/30/2009 (11:08 am)
Sounds like you want to do an IFL animation sequence that is blended on your model and have the ability to pause, go forward, go backward, etc. So that means you would have to make all of your textures ahead of time then put the texture areas on different IFL animation sequences. Just FYI currently it is only setup to do 0, 1, 2, 3 animations threads playing whatever sequence you have programmed into the model at a time so. I'm guessing you will have to do a base model and do a lot of mounted images on it. A head image, leg image, arm image, chest image. Then you can mount the images on the frame.
#2
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
12/01/2009 (1:59 pm)
> Sounds like you want to do an IFL animation sequence

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
#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.