Is it possible to show the collision shape of heightmap shape while in game

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By _stark_xo

I am using this GitHub - Zylann/godot_heightmap_plugin: HeightMap terrain for Godot implemented in GDScript heightmap plugin to generate terrain.

The option of “Debug > visible collision shapes” in the editor doesn’t show the heightmap collision shapes.

Is there is a way to make the heightmap collision visible while in game for debugging?

:bust_in_silhouette: Reply From: _stark_xo

This was answered by Zylann on github: Showing terrain collision while in game for debugging · Issue #264 · Zylann/godot_heightmap_plugin · GitHub

It is likely easy to implement naively, but it would completely destroy performance, because it basically means showing a wireframe version of the entire terrain without level of detail. So it might be ok for relatively small terrains from 512 to 1024, but starting from 2048 it might start to be really slow to load (there is a big wireframe mesh to make) and to render. Debug collision shapes is a global option, so if this was supported on terrains, it should at least be optional.

It is not available because so far I considered it kinda useless to display, considering that the shape basically matches the visuals at lod0 (it’s not like having a capsule collider for a character where in this case it really helps), there is no particular difference apart from the Z-shape of triangles used by Bullet and the diamond shape used for rendering. It might get a bit more useful if we add the option to use half-resolution collision shape though.

Note, if you want this to troubleshoot collision issues by seeing how the collider looks like, a better way is not to rely on this, but instead use a more direct tool such as collision scanner. A wireframe mesh would not be able to detect known issues like this godotengine/godot#37337. There are also issues with Areas specifically which were not figured out yet (these are bugs of the engine, not the plugin).