many objects in irrlicht

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.
irrman
Posts: 10
Joined: Wed Apr 13, 2011 9:18 am

many objects in irrlicht

Post by irrman »

Hello! How i can release occlusion culling in irrlicht? I am must showing many objects (cubes). When i am trying to show 8000 blocks i am getting 8 fps :(
Please, help me!
Last edited by irrman on Fri Apr 15, 2011 2:09 pm, edited 1 time in total.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Occlusion culling in irrlicht

Post by serengeor »

irrman wrote:Hello! How i can release occlusion culling in irrlicht? I am must showing many objects (cubes). When i am trying to show 8000 blocks i am getting 8 fps :(
Please, help me!
It's mostly because of many draw calls and not the cube count.
You should batch those cubes into one mesh or groups of meshes. Search the forum for that. And always search forum, before you post something like this, it has been answered a couple of times earlier.
Working on game: Marrbles (Currently stopped).
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The example for occulsion culling can be found here: http://irrlicht.svn.sourceforge.net/vie ... iew=markup
It will be part of the next Irrlicht relase. But indeed, occlusion culling won't help here, you need geometry batching and maybe octree culling.
irrman
Posts: 10
Joined: Wed Apr 13, 2011 9:18 am

Post by irrman »

Thanks.
I found http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=39598, but at a distance the edges of cubes becoming a green / yellow.
How to fix it?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Screenshot?
irrman
Posts: 10
Joined: Wed Apr 13, 2011 9:18 am

Post by irrman »

Image

screenshot
xirtamatrix
Posts: 219
Joined: Fri Feb 19, 2010 4:03 pm
Location: Estonia

Post by xirtamatrix »

hybrid wrote:The example for occulsion culling can be found here: http://irrlicht.svn.sourceforge.net/vie ... iew=markup
It will be part of the next Irrlicht relase. But indeed, occlusion culling won't help here, you need geometry batching and maybe octree culling.
Hi, I was having the same problem and was about to ask the same thing.
The problem with that example is, its too simplistic. Yes its ok to do an occlusion query like this when you have ONE occluder and ONE occluded, but how would you do it in a real scene where you might have say ~100 nodes and you're moving around with a free camera? Are you expected to provide the remaining 99 nodes into the query? If not, how would you know where the camera is and what should be tested for occlusion? If I have mis-understood something, please correct me.

In my case, FPS dropping significantly at around 100 nodes, and I've performed many tests to confirm its solely due to no occlusion-culling happening, so geometry batching is not a concern/solution for me.

So, my question is, is there some more elegant code-snipet or example that shows how would one do occlusion-culling in a real scene with around 100 nodes? (rather than manually comparing, does node A occlude node B? ahha ok, then lets not draw node B)

Thanks.
Last edited by xirtamatrix on Fri Apr 15, 2011 12:39 pm, edited 1 time in total.
to live, is natural; to die, is not!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

http://http.developer.nvidia.com/GPUGem ... _ch29.html
You're not supposed to test all a's and b's with each other. Occlusion culling will only work if you have a few occluders, and many complex objects which may be occluded. There you get benefits and can use occlusion culling. Otherwise batching, hardware buffers, and sometimes also instancing can help much better.
xirtamatrix
Posts: 219
Joined: Fri Feb 19, 2010 4:03 pm
Location: Estonia

Post by xirtamatrix »

hybrid wrote:http://http.developer.nvidia.com/GPUGem ... _ch29.html
You're not supposed to test all a's and b's with each other. Occlusion culling will only work if you have a few occluders, and many complex objects which may be occluded. There you get benefits and can use occlusion culling. Otherwise batching, hardware buffers, and sometimes also instancing can help much better.
Ok, I mis-understood then. Thanks for the link, I'll read it thoroughly before burdening you with more of my 'wisdom' =)

/cheers!
to live, is natural; to die, is not!
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

irrman wrote: screenshot
It's quite likely a mipmapping problem. I assume that you have a texture atlas in which you store multiple tile images next to each other?
Imagine that each tile is 2x2 pixels big and you have 2x2 tiles in the texture. The first mipmap level will reduce the texture size to 2x2 pixels, and each tile will be reduced to 1x1 pixels. The next mipmap level however will reduce the texture to 1x1 pixels, and that pixel will be an average of the 4 tiles, thus mixing different tiles together. You only want to generate mipmaps to level X-Y, where X is log2(texturesize) and Y is log2(tilesize), in the example i gave that'd be 2-1 = 1, ie only the first mipmap level should be generated.

It could be something else though, i'm just making assumptions.
irrman
Posts: 10
Joined: Wed Apr 13, 2011 9:18 am

Post by irrman »

No. I have the texture in different files.
xirtamatrix
Posts: 219
Joined: Fri Feb 19, 2010 4:03 pm
Location: Estonia

Post by xirtamatrix »

hybrid wrote:http://http.developer.nvidia.com/GPUGem ... _ch29.html
You're not supposed to test all a's and b's with each other. Occlusion culling will only work if you have a few occluders, and many complex objects which may be occluded. There you get benefits and can use occlusion culling. Otherwise batching, hardware buffers, and sometimes also instancing can help much better.
Ok, I read it through now.
The situation I have is, that I have 120 objects in the scene. Most of these are really low-poly, upto 100. Some of these are slightly heavier, 400-500 polys. So no very comlex over 1000 polygon objects.

Basically, it gives me very good fps (200-300) on one machine where I have a newer GTS450, but on an older machine where there is only an on-board graphic adaptor, the fps drops to about 10, or even lower.

I'm trying to figure out how can I optimize my scene for low-end machines. I suspect its not really the complexity of objects but the number which needs to be rendered, yet its not a big enough number to justify batching. And yet, the objects are not complex enough to justify Occlusion Culling queries. So what is to be done? The machine has a decent CPU (dual-core 3.0) and some 4 GB of RAM.

Any suggestions/hints would be much appreciated.

EDIT: you mentioned something about octree culling, how is that done? I load all my objects into octree so maybe that would help.

/regards
to live, is natural; to die, is not!
xirtamatrix
Posts: 219
Joined: Fri Feb 19, 2010 4:03 pm
Location: Estonia

Post by xirtamatrix »

On the other hand, doing occlusion queries might still be a good idea becayse what I have is lots of rooms, and I want the walls to act as ocluders, so basically I want everything behind a wall to not be drawn. But I'm finding it hard to conceptualize how it should be done.

I dont load objects manually. When my app starts, it loads everything in a folder or zip. And the catch is that the folder could contain anything. There is no guarantee that it will have one or other mesh file. I just load each mesh-file found, add it to an octree and create am animated node from it.

So I'm afraid no way for me to provide a specific mesh as ocluder or ocluded. :(
to live, is natural; to die, is not!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

octree won't help you either, as it only works for huge meshes (in terms of dimensions). What could help is hardware buffers. You should set the hardware mapping hint to EHM_STATIC on all meshes, and probably also reduce the minimum hw buffer size (IIRC, it's a video driver setting) to some very low value (around 20 maybe). This should reduce your memory bandwidth usage a lot, which can definitely help on low-end machines. Moreover, you could batch arbitary meshes, or meshes nearby each other, in order to reduce the scene manager overhead. This usually helps, but should be tested on low-end machines.
irrman
Posts: 10
Joined: Wed Apr 13, 2011 9:18 am

Post by irrman »

Do I understand correctly?:
1. Divide all scene at chunks.
2. Chunks, located around the player is divided into nodes.
3. Chucks, located outside the player's batching in one scene node.
?
How released it in minecraft?
Post Reply