Improved Postprocessing performance and stability - Live Example
Fix: Issue where Tonemapping would not be applied
Change: Improve <needle-engine background-image="<url>" /> support and deprecate the old skybox-image attribute
Unity Integration
Add: ShaderGraph MaterialX export: To use select your Shader and choose MaterialX in the Shader Export Type Dropdown.
Then install the MaterialX package by running npm i @needle-tools/materialx or add the MaterialX Npmdef asset that ships with Needle Engine to your Dependencies array in the Needle Engine component.
Add: loading-blur attribute to <needle-engine> web component. With this attribute the 3D scene will be blurred using CSS during loading of initial LOD level.
This feature can be used to hide initial low-resolution textures and meshes while already getting an interactive preview visible in the browser (e.g. when displaying high quality product models where the 3D model download should be fast and not block the website but low-res assets should never be visible to the user)
Currently loading-blur is disabled by default but can simply be enabled:
Or to control the blur amount a pixel value can be passed in <needle-engine loading-blur="30px">
Add: You can now await LOD loading at any time by calling context.lodsManager.manager?.awaitLoading(). The method accepts an optional options argument and returns a promise that will resolve when all requested LOD level during the next frame have completed loading. Please review the jsdoc code documentation for details.
Add: The physics.raycast options now accept an optional argument (allowSlowRaycastFallback) which controls wether or not the traditional three.js raycast method is allowed. If this parameter is set to false then only objects with a finished bvh mesh will be used for raycasting to ensure raycasts are always fast and never fallback to the slow route. This is especially important for relative frequent raycasts like mouse-movements or camera-target updates where itβs not crucial if objects are ignored for a few frames. Needle Engine does automatically calculate mesh BVHs for all meshes in the scene on a worker at the first time theyβre discovered to ensure optimal performance.
Add: OrbitControls methods for pan(<delta-x>, <delta-y>), zoomIn(<scale>) and rotateLeft<angleInRadians>. These methods can be used to control camera movement from code or via custom key-bindings.
Update gltf-progressive which adds support awaiting LOD level + improved LOD level calculations where meshes have multiple primitives/submeshes.
Fix: useKeys in OrbitControls - it requires tabindex on the <needle-engine> web component to receive keyboard events
Fix: Clamp of tonemapping exposure in AgX
Fix: Issue in Vite plugin with logging of very large objects
Add: OrbitControls support for setting targetElement (e.g. orbitControls.targetElement = myNewHtmlElement;)
Fix: RemoteSkybox loading relative URIs like βfolder/image.exrβ, catch errors in loadAsync
Update gltf-progressive dependency with improved performance when using skinned meshes and a concurrent LOD request limit (default: 100 concurrent requests)
Unity Integration
Fix: MaterialX export NullReferenceException when opacity is unconnected
Add: Gizmos.DrawWireBox now takes an optional rotation parameter
Add: Physics boxOverlap function
Fix: Vite plugin improvements
Fix: Issue where re-applying Postprocessing effects with custom devicePixelRatio did falsely reset devicePixelRatio
Update @needle-tools/gltf-progressive to version 3.2.0 with experimental javascript worker support. It can currently only be enabled by adding the URL query parameter ?gltf-progressive-worker
Unity Integration
Add: MaterialX export of multiple MaterialX documents if needed
Add: MaterialX placeholder material when importing and displaying .mtlx files
Add: New Build window (File/Needle Engine/Build Window)
Change: Clamp devicePixelRatio to 2 by default. This can be overriden by setting the Needle Engine Contextβs devicePixelRatio to e.g. window.devicePixelRatio
Update @needle-tools/gltf-progressive dependency to expose overrideLodLevel. This can be used to override which LOD level will be loaded instead of calculating the LOD level based on screen coverage:
For example context.lodsManager.manager!.overrideLodLevel = 0; will always load the highest quality mesh + texture
Unity Integration
Improve NeedleCloudAsset component caching and instantiation when using the same asset multiple times in the scene.
Improve MaterialX importer when importing a package with .mtlx files that reference textures in the same package
Update build pipeline dependency with new default draco compression settings
Update @needle-tools/gltf-progressive dependency which adds a waitForFirstCapture bool option to awaitLoading(<opts>). With this you can call manager.awaitLoading({waitForFirstCapture:true}) to get a promise that does not resolve until the next requested LOD levels have finished to load. Here is an example deployed to Needle Cloud + here is a example on Stackblitz which makes use of this feature to add a custom loading overlay.
Fix: When using Needle Engine in Gemini Editor the webrtc dependency caused issues due to Gemini making getUserMedia read-only. Example React Shopping App built by Gemini with Needle Engine (Code on Stackblitz)
Fix: When using pre-bundled Needle Engine (e.g. from jsdelivr) the mesh-bvh worker path was not correctly resolved
Change: <needle-engine> CSS z-index setting where the <needle-menu> element would be rendered above elements outside the <needle-engine> component. This would cause issues where e.g. a sidebar should overlay the page.
Change: Reduce default z-index for Needle loading logo
Add: Much faster loading for skyboxes and environment maps when using presets. E.g. <needle-engine environment-image="studio"></needle-engine>. Supported values are studio, blurred-skybox, quicklook, quicklook-ar
Change: TransformControls now also enable fastMode on the SyncedTransform component
Change: The mobile javascript console now needs to be explictly enabled using the ?console flag. This change has been made to improve the local development experience. Previously the javascript console would be initialized in local development environments but stay invisible until e.g. an error would be detected. This did sometimes cause performance issues when very large objects would be logged in development
Add: Improved FastHDR support.
The internal loadPMREM(<url>) function is now exposed as well and can be used to load EXR, HDRI or KTX2 (FastHDR) textures. This function is already used internally when assigning the background-image or environment-image attribute on <needle-engine>.
Unity Integration
Fix: MaterialX shader properties should not be renamed for animation. Updated UnityGLTF dependency to 2.17.9 to mark materials as custom shader export
Fix: MaterialX shader export fixes (missing set outputname when injecting extra nodes, fixed wrong βseparateβ output type used in Input, fixed input type conversion)
Fix: iOS AR image tracking bug where having multiple WebXRImageTracking components in the scene cause unexpected behaviour or invalid USDZ files
Fix: DropListener loadFromURL now returns the promise to make awaiting the loaded asset much easier
Fix: Issue where <needle-engine autoplay> would play animations faster than expected
Change: OrbitControls with locked target constraint is now updating the constraint position when calling e.g. setTargetPosition
Add: setCameraFocusRect method on Needle Context for easier responsive layouting.
With this you can e.g. overlay the webgl scene with HTML elements and pass in a div element for keeping important elements visible. Example 1 Website | Code on Stackblitz Example 2 Website | Code on Stackblitz
Unity Integration
Improve Needle Component inspectors
Change: Improve WebXRImageTracking gizmo rendering to make it easier to align content on images in the editor
Add: OrbitControls fitCamera has now additional options for fitDirection, cameraOffset, relativeCameraOffset, targetOffset and relativeTargetOffset giving more fine-grained control over the final camera view where necessary (Stackblitz).
Add: ContactShadows properties to fitShadows and static ContactShadows.auto() for more fine-grained control over which objects to fit the shadow to or to apply slight offsets to the shadow plane
Add: NestedGltf component loaded event property
Fix: OrbitControls should not override the camera FOV
Fix: Updating the scene.background when setting both background-color and background-image or switching between one or the other
Fix: When setting <needle-engine environment-image="url"> the assigned image should be respected by the engine and loaded glTF files (even if they bring their own skybox and environment images)
Fix: Issue with <needle-engine autoplay> animation speed and when using the AnimationUtils.autoplay feature where animations would play faster than expected
Fix: Minor fixes in Vite plugins
Change: ReflectionProbes are not applied on Objects that use lightmapping
NEW: Scrollytelling Example Project files will be added to the next samples package release
NEW: Spline support with SplineContainer and SplineWalker components
SplineContainer: Holds the spline data. Use addKnot and removeKnot to modify the spline and getPointAt(t01:number) to get a point on the spline curve. Splines currently only support cubic interpolation.
SplineWalker: Component for moving objects along a spline. It can automatically move along the spline or be controlled by animations or other components by setting the position01 property.
NEW: Attractor component β Add Rigidbodies to the list to attract physical objects towards a point in space (or apply repulsion).
NEW: CursorFollow component β Does what it says! Add the component to an object to make it follow your cursor (or touch) on screen.
NEW: ScrollFollow component β Use browser scroll to influence animation, audio, lightβ¦ in your scene.
Add: WebXRImageTracking methods for setPrimaryImage and addImage to simplify image tracking changes at runtime.
Add: Object3D worldForward can now be set (e.g. myObject.worldForward = new Vector3(0,0,1))
Fix: [XR] Issue where NeedleXRSession would invoke controller-added callback twice
Fix: [XR] Issue where invalid value in XRControllerMovement would break rendering when using hand tracking
Fix: [XR] NeedleXRController getButton for xr-standard-trigger and getStick(βprimaryβ)
Fix: Capsule collider height
Fix: Issue where disposing object resources would cause errors in three.js
Unity Integration
Add: Spline export support
Fix: Automatically add compression settings when exporting a sample scene where the settings are not present
NEW: HoverAnimation component. Use this component to get a scale hover animation of an object when the cursor is hovering over the object or one of itβs children.
Add: fitCamera function
Add: <needle-engine poster> attribute. It works with an URL to an image that should be shown as a poster image. If no URL is assigned then the poster that is automatically generated during the first frame will be used
Fix: Renderer material accessing error when component was not yet initialized
Fix: Poster screenshot glitch during the first frame (development only)
Change: Loading display does not show Needle logo anymore by default
Change: Use fallback raycast method for lowpoly meshes while BVH is being generated
Unity Integration
Add: ScrollMarker that can be used to control scroll-based animations
Add: Support for exporting custom timeline marker
Fix: Camera inspector error when no skybox was assigned in the scene
Fix: Minor Unity inspector improvements
Update: Needle Optimization Pipeline to use new (mesh) attribute aware simplification for even better LOD meshes
NEW: HoverAnimation component. Use this component to get a scale hover animation of an object when the cursor is hovering over the object or one of itβs children.
NEW: ViewBox component. Use this component to automatically perfectly fit your 3D scene into the camera view. Try the Scrollytelling Example to see it in action, test the example on Stackblitz or see the ViewBox documentation for details.
Add: fitCamera function
Add: <needle-engine poster> attribute. It works with an URL to an image that should be shown as a poster image. If no URL is assigned then the poster that is automatically generated during the first frame will be used.
Add: <needle-engine focus-rect="<html_selector"> attribute. Assign a HTML selector to the attribute to use a specific HTML element on screen offset the 3D camera center to the center of the HTML element. (The same can be done programmatically using ctx.setCameraFocusRect(<html_element|DOMRect>))
Add: Timeline ScrollMarker for Unity and Blender timeline animations to control timing based on HTML visibility.
Fix: Renderer material accessing error when component was not yet initialized
Fix: Poster screenshot glitch during the first frame (development only)
Fix: HTC Vive Focus 3 controller movement (forum post)
Change: Loading display does not show Needle logo anymore by default
Change: Use fallback raycast method for lowpoly meshes while the faster mesh BVH is being generated
Unity Integration
Add: ScrollMarker that can be used to control scroll-based animations. Add ScrollMarker to the Marker Track in the Unity Timeline and annotate HTML elements with data-timeline-marker in your HTML to mark when the timeline position should be reached.
Add: Support for exporting custom timeline marker
Fix: Camera inspector error when no skybox was assigned in the scene
Fix: Minor Unity inspector improvements
Update: Needle Optimization Pipeline to use new and improved (mesh) attribute aware simplification for improved LOD mesh generation