Rendering Compatibility for User-Uploaded 3D Models
Rendering rules tuned for a fixed set of built-in models silently break on user uploads — a room scan exposed two hidden assumptions: that every face should render, and that every model needs scene lighting.
The Problem
When a 3D scene is built around a fixed set of bundled assets, many rendering parameters naturally become tuned to those assets. As long as the content does not change, those values start to look like general system defaults.
That changes once users can upload their own models. GLB files from different sources can use different normal directions, material setups, and texture workflows. A rendering rule that works perfectly for one controlled asset set may fail as soon as the input changes.
I ran into this after adding custom GLB upload to a 3D prototype. The scene already had double-sided rendering and lighting values tuned for its built-in objects. Testing with a real room scan exposed two issues in sequence: from a top view, the interior was covered by a large white surface; after fixing that, the textures still looked heavily overexposed.
Both problems came from the same underlying pattern: assumptions that were valid for fixed internal assets had been treated as if they were valid for every uploaded model.
The root-cause analysis and implementation fixes mainly came from Claude Code. My role was to validate them with real scan data and identify the limits of the resulting behavior.
Hidden Assumption 1: Every Face Should Be Rendered
The first version enabled double-sided rendering for uploaded models as a compatibility measure. The logic seemed reasonable: if a model had unexpected normal directions, rendering both sides would reduce the chance of surfaces disappearing.
The room scan showed why that assumption was too broad.
This type of model behaves more like an interior shell. Its normals facing inward are not necessarily incorrect; they match the fact that the scanned space is meant to be viewed from inside. Once both sides were rendered, surfaces that should have remained invisible from the outside were drawn as well. From above, the back side of the ceiling covered the interior and appeared as a large white layer.
The fix was to render only front-facing surfaces and let back-face culling work again. From the top view, the ceiling's back side no longer blocked the room interior.