3D models are more relevant than ever. Retailers bring in-store shopping
experiences to customers' homes. Museums are making 3D models of their artifacts
available to everyone on the web. Unfortunately, it can be difficult to add a 3D
model to a website in a way that provides a great user experience without a deep
knowledge of 3D technologies or resorting to hosting 3D content on a third-party
<model-viewer> web component, introduced in early
2019, seeks to make putting 3D models on the web as easy as
writing a few lines of HTML. Since then, the team has been working to address
feedback and requests from the community. The culmination of that work was
<model-viewer> version 1.0, relesed earlier this year. We're now announcing
the release of
<model-viewer> 1.1. You can read the release
notes in GitHub.
What's new since last year?
Version 1.1 includes built-in support for augmented reality (AR) on the web, improvements to speed and fidelity, and other frequently-requested features.
Viewing a 3D model on a blank canvas is great, but being able to view it in your space is even better. For an entirely-within-the-browser 3D and AR Chrome Android supports augmented reality using WebXR .
When it's ready, you'll be able to use it by add an
ar attribute to the
<model-viewer> tag. Other attributes allow you to customize the WebXR AR
experience, as shown in the WebXR sample on
modelviewer.dev. The code sample
below shows what this might look like.
alt="A 3D model of an office chair.">
It looks something like the embedded video shown under this heading.
<model-viewer> now gives full control over the view's virtual camera (the
perspective of the viewer). This includes the camera target, orbit (position
relative to the model), and field of view. You can also enable auto-rotation and
set limits on user interaction (e.g. maximum and minimum fields of view).
You can also annotate your models using HTML and CSS. This capability is often used to "attach" labels to parts of the model in a way that moves with the model as it's manipulated. The annotations are customizable, including their appearance and the extent to which they're hidden by the model. Annotations also work in AR.
border: 3px solid blue;
transform: translate(10px, 10px);
<model-viewer src="https://modelviewer.dev/assets/ShopifyModels/ToyTrain.glb" alt="A 3D model of a Toy Train" camera-controls>
<button slot="hotspot-hand" data-position="-0.023 0.0594 0.0714" data-normal="-0.3792 0.0004 0.9253">
See the annotations documentation page for more information.
Version 1.1 introduces and hosts a
tool, which enables you to
quickly preview your model, try out different
(e.g. exposure and shadow softness), generate a poster image, and interactively
get coordinates for annotations.
Rendering and performance improvements
Rendering fidelity is greatly improved, especially for high dynamic range (HDR)
<model-viewer> now also uses a direct render path when only one
<model-viewer> element is in the viewport, which increases performance
(especially on Firefox). Lastly, dynamically scaling the render resolution
improved frame rate dramatically. The example below shows off some of these
alt="A 3D model of a well-worn helmet"
<model-viewer> reaching its first major version, API stability is a
priority, so breaking changes will be avoided until version 2.0 is released.
<model-viewer> version 1.0 includes the most-requested capabilities, but the
team is not done yet. More features will be added, as will improvements in
performance, stability, documentation, and tooling. If you have suggestions,
file an issue in Github; also,
PRs are always welcome. You can stay connected by following
Twitter and checking out the community chat