Performance issues (3600 nodes) [resolved]

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
Violence
Posts: 10
Joined: Mon Aug 13, 2012 11:32 am

Performance issues (3600 nodes) [resolved]

Post by Violence »

Hello!
I've made a 60x60 field of cubes with the following code (Tile class is a simple wrapper for addCubeSceneNode).

Code: Select all

 
for(int i =-15; i < 45; i++){
    for(int j = -15; j < 45; j++){
        tile = new Tile(vector3df(i*5.f,-5.f,j*5.f));
    }
}
 
Camera is set to look at the sphere (which is moved around by the mouse pointer) with fixed 45 degree.

When I see cubes which were created first, I get 60 FPS but when I see last created cubes I'm getting a FPS drop to 7-10. Why does it happens? I thought that hidden objects are being culled by frustum so with a top down view like this everything should be fine..
Next if I use the mesh combiner from this forum, the FPS will be OK but I will not be able to access the scene nodes anymore (to change textures etc) right?
Maybe it's better to use a planes for the ground level instead of cubes?

a screenshot (notice the fraps fps counter): http://i.imgur.com/f51m7JF.png
here is a precompiled demo: http://www.mediafire.com/download/eshhw ... fy/Map.zip
Last edited by Violence on Mon Sep 30, 2013 12:37 pm, edited 1 time in total.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Performance issues (3600 nodes)

Post by mongoose7 »

Hidden objects are not culled - this is the function of the depth buffer. The frustum is just a pyramid with its apex at the camera. If the camera is pointing *at* your nodes, all will be rendered though some will not be visible.
Violence
Posts: 10
Joined: Mon Aug 13, 2012 11:32 am

Re: Performance issues (3600 nodes)

Post by Violence »

Haha didn't knew that.
I've searched on "culling" and found the "setAutomaticCulling".

Code: Select all

Mesh->setAutomaticCulling(EAC_FRUSTUM_BOX);
Now it works good.
Post Reply