gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Multi texturing

#47322 - G-Pjube - Thu Jul 07, 2005 2:38 pm

Is it possible to use more then just 1 texture on 1 model? I don't mean texture's overlapping each other, but for example a texture for the head, a texture for it's upper body etc etc. If it would be possible then this would be great, if not i need to find a skinner cause else it will be to hard :P
_________________
www.picfront.com [ Upload your pictures ]

#47328 - tepples - Thu Jul 07, 2005 3:00 pm

In OpenGL, a program can set a texture, draw some polys, set another texture, and draw more polys. I'd imagine that it works the same way on the Nintendo DS, given that ndslib contains a partial implementation of the OpenGL spec and that a model is just the hardware writes that correspond to a sequence of OpenGL commands.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#47332 - FireSlash - Thu Jul 07, 2005 6:02 pm

In OpenGL, you'd use GLTexCoord in the way tepples described. There are implementations of this for the DS, as well. With NDSlib, there are two functions:
void glTexCoord2t16(t16 u, t16 v)
void glTexCoord1i(uint32 uv)
_________________
FireSlash.net

#47336 - G-Pjube - Thu Jul 07, 2005 7:04 pm

I don't understand the coding part (I should leave that to coders), but i'm allready glad it supports multi texturing. Is there a limit of texture's you can apply to a model?
_________________
www.picfront.com [ Upload your pictures ]

#47337 - rize - Thu Jul 07, 2005 7:22 pm

Don't refer to that as multi-texturing.

Basically, what they're saying is that the way 3D hardware works is that you set a texture, draw some triangles with that texture (1 or more) then set another texture and repeat until your scene is done.

To have one "model" use more than one texture rather than one skin texture simply requires that your game engine switch the texture that's being used at the right time. This is nothing special, just a particular way of programming.

However, I think the skinning method is used to save processing time (character models are some of the highest poly elements in a game and it takes time to switch textures; so it's better to use a skin if you can).