Too many vertex?

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
Chet
Posts: 53
Joined: Wed Sep 10, 2008 5:34 am

Too many vertex?

Post by Chet »

with only about half of my planned models in place I am getting warning messages. What exactly is the limit on? (node? scene? )
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You should get a warning if you exceed 65535 vertices in one meshbuffer, without using 32bit indices. This ia a hard limit, because 16bit indices can only address 2^16 vertices. After that, wrong vertices are used and the mesh is completely corrupted. But you can simply split the mesh into several meshbuffers (which also makes rendering a little faster in general) or swap to 32bit indices (which might not be supported on all platforms, though).
Chet
Posts: 53
Joined: Wed Sep 10, 2008 5:34 am

Post by Chet »

ok forgive me for being a bit slow but a mesh buffer is? How do I go about using more than 1? I would rather not go to the 32 bit and limit future plans ( just a guess something a bit more complicated than 'draw all' in the main loop?)
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

The mesh loaders will create mesh buffers for you. They usually split them by groups, or different textures. So if you have say an .obj and you have 3 groups, it will create 3 meshbuffers.
DavidJE13
Posts: 165
Joined: Tue Jan 09, 2007 7:17 pm

Post by DavidJE13 »

1 meshbuffer is used by 1 scene node, so if you're making a large 3D world and importing it, that's 1 meshbuffer. Try splitting it into quadrants (or better yet into individual buildings) and loading them separately. Then you'll have 4 nodes with 1/4 of the vertices in each. This also helps with any LOD you may want to do later, and with culling, so your game will run faster.

As for switching to 32-bit, if you do you'll likely never see a limit on the number of vertices - it's *really* high (just over 16 million). However, everything will take twice as much VRAM and be slower to send from the processor to the graphics card. So if possible, stick with 16 bit.

edit: ok, didn't know about the splitting Lonesome Ducky mentioned, that may be better (just 1 world file) although I'm not sure if it will give you the same speed advantage from bounding-box culling
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

A meshbuffer is "some part" of a mesh. Not necessarily connected parts, or somehow related. Just parts with the same material. You can have any number of meshbuffers in a mesh, so virtually no limit about how many vertices/faces/materials used in one mesh. Just create a new SMeshBuffer and add it to the mesh, then populate this one instead of the original one.
Meshbuffers are not culled, so there's no performance gain in this place. Only due to better render pipeline usage.
Chet
Posts: 53
Joined: Wed Sep 10, 2008 5:34 am

Post by Chet »

hybrid wrote: Just create a new SMeshBuffer and add it to the mesh, then populate this one instead of the original one.
Meshbuffers are not culled, so there's no performance gain in this place. Only due to better render pipeline usage.
Can somebody point me to an example of this I really dont get how to force additional files (models) into different mesh buffers.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Additional files will automatically go into separate meshes, which means also separate meshbuffers. This problem only occurs if a large model has many vertices which have the same material.
Post Reply