Multiple Textures on a TriangleMesh

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
RyanGadz
Posts: 32
Joined: Thu Aug 12, 2010 8:34 pm
Contact:

Multiple Textures on a TriangleMesh

Post by RyanGadz »

everytime i try to import my fbx model with more than one texture as a TriangleMesh i get an error. can this even do multiple textures?

i am thinking about importing 2 models, one to do the physics and one to draw because i'll have a lot of transparent textures in my game. Does this make any sense?
Last edited by RyanGadz on Mon Aug 23, 2010 10:49 pm, edited 1 time in total.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Multiple Textures on a TriangleMesh

Post by Norbo »

The BEPUphysicsDrawer is just a demos/debugging drawer. You can technically draw arbitrary models using parts of it, and its source is available in the demos. However, if you need an actual rendering solution, I strongly recommend that you do not use the BEPUphysicsDrawer. It's built for drawing physics engine data, and trying to extend it for a game will only cause pain down the road.

I also wouldn't recommend creating any sort of BEPUphysics TriangleMesh unless they are actually going to be used in a simulation, since it's a heavy object with acceleration structures computed inside.
RyanGadz
Posts: 32
Joined: Thu Aug 12, 2010 8:34 pm
Contact:

Re: Multiple Textures on a TriangleMesh

Post by RyanGadz »

Norbo wrote:The BEPUphysicsDrawer is just a demos/debugging drawer.
i just read this in another one of your posts as well. it makes sense now thanks!

do you know of an easy way off hand to disable texture data when making the trianglemesh? it would be nice so i dont have to load basically the same object twice. this game is already getting larger than i want it to be.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Multiple Textures on a TriangleMesh

Post by Norbo »

The BEPUphysics TriangleMesh doesn't know about texture data; all that it wants is a vertex and index buffer. The specific way you get those vertices and indices depends on how you set things up. You could store a vertex/index buffer from a custom content processor, or just load in the vertices from a Model at runtime using the StaticTriangleGroup/TriangleMesh.GetVerticesAndIndicesFromModel method.
Post Reply