Page 1 of 1

What determines number of mesh buffers?

Posted: Tue Apr 10, 2018 8:26 pm
by nullReference
What determines the number of mesh buffers a mesh contains? For example the following code obtains a count of meshBuffers from an instance of an IMesh:

Code: Select all

 
IMesh * mesh = meshnode->getMesh();
const size_t buffercount = mesh->getMeshBufferCount();
 
Are mesh buffers related to the objects a mesh contains? For example if you have a mesh which is a map that was modeled in blender, and when that map was modeled it contained a mesh for "floor", "door", and "wall", would you then have three mesh buffers one for each object in the scene? Or are mesh buffers something totally different?

Re: What determines number of mesh buffers?

Posted: Tue Apr 10, 2018 8:52 pm
by CuteAlien
It's at least one meshbuffer per material. Usually it's exactly that. But can also depend somewhat on the format (the meshloader basically can decide when to create a meshbuffer - only requirement from Irrlicht is that each material needs to have a meshbuffer).

Re: What determines number of mesh buffers?

Posted: Wed Apr 11, 2018 11:20 pm
by Mel
one mesbuffer=one material.

A mesh contains several meshbuffers. You can append as many meshbuffers as you want to a mesh, or the loaders may append as many meshbuffers as necesary, but for the mesh scene node, a IMesh and its meshbuffers are a single entity, a single object, just with several objects that can vary the rendering properties across them.