Glossary · 3D on the web

Render loop and render on demand

In short

The render loop is the cycle in which a 3D application redraws its image frame by frame. Render on demand means calculating a new frame only when something has changed, instead of constantly at the display's refresh rate [1].

The classic render loop

In the browser the loop runs through requestAnimationFrame: the browser calls a function before the next repaint, usually matching the display refresh rate, commonly 60 times a second and 120 or more on some devices [1]. For games and continuous animation that is right.

Why constant drawing is wasteful for products

A configurator is still most of the time: the visitor reads, compares, chooses. Recalculating every frame anyway loads the GPU and the battery, warms up phones and takes processing time from other work on the page.

How render on demand works

  1. A flag ("redraw needed") is set whenever something changes: the camera moves, an option is chosen, the window is resized, an animation runs.
  2. The loop checks the flag and only then draws a frame.
  3. When nothing moves, the GPU stays idle.

Expensive steps such as shadow maps are also recalculated only on change. Note camera inertia: it requires the controls to be updated every frame while the movement eases out [3].

Not visible, not drawn

Most browsers pause requestAnimationFrame in background tabs [1]. If the 3D view is scrolled out of view, the application can detect this with the Intersection Observer and pause as well [2].

From our library

The spiral stair configurator only draws when the camera, the selection or an animation changes, and only then updates its shadows. The planetary gearhead additionally pauses as soon as it is scrolled out of view (both fictional products). The 3D product viewer page covers performance on product pages.

Related terms

  • Draw calls

    A draw call is a single drawing command sent to the graphics card, such as "draw this mesh with this material". Each call carries overhead, so a few large calls are generally faster than many small ones.

  • Device pixel ratio (DPR)

    The device pixel ratio (DPR) is the ratio of physical pixels to CSS pixels; 2 is typical of Retina displays. In 3D the workload grows with the square of the DPR; a smaller rendering resolution trades quality for speed, set in three.js with setPixelRatio.

  • Lazy loading for 3D

    Lazy loading means loading content only when it is needed. For 3D that means showing a fast poster image first and loading the library, model and textures only when the visitor reaches or starts the view.

  • Orbit controls (camera controls)

    Orbit controls are the usual camera controls in a 3D viewer: the camera circles a target point, zooms in and out and pans sideways while "up" stays up.

  • Core Web Vitals and 3D

    Core Web Vitals are Google's three metrics for loading (LCP), responsiveness (INP) and visual stability (CLS) of a page. A 3D viewer can worsen them if it starts on page load. More on our [3D product viewer](/en/3d-product-viewer/) page.

Examples to try

Example configurator · fictional product

Spiral stair configurator

Plan a spiral stair: enter floor height and opening, treads and rotation are calculated, choose diameter, direction, railing and materials – with an example check and a PDF enquiry.

Stairs & access · Dimensions and sizes · Materials and finishes · Options, modules and accessories

Example configurator · fictional product

Planetary gearhead

A planetary gearhead for sales and training: running drive with adjustable input speed, cut-away and exploded views, item numbers and technical data as sample values.

Industrial cells & machines · Opening and mechanism · Exploded or cut-away view · Notes on the model

Sources

  1. MDN Web Docs: Window.requestAnimationFrame()
  2. MDN Web Docs: Intersection Observer API
  3. three.js docs: OrbitControls

← All terms in the glossary