godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.46k stars 21.07k forks source link

Gridmap doesn't perform far clip/distance draw culling #78825

Closed elvisish closed 1 year ago

elvisish commented 1 year ago

Godot version

Godot_v3.6-beta2_win64

System information

Windows 10

Issue description

Gridmap doesn't inherit from VisualServer and uses MultiMeshes to optimise mesh placement, however distance draw/far clipping on the camera is ignored and this really should be possible (if not for performance, for aesthetic purposes).

Steps to reproduce

Minimal reproduction project

test_gridmap.zip

elvisish commented 1 year ago

This is very weird and embarrassing, but making a test project it seems to be working. I'll try to figure out why it's not working on my main project, perhaps a shader material I'm using is interfering with the cull distance, I'll close this later if that turns out to be the cause of this.

Calinou commented 1 year ago

This is very weird and embarrassing, but making a test project it seems to be working.

Which octant size are you using in your other project? Larger octant sizes reduce culling opportunities, as each MultiMesh will span a larger area.

elvisish commented 1 year ago

This is very weird and embarrassing, but making a test project it seems to be working.

Which octant size are you using in your other project? Larger octant sizes reduce culling opportunities, as each MultiMesh will span a larger area.

The default size, that's what surprised me about my test.

elvisish commented 1 year ago

Totally my fault, for some reason my far clip was too short and it works now, sorry about this.