Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Allow VBO to be used for meshes all the way down to 4 vertices. #287

Closed
wants to merge 1 commit into from

Conversation

paradust7
Copy link
Contributor

@paradust7 paradust7 commented Feb 11, 2024

I used linux perf and GPUView (Windows) to examine rendering performance. I discovered in both cases that Minetest was CPU-bound, with the GPU barely being used. In particular, the CPU was spending most of its time in memory operations (CPU to GPU). I measured the transfer rate to be around 30GB/sec sustained.

Looking at the code, I discovered that the vast majority (80%) of map block meshes are under 500 vertices, and were therefore not being stored in VBOs, because of this arbitrary limit. They were being retransmitted in full every frame.

This boosts worst-case FPS (in Mineclonia) around 45% on my hardware, from 65fps to 95fps. (with default rendering distance)

@grorp
Copy link
Member

grorp commented Feb 11, 2024

@sfan5
Copy link
Member

sfan5 commented Feb 11, 2024

Yeah we can change this in MT, no need to adjust Irrlicht defaults.

I checked the history of the commented out call and it has been commented out since the very first commits it appeared in (luanti-org/luanti@4e249fb)...

@lhofhansl
Copy link
Contributor

@paradust7 Did you also try to set client_mesh_chunk. Default is 1, changing to larger values reduces the number of meshes in favor of fewer larger ones.

@paradust7
Copy link
Contributor Author

@paradust7 Did you also try to set client_mesh_chunk. Default is 1, changing to larger values reduces the number of meshes in favor of fewer larger ones.

I haven't, but as long as everything is in VBO, I don't see there being any extra benefit to joining meshes (and there might be downsides).

@sfan5 sfan5 closed this Feb 12, 2024
@lhofhansl
Copy link
Contributor

I haven't, but as long as everything is in VBO, I don't see there being any extra benefit to joining meshes (and there might be downsides).

There's the number of drawcalls. I still find - even with the MT patch applied - that setting client_mesh_chunk to 8 gets my FPS from 20 to 60 FPS. (Older mobile NVidia card, viewing_range = 1000)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants