Hello.
I'm making visualization which is a single (procedurally generated) mesh that consists of ~10'000'000 triangles.
The mesh itself is represented by a unit sphere located in origin (i.e. a sphere with radius 0.5
with center in 0, 0, 0
) and is an instance of MeshInstance3D
. Mesh generation is performed via SurfaceTool
by adding necessary vertices. Mesh is generated only once (in _Ready
) and then it does not change.
Besides mesh itself, scene contains DirectionalLigth3D
and Camera3D
which is located at 0, 0, 2
with the FOV set to 75
(default), Near 0.05
and Far 2
so that camera only "sees" the front half (or front hemisphere) of the sphere.
Even with that setup I barely get 30 FPS. What is more important, even if I move camera closer to the sphere, so that only small part of the sphere is visible the FPS does not change.
Visual profiler shows that engine spends most of the time in Depth Pre-Pass
and Opaque Pass
, so I guess - drawing geometry?
To my understanding, it does not matter what is visible, the engine has to render the whole mesh, it cannot (at least, automatically) to draw only visible part of the mesh. Is there anything I can do about it? I've tried to use ArrayOccluder3D
and I set vertices taken from mesh but it didn't help.
If it matters, I'm using Windows 10 x64, Godot 4.0 rc5 mono x64 and C#.