Large single world mesh

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
dankot
Posts: 9
Joined: Wed Sep 16, 2009 11:43 am

Large single world mesh

Post by dankot »

Hello,
I have created a very large level-map with Google Sketch-Up, and I am trying to use it with my Irrlicht-based application.
There are parts in my map from which you can look very far (like - at the top of a building). Because of that, I need to set my far-clip to a pretty large value, which drops the frame-rate.
I tried to play with the minimalPolysPerNode of the addOctTreeSceneNode() method, but could get satisfying results.

My questions are:
1. Can I use LOD with my own large object? Where can I find more details about this kind thing?
2. Is there an advantage to splitting the world into sub-meshes? If so, is there any tool that can help me?

Thanks a lot!
d3jake
Posts: 198
Joined: Sat Mar 22, 2008 7:49 pm
Location: United States of America

Post by d3jake »

I'll throw in my idea:

Can you maybe create the "ground" as the main level mesh, and then create all of the buildings as separate meshes that you can create multiple versions of with decreasing numbers of polys?
The Open Descent Foundation is always looking for programmers! http://www.odf-online.org
"I'll find out if what I deleted was vital here shortly..." -d3jake
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Re: Large single world mesh

Post by vitek »

dankot wrote:1. Can I use LOD with my own large object? Where can I find more details about this kind thing?
Irrlicht doesn't do LOD for regular scene nodes. If you want to do this, you'd need to write it yourself.
dankot wrote:2. Is there an advantage to splitting the world into sub-meshes? If so, is there any tool that can help me?
Yes, it would be advantageous. If you have large mesh buffers with many verticies that aren't visible because they're behind outside the view, you could cull them before sending them to the GPU. You get this with the oct-tree scene node, but generating the oct-tree is pretty expensive.

Splitting up your scene into distinct objects is probably the best thing to do.

Travis
andres
Competition winner
Posts: 78
Joined: Tue Jul 08, 2008 5:18 pm
Location: Guarapuava/Brazil
Contact:

Post by andres »

Up..
Using a single mesh you lose performance, if possible export the objects separate.
Prof. Andres Jessé Porfirio
Federal Technological University of Parana (UTFPR)
www.andresjesse.com
http://irrrpgbuilder.sourceforge.net

Image
chakasoft
Posts: 1
Joined: Tue Sep 22, 2009 6:15 am
Contact:

Post by chakasoft »

dankot is already using addOctTreeSceneNode(), so far vertices aren't sent to the GPU, right?
so how can splitting the world help the frame-rate?
-- Chaka
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post by randomMesh »

chakasoft wrote:so how can splitting the world help the frame-rate?
So the engine can use view frustum culling. It just would render the nodes you can see (that's the theory).
"Whoops..."
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Can we have some meaningful numbers please? The type of optimizations you should use depend on what you're trying to render.
How many triangles? How many materials? What is your target machine? What is your frame rate?

Have you tried enabling VBOs rather than using the octtree node?
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
dankot
Posts: 9
Joined: Wed Sep 16, 2009 11:43 am

Post by dankot »

Thank you all for your help,

Faces: 357450
Edges: 324686
Materials: 126
Textures: 58


FPS: between 6-15 on a new AMD Phenom II quad core 810

and I don't know how to use VBO, can you please direct me to an article or give me a tip in how to use it with Irrlicht?
Thanks,
Dan.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Code: Select all

// get static mesh from animated mesh
IMesh *mesh = animesh->getMesh(0);
// loop through each buffer
for (u32 i=0; i < mesh->getMeshBufferCount(); ++i)
{
   // set hardware vertex and index buffers
   mesh->getMeshBuffer(i)->setHardwareMappingHint(EHM_STATIC);
}
That should speed things up a bit without using LoD. If you still have problems, try splitting your mesh into smaller regions, if there are still issues then you'll have to implement LoD
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
dankot
Posts: 9
Joined: Wed Sep 16, 2009 11:43 am

Post by dankot »

Thanks for the reply,
We tried your suggestion with the hint, but unfortunatelly it didn't do the job.

Can you maybe suggest us a good way to use LOD on a ready editable sketchup mesh (that will later be exported to OBJ)?
should we do it with a graphic editor or with code? and which graphic editor is suitable for the job?


Thanks again,
Dan and Chaka.
Post Reply