Repository navigation
Aura3D 4.0.4
Pre-release
Pre-release
Superseded. This version is deprecated. Upgrade to Aura3D 4.7.10.
three.js parity: the engine surface that Crayon-style three.js ports need, behind the curated @aura3d/engine API. Every item below has a unit test; GPU behaviour was verified on a remote WebGL2 runner unless noted. Tracked in docs/workflows/threejs-parity-gaps.md.
Shading and materials
material.custom({ glsl, wgsl?, uniforms, defines, transparent, depthWrite, side, blending, fog, patch? })compiles GLSL (required) and optional WGSL into aPortableShaderMaterial;handle.setUniform(name, value)updates without recompiling.registerShaderChunk(name, glsl, wgsl?)adds#includechunks.PortableShaderMaterial,ShaderPreprocessorandregisterShaderChunkare exported from@aura3d/engine/renderer.effects.shaderPass({ glsl, wgsl?, uniforms, order })adds a custom post pass with named slots (before-bloom,after-bloom,before-tonemap,after-tonemap) or a numeric order. On WebGL2,after-bloomandbefore-tonemappasses now run after the bloom composite, matching WebGPU (they previously ran before bloom).- Per-material
fog: falseopt-out, Cineon tone mapping,createRenderTarget(render a scene into a target and sample it as a material map). scene().overrideMaterial(spec | null)replaces every mesh material in the scene without mutating authored nodes.lights.lensFlare(...),lights.rectAreaandlights.lightProbe(SH9). Lens flare placement follows three; unlike three it does not fade by depth occlusion because the engine has no depth readback.
Geometry, instancing, lines
- Primitives:
cone,circle,ring,tube,lathe,extrude,shape,torusKnot,polyhedron,roundedBox, with vertex and index counts checked against three 0.185.1. - Geometry authoring:
geometry.dynamic(typed arrays, colours, groups, draw range, per-frame in-placeupdateAttribute/setGeometry), custom per-vertexattributesreadable frommaterial.customshaders,topology: "points",geometry.edges,geometry.wireframe,geometry.merge,geometry.toNonIndexed,geometry.convex. instances.meshandbatched.meshwrite the GPU instance buffer directly; multi-draw is used only when the device really supportsWEBGL_multi_draw, and the report says so when it does not.lines.*(thin, fat, dashed),points,sprites,helpers.*.A3D_PARITY_BATCHINGandA3D_PARITY_LINESare now default-on. They gate only the newbatched,line,pointsandspritenode kinds, so no existing scene is affected. The other fourA3D_PARITY_*flags gate nothing and staydev.
Textures, loaders, math, animation, audio
texture.data/canvas/video/compressed/depth/cube/dataArray/loadwith full handle semantics (wrapS/T,repeat,offset,rotation,anisotropy, filters,flipY,needsUpdate); WebGPU honours revisions and uploads every array layer. EXR decoder (none, RLE, ZIPS, ZIP, PIZ; half and float),FileLoader,ImageBitmapLoader,DataTextureLoader, asset progress and error callbacks.@aura3d/math: full curve family with cached arc length and Frenet frames,Path/Shape,ShapeUtils,Line3,Triangle,Spherical,Cylindrical, all sixEulerorders,MathUtils, HSL colour methods,SphericalHarmonics3,OBB,Capsule,ConvexHull,Octree; values are tested against three over seeded cases.- Animation:
clampWhenFinished, negativetimeScale,finishedevents,PropertyBinding,AnimationUtils,AnimationObjectGroup, colour tracks,morphTargetDictionary,cloneSkinnedwith shared textures. - Audio: fixed double distance attenuation on positional emitters,
distanceModel, cone and orientation,AudioListenernow drivesctx.listener,AudioAnalyser. - Runtime:
Clock,raycastoptions,app.info,app.precompile,setPixelRatio,setClearColor, texture/cube backgrounds, nodelayers/renderOrder/traverse,cameras.cube,surfaces.mirror.
New in this release, with limits
cameras.arrayandcameras.stereo(three's ArrayCamera and StereoCamera) with viewport and scissor on the render device; stereo eye matrices are tested against three.xr.button()andapp.xr(WebXR enter/exit, per-view rendering into the XR layer). Tested with fake XR objects only; not yet verified on a headset or browser.compute.*(WebGPU-only compute: pipelines, buffers, dispatch). Tested against a fake GPU device only; WebGL2 apps get a clearcompute-requires-webgpuerror.- WebGPU canvas presentation is unverified on the remote runner (software WebGPU destroys the device at the first presented frame); WebGPU material and post paths are verified through offscreen readback.
Behaviour changes
primitives.box/sphere/plane/cylinder/capsule/torusnow throwinvalid-primitive-paramsfor params they do not use (previously ignored silently); size them withsize.material.customrejects uniform names that lower into a reserved built-in (for exampletimebecomesu_time) at authoring time instead of failing at GLSL compile.- Shader compile errors now include the first lines of the GLSL info log in the message.
- Camera layer masks (
camera.perspective({ layers })) now hide non-intersecting nodes; a cube-camera reflection is no longer scaled to nothing by a zero scene environment intensity; static batching keeps an item's cube binding. - Camera
Splinenow uses@aura3d/mathcurves (open-spline arc length is within 2% per sixth).
Tooling
aura3d migrate threegains rows for the new surface and a scanner fix for multi-line constructs; a test now fails if any mapping target is not exported.- Crayon probe v2 (live scene capture from the sandboxed game frame), the deterministic capture tool, and a Strange Orbit reference and port example under
examples/strange-orbit-port/.