Skip to content
Gaussian Splats on a Revit Model in 600 Lines of JavaScript

Gaussian Splats on a Revit Model in 600 Lines of JavaScript

Michael Beale's gaussian-splats-lmv overlays photoreal XGRIDS captures onto a Revit model inside the APS Viewer. Same camera, same section planes. Three modules, roughly 600 lines of JS, a 65,536-bucket counting sort in a Web Worker, and 32-byte splat records doing the heavy lifting.

Details

Made for
Autodesk
Published

What it is

Two visual languages that almost never share a viewport: the clean parametric line-work of a Revit model and the fuzzy, photographic cloud of a Gaussian splat capture. Michael Beale's gaussian-splats-lmv pulls both into the same APS Viewer canvas, and they behave like neighbors. Pan, orbit, slice the building with a section plane, and the photorealistic reality capture obeys the same cut. A real showroom interior settles into its Revit shell, and the same blade goes through both.

The whole thing is roughly 600 lines of JavaScript across three modules, which sounds suspicious until you read them. Each splat is an instanced quad whose "texture" is a mathematically computed Gaussian falloff, shaped by projecting a 3D covariance matrix through the camera. Sorting is the real party. Transparent splats can't hide behind a Z-buffer, so every camera nudge re-orders millions of them back-to-front via a 65,536-bucket counting sort running O(n) inside a Web Worker. Splats themselves pack into 32 bytes apiece (XGRIDS' LCC format, which sidesteps COLMAP photogrammetry by leaning on phone-grade LiDAR instead). Section planes line up because the vertex shader evaluates the exact half-space equation LMV uses internally. No coordinate gymnastics, no sign-flip hunting at 1 a.m.

Worth poking at. Append ?lcc= with a URL to one of the sample scans from the XGRIDS developer portal and watch your own capture drop straight into the viewer. Read splat-renderer.mjs for the Worker sort, lcc-loader.mjs for the byte layout, and Michael's APS blog post for diagrams of both.

How it’s made

Technology
WebGL
Framework & Tool
Revit