Jump to content

How to improve performance for massive cities


photo

Recommended Posts

I am creating some stress scenarios and was want to be able to have 50K buildings in project.

At the moment when I get to 5-7K it really starts slowing down.

 

I have a chunk of over 100 buildings/objects I save this as a node.

 

I load in the nodes as reference node and scatter this about the map.

 

I turned down draw distance to 0.3.

 

Is this the correct approach or is there some more optimizations I can do to help me reach my target?

Link to comment

50k objects is a by far too high object count for efficient rendering. Such scenes will require all kinds of optimizations like scenery streaming, hierachial culling, mesh batching, aggressive usage of LOD including billboarding and efficient occluder usage.

 

Please seach the internet for tons of available optimization approaches for large world/complex city scenery rendering

Link to comment

50k objects is a by far too high object count for efficient rendering. Such scenes will require all kinds of optimizations like scenery streaming, hierachial culling, mesh batching, aggressive usage of LOD including billboarding and efficient occluder usage.

 

Please seach the internet for tons of available optimization approaches for large world/complex city scenery rendering

 

I don't expect them to all be rendered to the scene at once. I need to find out how/if Unigine supports these kind of numbers of objects, and if its reasonably easy to achieve. 

Link to comment

In most cases the efficient rendering of such complex scenes is more related to content structure and clever scene optimization then being engine-specific

 

Indeed. Planning and understanding of material batching is the key here. You don't want to brute force that number of individual objects, even if your hardware could manage it, it's vulnerable to huge variations in end-user performance.

 

You will want to arrange the scene to allow for variable amounts of detail and not rely on the engine to do that.

 

Think about grouping buildings as single objects, shared materials. At long range have 'landscape' entities (a single object that represents a complete or part of a town at a distance). I promise you huge improvements in performance by applying a bit of thought to scene arrangements. This goes for vehicles and cockpits too.

Link to comment

50k objects is a by far too high object count for efficient rendering. Such scenes will require all kinds of optimizations like scenery streaming, hierachial culling, mesh batching, aggressive usage of LOD including billboarding and efficient occluder usage.

 

50k buildings in city calls for some implementation of real time occlusion...

Link to comment

UNIGINE provides all kind of real-time occluders including WorldOccluderTerrain which can also be used for efficient city scene culling.

 

https://developer.unigine.com/forum/topic/1416-large-world-performance-hints-and-tips/#entry7469

https://developer.unigine.com/forum/topic/1705-solved-how-to-use-worldoccluderterrain/#entry9167

 

Challenge here is to build the occlusion mask. Especially for complex city scenes some automatic generator scripts will be required for this.

Another key challenges is to find the best object batch size and structure (=the bigger, the better due to reduced draw call count and smaller spatial tree) and culling efficiency (=the smaller, the better to reduce render overhead of geometry outside of the frustum, but at the same time more complex spatial tree)

This is closely related to things like material batching (e.g texture atlas creation to reduce render state changes) and general scene structure (e.g. content splitting in smaller tiles to allow scene streaming to limit scene content in memory to required parts)

As the whole problem is a classical iterative optimization task, once again some automated scripting might be required for global scene optimization. As this is a no-trival task some massive city environment would be a perfect set for next UNIGINE engine demo as already proposed

https://developer.unigine.com/forum/topic/1550-is-it-possible-to-publish-this-demo-scene-to-customers/?p=8262

Link to comment

Challenge here is to build the occlusion mask. Especially for complex city scenes some automatic generator scripts will be required for this.

 

 

You mean to generate heightmap copying building structure and use it as occludor? Very interesting idea. How the engine will cope with huge differences for two neigbouring pixels (buildings are perpendicular, so there will be big differences)?

 

I can imagine making small terrain object and paint via editor tools it manually (for few hundreds of building not big issue...).

Link to comment

I turned off the grass and boom FPS shoots up even with 60K+ buildings.

 

I turn on the profiler and I can see how performance really depends on how much is being drawn.

 

