Zylann / godot_heightmap_plugin

HeightMap terrain for Godot implemented in GDScript
Other
1.72k stars 159 forks source link

get_chunk_aabb takes a lot of time to complete #155

Open Duroxxigar opened 4 years ago

Duroxxigar commented 4 years ago

Describe the bug The method get_chunk_aabb takes anywhere from 40 ms - 80 ms to complete. It seems it is dependent on the chunk size on how long it takes. I'm currently at around 65ms with a chunk size of 64.

The size of the terrain is 3000x3000 (Yes, I know this is large)

Screenshots image

Environment

Zylann commented 4 years ago

My profiling looks quite different, _get_chunk_aabb is not appearing image

In fact _get_chunk_aabb is in HTerrainDetailLayer, I don't have one. How many do you have? And how far did you set their view distance?

Duroxxigar commented 4 years ago

I have 3 layers and 1 is at 1k, the other 2 are at 500.

Zylann commented 4 years ago

Those distances are really high, you should tune them down. Some improvements can be made to increase performance but right now such sizes are not recommended. If you halve view distances it should be 4 times faster.

Duroxxigar commented 4 years ago

Yeah - I completely forgot about the detail layers having this property. I'll touch basis with the environment team. Thanks a bunch @Zylann