What determines number of mesh buffers?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
nullReference
Posts: 17
Joined: Mon Jan 08, 2018 2:45 pm

What determines number of mesh buffers?

Post 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?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: What determines number of mesh buffers?

Post 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).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: What determines number of mesh buffers?

Post 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.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Post Reply