Frustum Culling Question

Hello,

I’m currently working on a project which can occasionly have more than 70.000 entities in one scene and all of them being sphere models. Since they’re all somewhat far away, or at least not all are visible through the camera, I thought that the Frustum Culling would do its job and the performance wouldn’t be too bad. Unfortunately that’s not the case.

As you can see, although somewhat dark, there are only some spheres on the screen, but it’s still processing all the entities. Am I doing something wrong? What are the general suggestions for these kind of practices?

Also, I’m using a perspective camera, is it possible to get the region (X,Y, Height and Width) what the camera can see?

Thanks for any help, from a beginner in this field :blush:

Actually frustum culling is working for you, as you can see there are only 33 draw calls.
Yet you have added 70k entities to the scene. This scenario is not ideal at all sadly. And that’s not just a Xenko limitation it’s a limitation in computing power, since a game is time constrained.

You should try to batch and merge those spheres somehow. What kind of behavior you expect from all those entities?

ROFL. I miss read that as 69519 draw calls and though maybe frustum calling wasn’t on.

How am I able to batch and merge those spheres? I tried to search for some help for that topic but didn’t really find anything, especially how to do it in Xenko. Do I need to switch from having one entity per ModelComponent to adding more ModelComponents to one entity? I’m guessing the SceneSystem takes that much time to process all the entities and calculate if they are visible?

The entities represent units in an universe (suns, planets, moons etc.) At the moment they all recieve a simple rotation, but I want to add some basic shaders to the sun and other units in the near future, also moving ships, shots and what else.

I would really appreciate some help for this problem

If you are making a voxel kind of game, you shoudn’t have one entity per voxel. This is much too computational expensive.

Instead you should only have say 100 entities for everything that is close to the camera. And batch all the (visible) rest in some big meshes with simplified geometry.

Space simulation can be painful to implement properly.
Games like that use multiple strategies to render things in a visually acceptable way.
At very high distance , batching and billboarding, impostors.
When things get close they could become real entities but never above 3000 entities per scene really.
I would focus first on simulating a solar system. :slight_smile:

Rendering distant celestial bodies to a cubemap is another option.

I already thought about rendering all static objects on a texture and add that to the scene, but in that way I would lose the possibility to rotate them. Can you hint me the approach I have to take to be able to batch draw a lot of entities/models? Or how do I merge the meshes of spheres together? I feel kind of lost in this 3D stuff, since it’s so much to look at and care for.

Really thanks in advance