Parsing Models with Multiple Textures

Started by
3 comments, last by ApochPiQ 11 years, 5 months ago
So I'm working on a graphics project for school and I got model loading set up a few weeks ago. Essentially I used lib3ds to get a list of all of the vertices of a model and then render them. This works fine for models with a single texture. My question is how should I go about managing models with more than one texture? Is there a common system in .3ds files for such a thing? Like is it a per mesh assignment? It seems like if each mesh was assigned a texture then doing this would not be a big deal, just a matter of rebinding the texture when the next mesh's vertices come along.

If this isn't possible or practical that's fine too. For the scope of this project single texture models will work, I just want to get fancy if I can.
Advertisement
I've never worked with lib3ds so I can't advise, but you may want to ask in the graphics programming forum. I'd be amazed if there weren't a simple way to do so.
void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.
[indent=1]While I can't speak to the specific library, your per-mesh idea is what I would recommend with any 3d library. If a "model" is just composed of 1 to n meshes, each mesh can have its own texture, refer to the same texture, etc paralleling the "materials" concept seen in most modeling tools. It's just up to you to then improve efficiency through things like material-based batching (to reduce the number of rebindings needed to render a multi-material or multi-texture scene).

Hazard Pay :: FPS/RTS in SharpDX (gathering dust, retained for... historical purposes)
DeviantArt :: Because right-brain needs love too (also pretty neglected these days)


I've never worked with lib3ds so I can't advise, but you may want to ask in the graphics programming forum. I'd be amazed if there weren't a simple way to do so.


Is there a way to move this such that there isn't a duplicate?
Moved :-)

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

This topic is closed to new replies.

Advertisement