Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.

Improve performance by aggressively merging meshes#94

Closed
Birdy2014 wants to merge 1 commit into
mainfrom
perf-merge-meshes
Closed

Improve performance by aggressively merging meshes#94
Birdy2014 wants to merge 1 commit into
mainfrom
perf-merge-meshes

Conversation

@Birdy2014

@Birdy2014 Birdy2014 commented Aug 19, 2025

Copy link
Copy Markdown
Collaborator

So I'm procrastinating learning for exams again and decided to finally improve the performance of this program.

With this PR, instead of rendering only one diffuse and opacity texture per mesh, up to 16 can be drawn. This allows more meshes to be merged per node and reduces the amount of meshes from 4980 to 1356 for the city model. The per-core CPU load is reduced from 160% to 100% on my machine.

There is one drawback: Indexing an array using a vertex attribute may not be legal in GLSL (but it works for me), so I would need to replace that with some ugly loop if it doesn't work for you.

So, please test this PR on Windows and MacOS, but since this project is long over, this PR will probably stay open forever.

@pixelsandpointers

Copy link
Copy Markdown
Owner

@Birdy2014 can check tomorrow.

@LazyBone2017

Copy link
Copy Markdown
Collaborator

Tested on Windows:
slight decrease in max CPU-usage ~30%
however GPU-usage increased by 50%

@Birdy2014 Birdy2014 marked this pull request as draft August 23, 2025 22:42
@Birdy2014 Birdy2014 closed this Mar 15, 2026
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.

3 participants