Releases: sunquakes/react-three-lite
Releases · sunquakes/react-three-lite
Release list
Release 0.5.0
[0.5.0] - 2026-08-27
This release migrates the library from a WebGL-only implementation to a dual-renderer architecture built on Three.js TSL, with WebGPURenderer as the new default.
Breaking Changes
- Default to
WebGPURendererfromthree/webgpuinstead ofTHREE.WebGLRenderer. SetrendererType="webgl"on<Scene>to keep the previous backend. Renderer creation is now asynchronous, becauseWebGPURendererrequiresawait renderer.init()before its first frame. - Rewrite every shader with TSL (
three/tsl) andNodeMaterial, replacing the previousShaderMaterialand raw GLSL implementations. Shader code passed into Rain, Snow, SweepLight, WaveCircleMesh or FlowLineMesh from outside the library no longer applies. - Replace
WebGLRendererwith theR3LRenderertype across the public surface, including therendererprop of<Scene>, therenderervalue on the scene context, and therendererargument of theonFrame/onBeforeFrame/onAfterFramecallbacks.R3LRenderercovers both backends. - Change the default light from a single
AmbientLightto aTHREE.Groupholding anAmbientLightplus aDirectionalLight, required for PBR materials to show surface detail. Thelightprop andsceneComponents.lightare therefore typed asTHREE.Object3Drather thanTHREE.Light.LightGradientaccepts both a single light and a group. - Publish ESM only: drop the UMD build and the
requireentry fromexports. three has not shipped a UMD bundle since r160, so theTHREEglobal the UMD output depended on never existed at runtime. - Raise the
threepeer dependency from>=0.172.0to>=0.180.0, matching the WebGPU renderer and TSL APIs actually used by the library.
Added
- Add a
rendererTypeprop to<Scene>, accepting'webgpu'(default) or'webgl'. The WebGL path attaches three's officialWebGLNodesHandlerso TSL shaders compile to GLSL and run on a genuine WebGL context. - Export the
RendererTypeandR3LRenderertypes. - Expose the active renderer as
scene.userData.renderer, so custom meshes added to a scene can detect the backend at runtime and adapt to rendering differences. - Add a default PBR environment: the scene now generates an IBL environment map through
PMREMGeneratorsoMeshStandardMaterialandMeshPhysicalMaterialare lit without an explicit skybox. - Add material normalization to the model loaders: tag base color and emissive textures as sRGB, clamp fully mirror-like metal/roughness combinations, and upgrade legacy
MeshLambertMaterial/MeshPhongMaterialtoMeshStandardMaterialso they receive environment lighting. - Add normal smoothing for loaded models: re-weld shared vertices and recompute vertex normals for geometry that arrives with faceted or missing normals, so curved surfaces such as cylinders render smoothly.
- Add
disposeModel()anddisposeDRACOLoader()helpers to release model GPU resources and terminate the shared DRACO worker pool. - Add
SkyBox.dispose()to release the skybox cube render target. - Add dual-renderer WebGPU / WebGL tabs to every example in the English and Chinese documentation.
- Add FBX debugging scripts for inspecting raw nodes, materials and textures.
- Add the first unit test suite, covering resource disposal, the WebGPU and WebGL color correction paths, Movable and ModelRotator timing math, Animation clip handling and UUID generation.
- Add a public API surface guard test that fails whenever an export is added, removed or renamed, so the API cannot drift silently before it is frozen at 1.0.0.
- Add a
testscript for single-run test execution in CI, and atypecheckscript for standalone type checking.
Changed
- Import Three.js from
three/webgpuwhere class identity matters.threeandthree/webgpuare separate builds with distinct class identities, so lights constructed fromthreewere never matched byLightsNode.setupNodeLightsand silently had no effect on rendering. - Rebuild the Rain and Snow particle systems on indexed quad geometry with clip-space billboarding, replacing
Pointsandgl_PointSize, which has no TSL equivalent that behaves identically on both backends. - Apply WebGPU color pre-correction in Rain, Snow, SweepLight, WaveCircleMesh and FlowLineMesh. Custom TSL materials pass through a linear-to-sRGB conversion on the WebGPU output that WebGL does not perform, so colors are corrected up front to keep both backends visually identical.
- Render bloom through
RenderPipelineand the TSLbloom()node on WebGPU, while keepingEffectComposerwithUnrealBloomPasson WebGL. - Tune the default lighting for PBR: add a
HemisphereLightfor sky and ground bounce, and keep the ambient intensity low so PBR surfaces are not blown out now that an environment map also contributes light. - Load model textures through a dedicated
LoadingManagerand resolve the loader promise only once every texture request has settled.TextureLoader.load()insideMTLLoaderandFBXLoaderis fire-and-forget, so inspecting textures right after parsing revealed nothing about their state. - Deduplicate the identical cleanup logic in the GLTF, FBX and OBJ loader components into the shared
disposeModel()helper. - Exclude test files from the generated type declarations so they never reach the published package.
- Declare
pnpmas the package manager and correct therepositoryURL format inpackage.json.
Fixed
- Fix CSS2D labels rendering vertically mirrored on WebGPU.
WebGPURendererflips the clip-space Y axis, which invalidates the WebGL-based element placement formula in the upstreamCSS2DRenderer, so label positions are now recomputed for the WebGPU coordinate system. - Fix models rendering untextured on WebGPU. The backend binds a placeholder for textures whose image has not decoded yet and then skips further uploads while the version is unchanged, so texture versions are now bumped once the images arrive.
- Fix texture flicker on the first rendered frame after a model finishes loading.
- Fix FBX models appearing too dark by using white as the base color when a material carries a texture.
- Fix OBJ models rendering as a black screen by waiting for all textures before resolving, matching the FBX loader, and fix the OBJ loader mixing geometry with wireframe output.
- Fix
PMREMGeneratorselection: the node-based generator inthree/webgpurequiresrenderer.hasInitialized(), which onlyWebGPURendererprovides, so the legacy generator fromthreeis used on WebGL. - Fix bloom failing to render when the container has a zero size during initial layout, by observing container resizes and updating the post-processing composer.
- Fix the camera aspect ratio becoming
InfinityorNaNfor a scene mounted inside a zero-size container, such as a hidden tab. - Fix visible gaps and dark seams in the FlowLineMesh arrow texture by disabling mipmaps, switching to nearest filtering and blending two samples across the UV wrap seam.
- Externalize three subpath imports (
three/webgpu,three/tsl,three/addons/*,three/examples/jsm/*) andthree-stdlib. They were previously bundled, shipping a second copy of three and breaking class identity checks such asLightsNodefailing to recognize light instances. - Dispose material textures when unloading models. Only geometries and materials were released before, leaking the dominant share of a model's VRAM.
- Fix the arrow texture leak in FlowLineMesh.
- Remove the
'added'event listener and detach from the parent inWaveCircleMesh.dispose()andFlowLineMesh.dispose(). - Fix the skybox rendering black on WebGPU by tagging the cube texture as
SRGBColorSpace. - Fix
release:patch/release:minor/release:major, which always failed because the version argument was validated against a strict semver pattern that rejected the bump keywords. - Declare Node globals for
scripts/and config files in the ESLint config, fixing 45 spuriousno-undeferrors that leftpnpm lintpermanently failing.
Release 0.4.0
[0.4.0] - 2026-08-11
Added
- Add Callout annotation component with leader line (straight/broken shapes), anchor dot, React-rendered label, and
autoAnchormode that slides the connection point along the label's bottom edge based on camera direction. - Add ModelRotator utility class for automatic model rotation with configurable speed, axis, and easing.
- Add LightGradient effect class for dynamic lighting gradient animation with
dispose()method. - Add Callout documentation with examples in English and Chinese.
- Add ModelRotator documentation with examples in English and Chinese.
- Add LightGradient documentation with examples in English and Chinese.
- Add Three.js namespace import convention guidelines to AGENTS.md.
- Add unified demo scene background color standard (
#1a1a2e) to AGENTS.md.
Changed
- Unify Three.js import convention to namespace import (
import AGENTS.md CHANGELOG.md LICENSE README.md README_ZH.md dist docs env.d.ts eslint.config.js index.html node_modules package.json pnpm-lock.yaml pnpm-workspace.yaml react-three-lite.zip release_body.md scripts src tsconfig.json tsconfig.node.json vite.config.ts vitest.config.ts as THREE from 'three') across all source files. - Migrate ESLint configuration from
.eslintrc.cjsto flat configeslint.config.js. - Unify all documentation example scene background colors to
#1a1a2e. - Refactor documentation component naming: remove
Componentsuffix, unify toAppnaming format. - Refactor mesh resource cleanup logic with stricter type-safe handling.
- Update dependency versions (@types/react, @types/three, eslint, etc.).
Fixed
- Fix mesh material attribute cleanup and dispose calls with proper type assertions.
Release 0.3.0
[0.3.0] - 2026-06-06
Added
- Add SweepLight effect component for model sweep light animation.
- Add sweep light configuration options (color, speed, width, intensity, direction, loop).
- Add sweep light methods (play, pause, stop, dispose).
- Add sweep light documentation with examples in English and Chinese.
Changed
- Update SweepLight document examples and configuration items.
- Fix the usage example code of SweepLight in the documentation.
- Add
idfield to English documentation frontmatter for Docusaurus compatibility. - Update Scene container style in documentation examples with consistent dimensions.
- Refactor Methods section in documentation to use table format.
Release 0.2.0
[0.2.0] - 2026-05-30
Added
- Add Rain Drop effect component with configurable parameters (count, speed, color).
- Add Snowflake Particle effect component with customizable settings.
- Add Draco compression model loading support via DRACOLoader integration.
- Add
useDracoanddracoDecoderPathprops for GLTF/FBX/OBJ loaders.
Changed
- Improve resource cleanup logic for rain, snow, loaders, and Bloom components.
- Refactor
addBeforeFrame/addAfterFrameto return deregistration functions. - Fix frame callback leakage issues and memory release process.
- Update documentation site configuration with SEO optimization and last update time display.
- Optimize CI workflow to inject version number from package.json into documentation.
- Update document URLs, badges, and dynamic version fetch logic.
- Flatten zh-CN docs directory structure to match Docusaurus conventions.
- Improve Chinese translations for flow-line, popup, and scene documentation.
- Add
gridHelperprop documentation for Scene component. - Adjust raindrop vertex shader parameters and default colors.
- Optimize scene background color and particle default parameters.
Fixed
- Fix window resize dimension retrieval logic.
- Fix Scene component and utility class resource destruction for complete memory release.
Release 0.1.0
[0.1.0] - 2026-05-30
Added
- Add Scene component for 3D scene rendering.
- Add SkyBox component for skybox background.
- Add GLTFLoader component and function for loading GLTF models.
- Add FBXLoader component and function for loading FBX models.
- Add OBJLoader component and function for loading OBJ models.
- Add Popup component for interactive popup dialogs.
- Add MovableElement component for draggable elements.
- Add Animation component for model animation playback.
- Add WaveCircleMesh class for wave circle mesh visualization.
- Add FlowLineMesh class for animated flow line visualization.
- Add Bloom effect component for glow post-processing.
- Add grid helper and axes helper support.
- Add background color and background image support.
- Add comprehensive documentation with Chinese and English translations.