v2.0.0
We have been carefully following semantic versioning rules to avoid breaking changes for our diverse user base, but this has caused parts of our API to become less beginner-friendly as our newer best-practices have not become defaults. The time has come to reset with a v2.0 release!
The API simplifications have also allowed us to clean up our code base, easing maintenance and reducing the likelihood of future bugs.
To be clear, we still want to make updating to v2.0 easy for our users, so we're changing features that are little-used or will improve the experience on most sites. The changes to defaults can be overridden by specifying attribute values. Regeneration of poster images is strongly recommended. See discussion in #3460.
✋Breaking Changes
Updated Defaults
- Minimum radius is doubled to match the
enable-pandefault, with default field-of-view narrowed to 30 degrees (12 degree default minimum). This gives the default framing a "longer lens" with reduced perspective warp: #3668 - Default
enable-panto true, replacing theenable-panattribute withdisable-pan. Also addeddisable-tapattribute: #3713 - Switch
touch-actiondefault frompan-ytonone: #3712 - Switch default
environment-imagetoneutral, renaming the current default aslegacy: #3676 - Enable USDZ autogeneration by default, by switching the
ar-modesdefault towebxr scene-viewer quick-look: #3802
API Simplification
- Remove the 'bounds' attribute, making the behavior equivalent to
bounds="tight": #3683 - Remove the deprecated
scene-graph-readyevent: #3700 - Remove the
progress-mask; equivalent to setting its part todisplay: none;. This will keep the poster from appearing lightened during loading: #3692 - Remove the "interaction" option from the
revealattribute. Use "manual" anddismissPoster()instead to achieve this behavior: #3688 - Remove the
interaction-policyattribute, allowing only the default "always-allow" behavior: #3686 - Remove the "when-focused" option from the
interaction-promptattribute: #3687 - Remove the
interaction-prompt-styleattribute, allowing only the default "wiggle" behavior: #3685 - Remove
--poster-color, making the poster always have a transparent background: #3701 - Remove the
seamless-posterattribute, making the behavior as though this option is always enabled. Note this in combination with the previous bullet means there is no longer a transition fade between poster and model, so seamless posters as generated bytoBlob({idealAspect: true})or our editor are strongly recommended: #3704 - Remove the
Image.setURImethod from our materials API. Use thecreateTexturemethod instead: #3710 - Update
exportSceneoptions to match three.js r143. Specifically, removeembedImages(always true now) andforcePowerOfTwoTextures. AddforceIndices: #3711 - Remove
preloadevent, as there is no longer any distinction from theloadevent: #3799
TypeScript Updates
- Switch our
package.jsonmoduleto point tolibinstead ofdist. For JS users,mainwill still point to our bundle indist, but this change will send TS users to our lib so they can build and tree-shake it themselves, which is best practice. Also, our lib already contains all our*.d.tsfiles: #3718 - Add
typespointers topackage.jsonas well as a fallbackmodel-viewer.d.tsbundled types file, thanks @subhankar-trisetra! #3774, #3791
Features
🆕 Added External Renderer API to drive e.g. cloud-based or path-tracing renderers: #3482
🆕 Added Material API documentation: #3493
🆕 Added keyboard controls for pan, thanks @clochardM33! #3702
🆕 Added inputSensitivity property: #3719
🆕 Added getBoundingBoxCenter: #3734
Bugfixes
- Move the Exit AR button to the safe zone, thanks @yuta-hayashi! #3464
- Fix fractional pixel sizes causing some blurring, thanks @bcairns! #3555
- Fix
positionAndNormalFromPoint()hitting the floor plane: #3599 - Fix skybox shown in AR when switching
src: #3606 - Fix docs page build failure, thanks @demarijm! #3696
- Ensure the 'load' event fires after the pixels are properly rendered: #3702
- Make JS camera changes cancel interaction prompts and add "automatic" to
camera-changeevent: #3717 - Improve WebXR wall-placement UX: #3736
- Fix
errorevent detail: #3742 - Fix
revealchanges causing rendering breakage: #3745 - Ensure dynamic render scaling always returns to full-res when the model stops moving: #3752
- Ensure
exportSceneis includingscale/orientationchanges: #3772 - Fix iOS AR feature detection for WebViews and iOS16, thanks @milesgreen! #3784
- Fix bounds calculation for quantized models: #3768
Other notable changes
- Updated to Three.js r144
- Dynamic render scaling is now less aggressive, targeting 15-20 fps before down-sampling
- Various loading performance improvements