Culling "Dynamic" seems to have no effect

Hello,

I am totally new to jmonkey and the whole 3D Game Development. So please forgive this very naive approach and my probably weird question: I have the following workflow that ends up in a game with 4 frames per second (stirring, isn’t it :))

• create a city in CityEngine (http://www.esri.com/software/cityengine)
• import it to blender, each house being one object, all in all about 1300 objects
• All in all in Blender about 600 Materials, 200.000 verts, 300.000 faces / triangles
• I export the scene to Ogre XML and have one .scene for the whole city
• In my game code I have face culling, cullHint.Dynamic, LOD, FarFrustum, GeometryBatchFactory.optimize() integrated
• but when I load the scene file, I get the following statistics, that indicate none of the culling / LOD / Fr Frustum is working, since the amount of textures, vertices, triangles etc. does not change at all when moving through the scene. I get the following stats:

FrameBuffers (M) =0
FrameBuffers (F) = 0
FrameBuffers (S) = 0
Textures (M) = 616
Textures (F) = 616
Textures (S) = 618
Shaders (M) = 4
Shaders (F) = 5
Shaders (S) = 6
Objects = 3709
Uniforms = 16617
Triangles = 2021762
Vertices = 5176197
Frames per Second: 4

For the cullHint.Dynamic:
I have implemented is as this (spatial being the spatial that holds all geometries of the scene)
spatial.setCullHint(CullHint.Dynamic);

Is there anything else I have to do to make the culling work?
FaceCulling seems to work, since viewing objects from within makes the faces invisible

Also LOD: It is properly defined in my XML files, but the Levels don’t seem to be applied.

You probably need much more information about my code to give any specific answers, and that is not what I am asking. I was wondering if there is anything rather basic that I am overseeing?

Thankful for anyone bearing with me :slight_smile:

P.

Your statements about LOD, culling, the batch factory etc. don’t really make sense. Also, what exactly do you expect to happen in terms of culling? The numbers don’t match for what you say but maybe you batched all houses with a certain texture so that the form a mesh that is spanning all over the city and is thus never culled.

Your statements about LOD, culling, the batch factory etc. don’t really make sense.
Sorry, like I said, not a real professional :) Thanks for taking some time anyways!
maybe you batched all houses with a certain texture so that the form a mesh that is spanning all over the city and is thus never culled.
Okay, that might actually be the problem then, because the buildings do actially share some materials (roofs for example are the same on almost every building) So would the following solve the problem:

• in Blender bake the textures of each building / block to a new image and map that with uv
• this would make one texture per building, right?

@paulhoepner said: Sorry, like I said, not a real professional :) Thanks for taking some time anyways!

Okay, that might actually be the problem then, because the buildings do actially share some materials (roofs for example are the same on almost every building)
So would the following solve the problem:

• in Blender bake the textures of each building / block to a new image and map that with uv
• this would make one texture per building, right?

Writing games is hard. Sometimes pointing the automated tools at a scene is not enough to achieve decent performance. If you go with your proposed approach then you would end up with 1300 textures… which also isn’t going to be very good for you.

If you want 1300 buildings in your scene then you are going to have to design a strategy for managing them spatially. You can’t just import a blender scene and “hope for the best”. For example, you could organize your buildings into city blocks or something before batching so that they are still spatially organized. I don’t think blender is going to help you do that, though.

At any rate, your scene still has 3709 objects even when batched. That’s going to slow you down no matter what… but at least with a little scene graph organization, you can minimize the hit.

@pspeed:
okay, makes a lot of sense! So how would one do that if approach professional? Dynamically load /unload houses/blocks when within the camera panes?

And: I’m about to write a script in blender, that merges all meshes by distance, so when ignoring the streets, it will automatically make alle houses on one block one mesh. This way I would end up with round about 300-400 Blocks / Objects. Do you think that would be a reasonable amount?

Or maybe the approach with scene graph optimization. If so, is there maybe some smart way to reorganize all geometries of the loaded scene within the scenegraph

Thanks for helping, this is very much appreciated!