Skip to content

perf(viewport): render camera frustums with GPU instancing#1312

Merged
MrNeRF merged 4 commits into
MrNeRF:masterfrom
jacobvanbeets:perf/gpu-instanced-camera-frustums
Jun 23, 2026
Merged

perf(viewport): render camera frustums with GPU instancing#1312
MrNeRF merged 4 commits into
MrNeRF:masterfrom
jacobvanbeets:perf/gpu-instanced-camera-frustums

Conversation

@jacobvanbeets

Copy link
Copy Markdown
Collaborator

Camera frustum overlays were rebuilt and re-uploaded on the CPU every frame for every visible camera (~160k vertices/frame for large COLMAP datasets), causing viewport lag while navigating with frustums enabled. The cost was CPU/driver-bound, so it was most noticeable on Windows.

Perspective frustums now draw via a single instanced draw per viewport panel: one storage-buffer instance per camera (model matrix + color), with the vertex shader generating the 8 edges, projecting them with the same camera-space pinhole as the scene, and expanding them into anti-aliased, depth-faded lines (reusing the shape-overlay fragment logic). Thumbnails and equirectangular frustums keep the existing path.

jacobvanbeets and others added 4 commits June 15, 2026 18:54
Camera frustum overlays were rebuilt and re-uploaded on the CPU every frame for every visible camera (~160k vertices/frame for large COLMAP datasets), causing viewport lag while navigating with frustums enabled. The cost was CPU/driver-bound, so it was most noticeable on Windows.

Perspective frustums now draw via a single instanced draw per viewport panel: one storage-buffer instance per camera (model matrix + color), with the vertex shader generating the 8 edges, projecting them with the same camera-space pinhole as the scene, and expanding them into anti-aliased, depth-faded lines (reusing the shape-overlay fragment logic). Thumbnails and equirectangular frustums keep the existing path.

Co-Authored-By: Oz <oz-agent@warp.dev>
@MrNeRF MrNeRF merged commit cee35d5 into MrNeRF:master Jun 23, 2026
5 checks passed
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