So if I have a "sparse" terrain it should be fine to manage loads. If its very dense then I will have to compromise.

 

I am trying ObjectMeshCluster but I don't notice any improvement yet.

 

Also, I wonder if I can use a billboard as the most coarse LOD somehow?

Link to comment

UNIGINE provides all kind of real-time occluders including WorldOccluderTerrain which can also be used for efficient city scene culling.

https://developer.unigine.com/forum/index.php?app=core&module=global&section=reputation&do=add_rating&app_rate=forums&type=pid&type_id=7469&rating=1&secure_key=a79ee03f768a3c5a15f007158a077cd6&post_return=7469

https://developer.unigine.com/forum/index.php?app=core&module=global&section=reputation&do=add_rating&app_rate=forums&type=pid&type_id=9167&rating=1&secure_key=a79ee03f768a3c5a15f007158a077cd6&post_return=9167

 

Challenge here is to build the occlusion mask. Especially for complex city scenes some automatic generator scripts will be required for this.

 

Another key challenges is to find the best object batch size and structure (=the bigger, the better due to reduced draw call count and smaller spatial tree) and culling efficiency (=the smaller, the better to reduce render overhead of geometry outside of the frustum, but at the same time more complex spatial tree)

 

This is closely related to things like material batching (e.g texture atlas creation to reduce render state changes) and general scene structure (e.g. content splitting in smaller tiles to allow scene streaming to limit scene content in memory to required parts)

 

As the whole problem is a classical iterative optimization task, once again some automated scripting might be required for global scene optimization. As this is a no-trival task some massive city environment would be a perfect set for next UNIGINE engine demo as already proposed

 

https://developer.unigine.com/forum/index.php?app=core&module=global&section=reputation&do=add_rating&app_rate=forums&type=pid&type_id=8262&rating=1&secure_key=a79ee03f768a3c5a15f007158a077cd6&post_return=8262

 

Unfortunately I cannot access those links.

 

"Your reputation submission could not be saved because not all of the necessary information was provided."

Link to comment

You mean to generate heightmap copying building structure and use it as occludor?

 

Actually I meant using one or more WorldOcludderTerrain to cover the complete area of the city. Depending on the WorldOccluderTerrain size and assigned occluder height map resolution this will produce a regular occlusion cell raster were each oclusion height map cell covers a small region e.g. 10x10 meters.

 

The challenge is then to find the minimum height within each occluder cell. This can be done by some top-dowm multi-intersection ray-casting for intersection height calculation with bulidings/terrain within this cell. Due to the large number occluder height cells and iterative variation of ocluddeer cell density for best results the calculation will have to be automated.

Link to comment

I will try the idea of generating terrain ocludor which is copying shapes of buildings in manual way (painting). It will depend on resolution of such heightmap and shape of building, but I think it is worthy of try....

Link to comment

Just an old example of WorldOccluderTerrain usage for coarse culling of distant parts of street network. Mask generation was quite simple in this case by rending the street network top down to some image and converting this to a black/white occludder height mask within photoshop. Of course in more dense urban environments a much tighter mask would be more optimal but at least it shows the concept

 

post-82-0-01851800-1384016650_thumb.jpg

Link to comment

Just an old example of WorldOccluderTerrain usage for coarse culling of distant parts of street network. Mask generation was quite simple in this case by rending the street network top down to some image and converting this to a black/white occludder height mask within photoshop. Of course in more dense urban environments a much tighter mask would be more optimal but at least it shows the concept

 

attachicon.gifWorldOccluderTerrain.jpg

 

How big is performance impact of high resolution WorldOccluderTerrain?

Link to comment

No easy answer to that as this depends on the scene. I think cell resolution shouldn't be too small (let's say smaller than 10-20m), as otherwise the overhead will be too high and will burn the potential benefits.

 

As discussed above the cell size for complex scenes is a tuning parameter and therefore some automatic occluder height mask generation surely simplifies iterative optimization of best suitable cell size

Link to comment
×
×
  • Create New...