DEV Community

Jeremy Xiao
Jeremy Xiao

Posted on

Budgeting a GLB for a Three.js Product Page

A model that opens in a desktop viewer may still be too costly for a product page. Before integration, inspect its file size, geometry density, draw calls, material count, and how its detail changes at mobile and desktop distances.

Start with the page constraints. Measure how much of the viewport the model occupies at common breakpoints, then choose level-of-detail transitions based on the apparent loss of detail rather than a fixed triangle rule. Keep textures appropriate to their display size, avoid unnecessary material duplication, and test over the network and device conditions you expect visitors to use.

When an asset package includes desktop and mobile LODs, verify that the intended component actually switches between them and that the GLB loads correctly. A React Three Fiber component can fit a React project; a vanilla Three.js loader may suit another stack. Record measured file size, triangle count, and draw calls so later changes can be compared.

img2threejs creates web-ready image-to-3D packages that include GLB models with desktop and mobile LODs, React Three Fiber and vanilla Three.js loaders, and measured performance details. One image cannot show every surface, so use your own additional views when the object needs more coverage.

Disclosure: I am Jeremy Xiao, maker of img2threejs. Explore img2threejs.

Top comments (0)