directx and multiple textures

Blitz3D Forums/Blitz3D Programming/directx and multiple textures

6(Posted 2009) [#1]
I have a .x file that is composed of two seperate meshes and each mesh uses a different texture file. The directx file allows this, but is it possible to load it this way into b3d so that 1 model can be skinned with the different texture files? Or do I have to create seperate models for each texture?


Ross C(Posted 2009) [#2]
No, i don't believe so. If you can get a hold of a program called Ultimate Unwrap (it's fairly cheap, but WELL worth it), you can create 8 materials (textures) and apply them to your mesh, and still load it as one mesh, although it will be loaded as 8 seperate surfaces, but still one mesh.


Gabriel(Posted 2009) [#3]
You can set it up in the modeller as Ross says, but it should also be fine as it is. Just load it with LoadAnimMesh and each mesh will be loaded separately. Then use FindChild("name") where "name" is the name of each of the meshes and that will return the entity. From there, apply whatever texture you want. Blitz doesn't give you access to "submeshes" ( as DirectX calls them ) unless you load with LoadAnimMesh. LoadAnimMesh is a slight misnomer, as it doesn't necessarily load animated meshes, it loads the full hierarchy, which may involve animation, but may also just involve a nested set of meshes with parent/child relationships.


6(Posted 2009) [#4]
I just loaded the model directly using LoadMesh and the textures were automatically applied just as I wanted them! How cool is that! I thought it would be a complicated thing to do, but it turned out do be much easier than I thought.

I love Blitz3D :)


Gabriel(Posted 2009) [#5]
Yep, providing you set them up as you want in your modeller, they will be loaded correctly, but Ross's point about Ultimate Unwrap is worth bearing in mind. It allows you to set all the properties that the Blitz3D material system supports, and most other 3D modellers won't allow you to do that. 3dsMax will, if you have B3D pipeline. I don't know of any others. So while what you're doing now will work fine for textures, you won't be able to get those entities and manipulate them manually for colors or shininess or EntityFX settings individually unless you load them with LoadAnimMesh or use a modeller which supports all of those things in the first place.