Skip to content

Improve render performance#499

Open
Zuzka-Cat wants to merge 6 commits into
GridSpace:rel-nextfrom
Zuzka-Cat:master
Open

Improve render performance#499
Zuzka-Cat wants to merge 6 commits into
GridSpace:rel-nextfrom
Zuzka-Cat:master

Conversation

@Zuzka-Cat

@Zuzka-Cat Zuzka-Cat commented Jul 26, 2026

Copy link
Copy Markdown

I used Opus 5 to speedup the rendering as the slice and preview tab was sluggish on my high refresh monitor, with success. I don't know if ai code is wanted but it is an improvement. I also still feel some hitches sometimes when dragging around a model, i don't know if that was the case beforehand or not. I haven't tested if there are regressions, i suspect there could be on non fdm modes. I feel like i can work on it a bit more and let opus look how other slicers improve the performance. I also saw WebGL2 in the changes, i don't know if this K:M supposed to work with WebGL 1.0 then it would need further changes definitely.

Opus says:
I stopped Kiri from rebuilding every object's world matrix each frame, made layer materials shared and correctly opaque instead of per-slice and falsely transparent, merged each slice's geometry (and the whole ruler's per-glyph label meshes) into single draw calls, and added GPU occlusion culling that skips bands of layers proven hidden by a depth query.

Draw calls dropped from 120–539 to 8–41 and CPU time inside renderer.render fell from 3.3–5.6 ms to 0.16–0.56 ms — roughly 15–20×.

Measured in Firefox at 520 Hz: slice view went 201 → 355 fps and preview 207 → 353 fps on a 2.36 M-triangle model, while a solid 9.5 M-triangle model went 97 → 512 fps in slice view (occlusion culling drops it to 35 k triangles drawn, pixel-identical) — median frames now hit the 520 Hz cap, though dense previews while orbiting still sit around 108–318 fps.

@stewartoallen
stewartoallen changed the base branch from master to rel-next July 26, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants