From 44bee29b9065453a17c705930a76ee9b7efd627e Mon Sep 17 00:00:00 2001 From: mrdoob Date: Wed, 24 Jun 2026 20:28:07 +0800 Subject: [PATCH 01/10] FirstPersonControls: Damping, separate move sources, release fix, E/Q keys. (#33874) Co-authored-by: Claude Opus 4.8 (1M context) --- examples/jsm/controls/FirstPersonControls.js | 121 ++++++++++++------- 1 file changed, 79 insertions(+), 42 deletions(-) diff --git a/examples/jsm/controls/FirstPersonControls.js b/examples/jsm/controls/FirstPersonControls.js index d2bf4c3cac5af7..738a58a6a2aa17 100644 --- a/examples/jsm/controls/FirstPersonControls.js +++ b/examples/jsm/controls/FirstPersonControls.js @@ -9,6 +9,7 @@ const _lookDirection = new Vector3(); const _spherical = new Spherical(); const _target = new Vector3(); const _targetPosition = new Vector3(); +const _targetVelocity = new Vector3(); /** * This class is an alternative implementation of {@link FlyControls}. @@ -44,6 +45,15 @@ class FirstPersonControls extends Controls { */ this.lookSpeed = 0.005; + /** + * How quickly the movement and look velocity catches up to the input. Lower + * values feel heavier (more inertia), `1` disables damping. + * + * @type {number} + * @default 0.1 + */ + this.dampingFactor = 0.1; + /** * Whether it's possible to vertically look around or not. * @@ -128,7 +138,7 @@ class FirstPersonControls extends Controls { // internals - this._autoSpeedFactor = 0.0; + this._velocity = new Vector3(); this._pointerX = 0; this._pointerY = 0; @@ -138,14 +148,23 @@ class FirstPersonControls extends Controls { this._pointerCount = 0; - this._moveForward = false; - this._moveBackward = false; + // forward / backward come from keys and the pointer, tracked per source so they don't + // clobber: while a forward / backward key is held, a click only looks + this._keyForward = false; + this._keyBackward = false; + this._pointerForward = false; + this._pointerBackward = false; this._moveLeft = false; this._moveRight = false; + this._moveUp = false; + this._moveDown = false; this._lat = 0; this._lon = 0; + this._lonVelocity = 0; + this._latVelocity = 0; + // event listeners this._onPointerMove = onPointerMove.bind( this ); @@ -174,11 +193,15 @@ class FirstPersonControls extends Controls { window.addEventListener( 'keydown', this._onKeyDown ); window.addEventListener( 'keyup', this._onKeyUp ); - this.domElement.addEventListener( 'pointermove', this._onPointerMove ); this.domElement.addEventListener( 'pointerdown', this._onPointerDown ); - this.domElement.addEventListener( 'pointerup', this._onPointerUp ); this.domElement.addEventListener( 'contextmenu', this._onContextMenu ); + const { ownerDocument } = this.domElement; + + ownerDocument.addEventListener( 'pointermove', this._onPointerMove ); + ownerDocument.addEventListener( 'pointerup', this._onPointerUp ); + ownerDocument.addEventListener( 'pointercancel', this._onPointerUp ); + this.domElement.style.touchAction = 'none'; // Disable touch scroll } @@ -188,11 +211,15 @@ class FirstPersonControls extends Controls { window.removeEventListener( 'keydown', this._onKeyDown ); window.removeEventListener( 'keyup', this._onKeyUp ); - this.domElement.removeEventListener( 'pointermove', this._onPointerMove ); this.domElement.removeEventListener( 'pointerdown', this._onPointerDown ); - this.domElement.removeEventListener( 'pointerup', this._onPointerUp ); this.domElement.removeEventListener( 'contextmenu', this._onContextMenu ); + const { ownerDocument } = this.domElement; + + ownerDocument.removeEventListener( 'pointermove', this._onPointerMove ); + ownerDocument.removeEventListener( 'pointerup', this._onPointerUp ); + ownerDocument.removeEventListener( 'pointercancel', this._onPointerUp ); + this.domElement.style.touchAction = ''; // Restore touch scroll } @@ -235,31 +262,35 @@ class FirstPersonControls extends Controls { if ( this.enabled === false ) return; - if ( this.heightSpeed ) { + const moveForward = this._keyForward || this._pointerForward; + const moveBackward = this._keyBackward || this._pointerBackward; - const y = MathUtils.clamp( this.object.position.y, this.heightMin, this.heightMax ); - const heightDelta = y - this.heightMin; + const forward = moveForward || ( this.autoForward && ! moveBackward ); - this._autoSpeedFactor = delta * ( heightDelta * this.heightCoef ); + // target velocity in the object's local space - } else { + _targetVelocity.set( + ( this._moveRight ? 1 : 0 ) - ( this._moveLeft ? 1 : 0 ), + ( this._moveUp ? 1 : 0 ) - ( this._moveDown ? 1 : 0 ), + ( moveBackward ? 1 : 0 ) - ( forward ? 1 : 0 ) + ).multiplyScalar( this.movementSpeed ); - this._autoSpeedFactor = 0.0; + // faster forward movement the higher the camera is - } + if ( forward && this.heightSpeed ) { - const actualMoveSpeed = delta * this.movementSpeed; + const y = MathUtils.clamp( this.object.position.y, this.heightMin, this.heightMax ); + _targetVelocity.z -= ( y - this.heightMin ) * this.heightCoef; - if ( this._moveForward || ( this.autoForward && ! this._moveBackward ) ) this.object.translateZ( - ( actualMoveSpeed + this._autoSpeedFactor ) ); - if ( this._moveBackward ) this.object.translateZ( actualMoveSpeed ); + } - if ( this._moveLeft ) this.object.translateX( - actualMoveSpeed ); - if ( this._moveRight ) this.object.translateX( actualMoveSpeed ); + // ease toward the target velocity for smooth acceleration and deceleration - if ( this._moveUp ) this.object.translateY( actualMoveSpeed ); - if ( this._moveDown ) this.object.translateY( - actualMoveSpeed ); + this._velocity.lerp( _targetVelocity, this.dampingFactor ); - const actualLookSpeed = delta * this.lookSpeed; + this.object.translateX( this._velocity.x * delta ); + this.object.translateY( this._velocity.y * delta ); + this.object.translateZ( this._velocity.z * delta ); let verticalLookRatio = 1; @@ -269,12 +300,16 @@ class FirstPersonControls extends Controls { } - if ( this.mouseDragOn ) { + // target look velocity, zero when not dragging so the view eases to a stop - this._lon -= this._pointerX * actualLookSpeed; - if ( this.lookVertical ) this._lat -= this._pointerY * actualLookSpeed * verticalLookRatio; + const targetLon = this.mouseDragOn ? - this._pointerX * this.lookSpeed : 0; + const targetLat = ( this.mouseDragOn && this.lookVertical ) ? - this._pointerY * this.lookSpeed * verticalLookRatio : 0; - } + this._lonVelocity = MathUtils.lerp( this._lonVelocity, targetLon, this.dampingFactor ); + this._latVelocity = MathUtils.lerp( this._latVelocity, targetLat, this.dampingFactor ); + + this._lon += this._lonVelocity * delta; + this._lat += this._latVelocity * delta; this._lat = Math.max( - 85, Math.min( 85, this._lat ) ); @@ -332,15 +367,15 @@ function onPointerDown( event ) { if ( event.pointerType === 'touch' ) { - this._moveForward = this._pointerCount === 1; - this._moveBackward = this._pointerCount >= 2; + this._pointerForward = this._pointerCount === 1; + this._pointerBackward = this._pointerCount >= 2; } else { switch ( event.button ) { - case 0: this._moveForward = true; break; - case 2: this._moveBackward = true; break; + case 0: if ( ! this._keyForward && ! this._keyBackward ) this._pointerForward = true; break; + case 2: if ( ! this._keyForward && ! this._keyBackward ) this._pointerBackward = true; break; } @@ -358,21 +393,23 @@ function onPointerDown( event ) { function onPointerUp( event ) { + if ( this.mouseDragOn === false ) return; + this.domElement.releasePointerCapture( event.pointerId ); this._pointerCount --; if ( event.pointerType === 'touch' ) { - this._moveForward = this._pointerCount === 1; - this._moveBackward = false; + this._pointerForward = this._pointerCount === 1; + this._pointerBackward = false; } else { switch ( event.button ) { - case 0: this._moveForward = false; break; - case 2: this._moveBackward = false; break; + case 0: this._pointerForward = false; break; + case 2: this._pointerBackward = false; break; } @@ -399,19 +436,19 @@ function onKeyDown( event ) { switch ( event.code ) { case 'ArrowUp': - case 'KeyW': this._moveForward = true; break; + case 'KeyW': this._keyForward = true; break; case 'ArrowLeft': case 'KeyA': this._moveLeft = true; break; case 'ArrowDown': - case 'KeyS': this._moveBackward = true; break; + case 'KeyS': this._keyBackward = true; break; case 'ArrowRight': case 'KeyD': this._moveRight = true; break; - case 'KeyR': this._moveUp = true; break; - case 'KeyF': this._moveDown = true; break; + case 'KeyE': this._moveUp = true; break; + case 'KeyQ': this._moveDown = true; break; } @@ -422,19 +459,19 @@ function onKeyUp( event ) { switch ( event.code ) { case 'ArrowUp': - case 'KeyW': this._moveForward = false; break; + case 'KeyW': this._keyForward = false; break; case 'ArrowLeft': case 'KeyA': this._moveLeft = false; break; case 'ArrowDown': - case 'KeyS': this._moveBackward = false; break; + case 'KeyS': this._keyBackward = false; break; case 'ArrowRight': case 'KeyD': this._moveRight = false; break; - case 'KeyR': this._moveUp = false; break; - case 'KeyF': this._moveDown = false; break; + case 'KeyE': this._moveUp = false; break; + case 'KeyQ': this._moveDown = false; break; } From 4d45bb63042f70cad48f76d99acd587db5d0b062 Mon Sep 17 00:00:00 2001 From: mrdoob Date: Wed, 24 Jun 2026 21:16:04 +0800 Subject: [PATCH 02/10] Examples: Improve `webgpu_custom_fog_scattering`. (#33825) Co-authored-by: Claude Opus 4.8 (1M context) --- examples/jsm/generators/TreeGenerator.js | 377 ++++++++++++++++++ .../webgpu_custom_fog_scattering.jpg | Bin 15232 -> 20272 bytes examples/webgpu_custom_fog_scattering.html | 144 ++++--- 3 files changed, 467 insertions(+), 54 deletions(-) create mode 100644 examples/jsm/generators/TreeGenerator.js diff --git a/examples/jsm/generators/TreeGenerator.js b/examples/jsm/generators/TreeGenerator.js new file mode 100644 index 00000000000000..5dc54b4a5c58cc --- /dev/null +++ b/examples/jsm/generators/TreeGenerator.js @@ -0,0 +1,377 @@ +import { + BufferAttribute, + BufferGeometry, + Mesh, + Vector3 +} from 'three'; + +import { MeshStandardNodeMaterial } from 'three/webgpu'; +import { color, float, mx_fractal_noise_float, positionLocal, vec3 } from 'three/tsl'; + +// the golden angle ( 137.5° ): rolling each sibling branch by this much around the +// parent axis spreads them like a real stem, so they never line up +const GOLDEN_ANGLE = Math.PI * ( 3 - Math.sqrt( 5 ) ); +const DEG2RAD = Math.PI / 180; +const TAU = Math.PI * 2; + +const UP = /*@__PURE__*/ new Vector3( 0, 1, 0 ); +const _axis = /*@__PURE__*/ new Vector3(); + +// reusable scratch for one tube's ring vertices ( grows to the largest tube seen ) +let _ring = new Float32Array( 0 ); + +/** + * Grows a procedural tree skeleton — trunk, branches and twigs, each swept as a tapered + * tube — and bakes it into one non-indexed {@link BufferGeometry} (position and normal + * only), ready to instance into a forest. It produces *branches only*; add foliage as a + * separate layer. + * + * The branching is deterministic for a given `seed`: a recursive sweep lays down gently + * curved tubes with a parallel-transport frame (so they never twist), forking by the + * pipe model (each child much thinner than its parent), spreading children along the + * upper part of each branch with a golden-angle roll, and pulling them back up toward + * the light. A flared root, non-linear taper and gravity droop fill in the character. + * + * Parameters are set with a fluent builder: a `set()` exists for every default + * ( `setSeed`, `setLevels`, `setChildren`, … ), each returning `this` for chaining. + * + * Each `build()` returns a fresh, independent mesh that the caller owns, so one + * generator can be re-parametrized and built repeatedly to grow a varied stand: + * + * ```js + * const generator = new TreeGenerator( material ); + * const oak = generator.setSeed( 1 ).setLevels( 4 ).build(); + * const pine = generator.setSeed( 2 ).setLevels( 5 ).build(); + * ``` + */ +class TreeGenerator { + + constructor( material = null ) { + + this.material = material; + this.parameters = {}; // overrides; defaults fill the rest at build time + + } + + build() { + + const p = Object.assign( {}, TreeGenerator.defaults, this.parameters ); + const random = createRandom( p.seed ); + + // grow the skeleton into a flat list of tubes, then size and fill the geometry in + // one pass — no per-vertex objects, no array growth + + const tubes = []; + growBranch( tubes, new Vector3(), UP, p.trunkLength, p.trunkRadius, 0, p, random ); + + let vertexCount = 0; + for ( const tube of tubes ) vertexCount += ( tube.rings.length - 1 ) * tube.radial * 6; + + const positions = new Float32Array( vertexCount * 3 ); + const normals = new Float32Array( vertexCount * 3 ); + + let offset = 0; + for ( const tube of tubes ) offset = emitTube( positions, normals, offset, tube.rings, tube.radial ); + + const geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new BufferAttribute( positions, 3 ) ); + geometry.setAttribute( 'normal', new BufferAttribute( normals, 3 ) ); + geometry.computeBoundingSphere(); + + const mesh = new Mesh( geometry, this.material || createTreeMaterial() ); + mesh.name = 'Tree'; + + return mesh; + + } + +} + +TreeGenerator.defaults = { + seed: 1, + levels: 4, // recursion depth: trunk, branch, twig, sub-twig + children: [ 3, 12, 8 ], // sub-branches per level; density comes from many children spread along each parent, not depth + branchAngle: [ 38, 50, 58 ], // degrees a child tilts off its parent axis, per level + angleVariance: 14, // degrees of random jitter on the branch angle, breaks fractal regularity + lengthRatio: 0.62, // child length / parent length + trunkLength: 9, // trunk length in world units; sets the tree's height + trunkRadius: 0.42, // base radius of the trunk + taper: 0.55, // a branch thins to ( 1 - taper ) of its base radius along its own length + taperCurve: 0.7, // < 1 keeps the bole full then tapers ( real trees ), 1 = straight cone + rootFlare: 0.6, // how much the trunk swells at the very base + flareFrac: 0.18, // fraction of the trunk over which the flare acts + radiusExponent: 2.3, // pipe model ( da Vinci ): childBase = parentBase × ( 1 / children )^( 1 / radiusExponent ) + minRadius: 0.05, // hair-thin floor so twigs don't taper to a sliver + minLength: 0.6, // branches shorter than this stop recursing + droop: 0.05, // gravity sag per branch ( ≈ droop × length ); the trunk stays upright + upPull: 0.3, // phototropism: 0 = a bare spread cone ( many branches aim down ), 1 = straight up + gnarl: [ 0.05, 0.16, 0.26, 0.32 ], // per-level random wobble on each tube segment + radialSegments: 6, // ring vertices around a tube ( drops by one per level for thin twigs ) + sectionLength: 1.3, // world units per tube segment, so a tall trunk stays smooth + childStart: 0.12, // fraction up a sub-branch before children appear + trunkClear: 0.25 // fraction of the trunk kept bare before the crown ( raise for a tall clean bole ) +}; + +// a fluent setter for every default — setSeed(), setLevels(), setChildren(), … — each +// storing its value and returning `this`, so the API stays in sync with the parameters +for ( const key of Object.keys( TreeGenerator.defaults ) ) { + + TreeGenerator.prototype[ 'set' + key[ 0 ].toUpperCase() + key.slice( 1 ) ] = function ( value ) { + + this.parameters[ key ] = value; + return this; + + }; + +} + +// --- skeleton ------------------------------------------------------------ + +// Grows one branch as a gently curved, tapered tube and recurses, collecting the tube +// into `tubes`. The tube is swept with a parallel-transport frame ( rotated by the same +// rotation that bends the tangent each step ) so it never twists, unlike a naive Frenet +// frame. Children fork off the upper part of the branch by the pipe model. +function growBranch( tubes, base, dir, length, baseRadius, level, p, random ) { + + const sections = Math.max( 3, Math.min( 24, Math.round( length / p.sectionLength ) ) ); // ring count tracks length + const radial = Math.max( 3, p.radialSegments - level ); + const step = length / sections; + const gnarl = p.gnarl[ Math.min( level, p.gnarl.length - 1 ) ]; + const start = level === 0 ? p.trunkClear : p.childStart; // the trunk carries a clean bole below its crown + + let tangent = dir.clone().normalize(); + const normal = perpendicular( tangent ); + + const rings = []; + const pos = base.clone(); + + for ( let s = 0; s <= sections; s ++ ) { + + const t = s / sections; + + // non-linear taper down to ( 1 - taper ) of the base, with a flared root on the trunk + let radius = baseRadius * ( ( 1 - p.taper ) + p.taper * Math.pow( 1 - t, p.taperCurve ) ); + if ( level === 0 && p.rootFlare > 0 ) { + + const flare = Math.max( 0, ( p.flareFrac - t ) / p.flareFrac ); + radius *= 1 + p.rootFlare * flare * flare * flare; // sharp knee, confined to the base + + } + + rings.push( { + pos: pos.clone(), + tangent: tangent.clone(), + normal: normal.clone(), + binormal: new Vector3().crossVectors( tangent, normal ), + radius + } ); + + if ( s < sections ) { + + const next = tangent.clone(); + next.x += ( random() * 2 - 1 ) * gnarl; + next.y += ( random() * 2 - 1 ) * gnarl; + next.z += ( random() * 2 - 1 ) * gnarl; + if ( level > 0 ) next.y -= p.droop * step; // branches sag; the trunk stays vertical + next.normalize(); + + transport( tangent, next, normal ); // keep the frame torsion-free + pos.addScaledVector( next, step ); + tangent = next; + + } + + } + + tubes.push( { rings, radial } ); + + if ( level >= p.levels - 1 || length < p.minLength ) return; + + // fork: children spread along the upper branch, each tilted off the local tangent, + // rolled by the golden angle, and much thinner than the parent ( pipe model ) + + const n = p.children[ Math.min( level, p.children.length - 1 ) ]; + const angle = p.branchAngle[ Math.min( level, p.branchAngle.length - 1 ) ]; + const pipeDrop = Math.pow( 1 / n, 1 / p.radiusExponent ); + + for ( let i = 0; i < n; i ++ ) { + + const t = start + ( i + 0.5 + ( random() - 0.5 ) * 0.6 ) / n * ( 1 - start ); + const ring = ringAt( rings, t ); + + const tilt = ( angle + ( random() * 2 - 1 ) * p.angleVariance ) * DEG2RAD; + const roll = i * GOLDEN_ANGLE + ( random() * 2 - 1 ) * 0.4; + + // tilt off a perpendicular axis FIRST, then roll about the parent axis, then pull + // back toward the light ( else the roll sends half the children downward ) + const childDir = ring.tangent.clone() + .applyAxisAngle( ring.normal, tilt ) + .applyAxisAngle( ring.tangent, roll ); + if ( p.upPull > 0 ) childDir.lerp( UP, p.upPull ).normalize(); + + // the pipe-model drop, but never fatter than the wood it leaves nor below the floor + const childBase = Math.max( p.minRadius, Math.min( baseRadius * pipeDrop, ring.radius ) ); + + growBranch( tubes, ring.pos, childDir, length * p.lengthRatio, childBase, level + 1, p, random ); + + } + +} + +// a unit vector perpendicular to v ( cross with the least-aligned axis ) +function perpendicular( v ) { + + const a = Math.abs( v.x ) < 0.9 ? _axis.set( 1, 0, 0 ) : _axis.set( 0, 1, 0 ); + return new Vector3().crossVectors( v, a ).normalize(); + +} + +// rotate frame vector n by the rotation that maps tangent t0 onto t1 +function transport( t0, t1, n ) { + + _axis.crossVectors( t0, t1 ); + const sin = _axis.length(); + if ( sin < 1e-6 ) return; // already parallel + _axis.divideScalar( sin ); + n.applyAxisAngle( _axis, Math.atan2( sin, t0.dot( t1 ) ) ); + +} + +// sample the branch frame at fraction t ( 0..1 ) for spawning a child +function ringAt( rings, t ) { + + const f = Math.max( 0, Math.min( 0.999, t ) ) * ( rings.length - 1 ); + const i = Math.floor( f ); + const frac = f - i; + const a = rings[ i ]; + const b = rings[ Math.min( i + 1, rings.length - 1 ) ]; + + return { + pos: a.pos.clone().lerp( b.pos, frac ), + tangent: a.tangent.clone().lerp( b.tangent, frac ).normalize(), + normal: a.normal.clone().lerp( b.normal, frac ).normalize(), + radius: a.radius + ( b.radius - a.radius ) * frac + }; + +} + +// --- geometry ------------------------------------------------------------ + +// Sweeps a tube through the rings: each ring is a loop of `radial` vertices in its +// ( normal, binormal ) plane, the outward radial direction being the vertex normal. +// Ring vertices are computed once into a reused scratch, then stitched straight into the +// preallocated geometry arrays — no per-vertex objects. +function emitTube( positions, normals, offset, rings, radial ) { + + const stride = ( radial + 1 ) * 6; // one ring loop: ( position, normal ) per vertex + const needed = rings.length * stride; + if ( _ring.length < needed ) _ring = new Float32Array( needed ); + + const ring = _ring; + + for ( let r = 0; r < rings.length; r ++ ) { + + const { pos, normal, binormal, radius } = rings[ r ]; + let o = r * stride; + + for ( let j = 0; j <= radial; j ++ ) { + + const a = j / radial * TAU; + const c = Math.cos( a ); + const s = Math.sin( a ); + const nx = c * normal.x + s * binormal.x; + const ny = c * normal.y + s * binormal.y; + const nz = c * normal.z + s * binormal.z; + + ring[ o ++ ] = pos.x + nx * radius; + ring[ o ++ ] = pos.y + ny * radius; + ring[ o ++ ] = pos.z + nz * radius; + ring[ o ++ ] = nx; + ring[ o ++ ] = ny; + ring[ o ++ ] = nz; + + } + + } + + // stitch consecutive rings into quads ( two triangles ), wound so normals face out + + for ( let r = 0; r < rings.length - 1; r ++ ) { + + const a = r * stride; + const b = ( r + 1 ) * stride; + + for ( let j = 0; j < radial; j ++ ) { + + const aL = a + j * 6, aR = a + ( j + 1 ) * 6; + const bL = b + j * 6, bR = b + ( j + 1 ) * 6; + + offset = copyVertex( positions, normals, offset, ring, aL ); + offset = copyVertex( positions, normals, offset, ring, bR ); + offset = copyVertex( positions, normals, offset, ring, bL ); + + offset = copyVertex( positions, normals, offset, ring, aL ); + offset = copyVertex( positions, normals, offset, ring, aR ); + offset = copyVertex( positions, normals, offset, ring, bR ); + + } + + } + + return offset; + +} + +// copies one ( position, normal ) vertex from the ring scratch into the geometry arrays +function copyVertex( positions, normals, offset, ring, i ) { + + const o = offset * 3; + positions[ o ] = ring[ i ]; positions[ o + 1 ] = ring[ i + 1 ]; positions[ o + 2 ] = ring[ i + 2 ]; + normals[ o ] = ring[ i + 3 ]; normals[ o + 1 ] = ring[ i + 4 ]; normals[ o + 2 ] = ring[ i + 5 ]; + + return offset + 1; + +} + +// --- deterministic PRNG ( mulberry32 ) ----------------------------------- + +function createRandom( seed ) { + + let s = ( seed >>> 0 ) || 1; + + return function () { + + s = ( s + 0x6D2B79F5 ) | 0; + let t = Math.imul( s ^ ( s >>> 15 ), 1 | s ); + t = ( t + Math.imul( t ^ ( t >>> 7 ), 61 | t ) ) ^ t; + return ( ( t ^ ( t >>> 14 ) ) >>> 0 ) / 4294967296; + + }; + +} + +// --- material ------------------------------------------------------------ + +/** + * A simple bark material for a {@link TreeGenerator} mesh: a low-saturation brown with a + * faint, vertically-stretched grain, so trunks read near-black against bright fog. + * + * @param {Object} [parameters] - `barkColor` ( a hex, THREE.Color or TSL node ). + * @return {MeshStandardNodeMaterial} + */ +function createTreeMaterial( parameters = {} ) { + + const c = parameters.barkColor; + const barkColor = c === undefined ? color( 0x4b3a2b ) : ( c.isColor || typeof c === 'number' ? color( c ) : c ); + + const material = new MeshStandardNodeMaterial(); + const grain = mx_fractal_noise_float( positionLocal.mul( vec3( 2.5, 0.4, 2.5 ) ), 3 ).mul( 0.18 ); + material.colorNode = barkColor.mul( grain.add( 0.9 ) ); + material.roughnessNode = float( 0.95 ); + material.metalnessNode = float( 0 ); + + return material; + +} + +export { TreeGenerator, createTreeMaterial }; diff --git a/examples/screenshots/webgpu_custom_fog_scattering.jpg b/examples/screenshots/webgpu_custom_fog_scattering.jpg index 1150ca5c00059e5c3461413027ab680229d93c73..fbc5de25c79db2aba8af92a82026d2d914f01278 100644 GIT binary patch literal 20272 zcmbSyby!n@`|lZpjV|dL3Q7plNN<2N3W9-zprCYjZW9HhLqbFt(kLiOi-a^tNK35WR!3i z{6BC1Kb=1Dq=AI~_kfTYkcqigNG)MOs#F6J-4;9ckuM`_VM-e4+wqvDl9zW zb!1}Fo8*+#w72OWa&q(X3kr*hzkVyPsI024sr}j9(%RPE(b+XHI5a#mI`(ILZXUm| zxU{^oy0){sw|{VWbbN9O0ige72R#2D{D6!@NdCzj{*NCBi7)toGLVv8mVhy;-i1GL zzjQ?sOU|U0kX_b9!6#+3&HU8kHzf<05uc> zDh$d1Ac3>#LnOb493u?A&qufbbl2s3I3G5yPF?_}K=oHE+iA>IEqtVvV!-c0!0L`5 z#16obU?>4WNVJC?Nl7=;1>ha`Sr_$my(hvX&=|US0Zb$jZ&4YX(P~`)A8ZS)%`#cH zDX*o@x4q?%Fw$sa^HI4~Hx%p7b$%7C6S1x~u_iskH1vOR`@!(In?p~7~Y@fRT zE=6^FaLBv;(!yP3qicbpSd_G+O`lifukDDRDcy9~6-0V9Jm6^&SW;ermJ$0SCe&rm zyP7X|uI?sfb)|7BPqbbDqVzb0Z1DDG>;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?}39xZ0@ZTI(*iw z^bgLwj&1hCxOR) zk0Y$sp-Hkw5f*&Q5fLRxnV9=aPGBc${8mU4m7I9h>7N!${qhwf2eUQ@;T)Ko>#rI) zeoX6i{yLRqW5-L=hJF%1tpVJ@s5I8j5m#C?d`8E26i%Id*k#2Qv_|oe`h&KXR$5-PFf$=$Fti@S5O~*-@FC6L z5kNzJTyaXfbwA2(s|@7|qjp-|=lK9>sq*6TgG7nu_;8QmpCZcLb=SZH#eN7a3oKG^GF!2Nt zzB>B1BlFV%WQ?rxy(|Wc#Y;|#xmDl^0avl+0D*I$^%nO2O8QPDqNQ##&3HoLCpH}> z)Q9^pmF}|^+MqOKyWp|&5r2_WV!AFpOV_j-cA9yjT2Y#pzO>sGIYvpPR? z=vYsym{6I{-ckr1tZ3tIJqKQG-g+3_tn0I8Ga$4#T_`jgd_TiyAwVqp)u=9WqaC$_ z8^MSl`s+PC=CUcU^+|2*ZU0U9Iz%!P!@Ws_gdn)<@!-l z(hJUNtj1(Y_Z^}IR}MpFss4h)A`$527w{vVf#=(V{r=}JvP)t@Q9*R2&mPS==quG( z1}wR_Mp*HV#1Flu2}zGU2ZkCYkHsF<;QmxsHKZu=@-1bXnSat`P2z>*_cPqavwaW> rnm>y}*gjLL-^9wY*DT0}N(5`f%sX$X%CU53+;dGU|CeHiod5nG`=qNG diff --git a/examples/webgpu_custom_fog_scattering.html b/examples/webgpu_custom_fog_scattering.html index 6c119923a28376..6fe683d7c7783d 100644 --- a/examples/webgpu_custom_fog_scattering.html +++ b/examples/webgpu_custom_fog_scattering.html @@ -38,14 +38,17 @@ + + + + diff --git a/test/e2e/puppeteer.js b/test/e2e/puppeteer.js index 1b2e4fde3b6c51..2a3be6b574e809 100644 --- a/test/e2e/puppeteer.js +++ b/test/e2e/puppeteer.js @@ -38,6 +38,7 @@ const exceptionList = [ 'webgpu_compute_audio', 'webgpu_compute_cloth', 'webgpu_compute_particles_fluid', + 'webgpu_compute_rasterizer_ibl', // Rasterizer discrepancies 'webgpu_compute_sort_bitonic', 'webgpu_storage_buffer', 'webgpu_tsl_editor', From aace2e8bab4ade32dd76af3d5e05b464d20f1a39 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Wed, 24 Jun 2026 22:56:45 +0900 Subject: [PATCH 04/10] Examples: Use FirstPersonControls in webgpu_compute_rasterizer. Co-Authored-By: Claude Opus 4.8 (1M context) --- examples/webgpu_compute_rasterizer.html | 19 ++++++++++--------- examples/webgpu_compute_rasterizer_ibl.html | 21 ++++++++++++--------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/examples/webgpu_compute_rasterizer.html b/examples/webgpu_compute_rasterizer.html index f49bdc7e9acea3..7324f481224a5e 100644 --- a/examples/webgpu_compute_rasterizer.html +++ b/examples/webgpu_compute_rasterizer.html @@ -38,7 +38,7 @@ import * as THREE from 'three/webgpu'; import { Fn, If, Loop, vec4, vec2, uvec4, mat4, uint, float, int, min, max, atomicMax, atomicAdd, atomicStore, atomicLoad, floor, cos, sin, dot, bool, storage, uniform, uniformArray, uv, instanceIndex, vertexIndex, distance, screenSize, time, texture, varyingProperty, sqrt } from 'three/tsl'; - import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; + import { FirstPersonControls } from 'three/addons/controls/FirstPersonControls.js'; import { TeapotGeometry } from 'three/addons/geometries/TeapotGeometry.js'; import { Inspector } from 'three/addons/inspector/Inspector.js'; @@ -53,7 +53,7 @@ } - let camera, renderer, controls; + let camera, renderer, controls, timer; let computeRasterize, computeClear, computeFrustum, computeDispatch, computeHWArgs; let quadMesh, hwScene, hwMesh; let cameraPos, projScreenMatrixUniform, frustumPlanesUniform, cotHalfFovUniform; @@ -95,12 +95,12 @@ camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, .25, 1000000 ); camera.position.set( 0, 15, 50 ); - controls = new OrbitControls( camera, renderer.domElement ); - controls.target.y = - 1.5; - controls.enableDamping = true; - controls.zoomSpeed = .5; - controls.maxDistance = 1000; - controls.maxPolarAngle = Math.PI / 2; + timer = new THREE.Timer(); + + controls = new FirstPersonControls( camera, renderer.domElement ); + controls.movementSpeed = 30; + controls.lookSpeed = 0.2; + controls.lookAt( 0, - 1.5, 0 ); // Generate LOD Geometries const lods = [ @@ -1083,7 +1083,8 @@ function animate() { - controls.update(); + timer.update(); + controls.update( timer.getDelta() ); camera.updateMatrixWorld(); diff --git a/examples/webgpu_compute_rasterizer_ibl.html b/examples/webgpu_compute_rasterizer_ibl.html index ae6a4e30e88e76..cd92123520b87c 100644 --- a/examples/webgpu_compute_rasterizer_ibl.html +++ b/examples/webgpu_compute_rasterizer_ibl.html @@ -38,7 +38,7 @@ import * as THREE from 'three/webgpu'; import { Fn, If, Loop, vec2, vec4, uvec2, uvec4, mat4, uint, float, int, min, max, clamp, ceil, log2, length, dFdx, dFdy, atomicMax, atomicAdd, atomicStore, atomicLoad, floor, cos, sin, dot, bool, storage, uniform, uniformArray, instanceIndex, vertexIndex, distance, screenSize, screenCoordinate, time, texture, varyingProperty, sqrt, normalize, cross, sign, positionGeometry, cameraViewMatrix, Discard, context, positionView, positionViewDirection, overrideNodes } from 'three/tsl'; - import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; + import { FirstPersonControls } from 'three/addons/controls/FirstPersonControls.js'; import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js'; import { UltraHDRLoader } from 'three/addons/loaders/UltraHDRLoader.js'; import { MeshoptClusterizer } from 'three/addons/libs/meshopt_clusterizer.module.js'; @@ -56,7 +56,7 @@ } - let camera, scene, renderer, controls; + let camera, scene, renderer, controls, timer; let computeRasterize, computeClear, computeFrustum, computeDispatch, computeHWArgs; let resolveMesh, hwMesh; let cameraPos, projScreenMatrixUniform, frustumPlanesUniform, cotHalfFovUniform; @@ -159,10 +159,11 @@ camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, .25, 1000000 ); - controls = new OrbitControls( camera, renderer.domElement ); - controls.enableDamping = true; - controls.zoomSpeed = .5; - controls.maxDistance = 1000; + timer = new THREE.Timer(); + + controls = new FirstPersonControls( camera, renderer.domElement ); + controls.movementSpeed = 10; + controls.lookSpeed = 0.2; // Load assets const [ gltf, envTexture ] = await Promise.all( [ @@ -449,7 +450,7 @@ //camera.position.set( 0, 800, 3000 ); camera.position.set( 0, 8, 30 ); - controls.target.set( 0, - 1, 0 ); + controls.lookAt( 0, - 1, 0 ); } else { @@ -471,7 +472,7 @@ } camera.position.set( 2, 2, 40 ); - controls.target.set( 0, 0, 0 ); + controls.lookAt( 0, 0, 0 ); } @@ -1693,9 +1694,11 @@ function animate() { + timer.update(); + if ( resolveMesh === undefined ) return; // still loading - controls.update(); + controls.update( timer.getDelta() ); camera.updateMatrixWorld(); From 97096f71c0678948b67d843b0a550833e7882d3c Mon Sep 17 00:00:00 2001 From: mrdoob Date: Wed, 24 Jun 2026 22:02:58 +0800 Subject: [PATCH 05/10] Inspector: Add overdraw render mode. (#33870) Co-authored-by: Claude Opus 4.8 (1M context) --- examples/jsm/inspector/RendererInspector.js | 66 ++++++++++++++++++++- examples/jsm/inspector/tabs/Settings.js | 10 ++++ examples/jsm/inspector/ui/utils.js | 9 ++- 3 files changed, 83 insertions(+), 2 deletions(-) diff --git a/examples/jsm/inspector/RendererInspector.js b/examples/jsm/inspector/RendererInspector.js index a9ec229a1ba1a9..4b5d46ce0029db 100644 --- a/examples/jsm/inspector/RendererInspector.js +++ b/examples/jsm/inspector/RendererInspector.js @@ -1,5 +1,6 @@ -import { InspectorBase, TimestampQuery, warnOnce } from 'three/webgpu'; +import { InspectorBase, TimestampQuery, warnOnce, RendererUtils, MeshBasicNodeMaterial, AdditiveBlending, NoToneMapping, LinearSRGBColorSpace } from 'three/webgpu'; +import { vec3 } from 'three/tsl'; class ObjectStats { @@ -84,6 +85,9 @@ export class RendererInspector extends InspectorBase { this._lastFinishTime = 0; this._resolveTimestampPromise = null; + this.overdraw = false; + this._overdrawMaterial = null; + this.isRendererInspector = true; } @@ -122,6 +126,66 @@ export class RendererInspector extends InspectorBase { this._lastFinishTime = now; + if ( this.overdraw === true ) { + + this._renderOverdraw( frame ); + + } + + } + + _renderOverdraw( frame ) { + + const renderer = this.getRenderer(); + + if ( renderer === null ) return; + + // first scene render of the frame; nested shadow / RTT passes come after + + let primary = null; + + for ( const render of frame.renders ) { + + if ( render.scene.isScene === true ) { + + primary = render; + break; + + } + + } + + if ( primary === null ) return; + + if ( this._overdrawMaterial === null ) { + + // additive constant, so each pixel sums the depth-passing fragments it shaded + + this._overdrawMaterial = new MeshBasicNodeMaterial( { + colorNode: vec3( 0.25 ), + blending: AdditiveBlending, + depthTest: true, + depthWrite: true, + toneMapped: false + } ); + + } + + const { scene, camera } = primary; + + // raw render against black with no tone mapping, so the count stays linear + + const state = RendererUtils.resetRendererAndSceneState( renderer, scene ); + + renderer.toneMapping = NoToneMapping; + renderer.outputColorSpace = LinearSRGBColorSpace; + + scene.overrideMaterial = this._overdrawMaterial; + + renderer.render( scene, camera ); + + RendererUtils.restoreRendererAndSceneState( renderer, scene, state ); + } _getFPS() { diff --git a/examples/jsm/inspector/tabs/Settings.js b/examples/jsm/inspector/tabs/Settings.js index 0b5b420d4b523d..a77f809d719df5 100644 --- a/examples/jsm/inspector/tabs/Settings.js +++ b/examples/jsm/inspector/tabs/Settings.js @@ -115,6 +115,16 @@ class Settings extends Parameters { } ); + // Render Modes + + const modesGroup = this.createGroup( 'Render Modes' ); + + modesGroup.add( { overdraw: false }, 'overdraw' ).name( 'Overdraw' ).onChange( ( enable ) => { + + this.inspector.overdraw = enable; + + } ).info( 'Shows how many times each pixel is shaded.' ); + } init() { diff --git a/examples/jsm/inspector/ui/utils.js b/examples/jsm/inspector/ui/utils.js index 9a6eac22093cee..26363a2b490d97 100644 --- a/examples/jsm/inspector/ui/utils.js +++ b/examples/jsm/inspector/ui/utils.js @@ -101,8 +101,15 @@ export function info( parentNode, text ) { tooltip.innerHTML = html; const rect = infoIcon.getBoundingClientRect(); + const tooltipWidth = tooltip.getBoundingClientRect().width; - tooltip.style.left = ( rect.left + rect.width / 2 ) + 'px'; + // keep the centered tooltip within the viewport so it isn't clipped near an edge + + const margin = 8; + const half = tooltipWidth / 2; + const center = Math.max( margin + half, Math.min( window.innerWidth - margin - half, rect.left + rect.width / 2 ) ); + + tooltip.style.left = center + 'px'; tooltip.style.top = ( rect.top - 8 ) + 'px'; tooltip.style.opacity = '1'; From 67e7b21040c4224014a637f706c279ce548e98d6 Mon Sep 17 00:00:00 2001 From: sunag Date: Wed, 24 Jun 2026 11:34:41 -0300 Subject: [PATCH 06/10] Update TSL.md --- docs/TSL.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/TSL.md b/docs/TSL.md index aee9dcef1aa2fc..dd6d1673efc3ce 100644 --- a/docs/TSL.md +++ b/docs/TSL.md @@ -52,6 +52,7 @@ An Approach to Productive and Maintainable Shader Creation. - [Storage](#storage) - [Struct](#struct) - [Flow Control](#flow-control) +- [Override Node](#override-node) - [Fog](#fog) - [Color Adjustments](#color-adjustments) - [Utilities](#utilities) @@ -903,6 +904,8 @@ The module also provides `Break()` and `Continue()` TSL expression for loop cont | `step( edge, x )` | Generate a step function by comparing two values. | | `tan( x )` | Return the tangent of the parameter. | | `transformDirection( dir, matrix )` | Transform the direction of a vector by a matrix and then normalize the result. | +| `transformNormalByViewMatrix( normal, viewMatrix )` | Transform a normal vector (given in world space) by the view matrix and normalize the result. | +| `transformNormalByInverseViewMatrix( normal, viewMatrix )` | Transform a normal vector (given in view space) by the inverse of the view matrix and normalize the result. | | `trunc( x )` | Truncate the parameter, removing the fractional part. | ```js @@ -1086,6 +1089,7 @@ Screen nodes will return the values related to the current `frame buffer`, eithe | `spherizeUV( uv, strength, centerNode = vec2( 0.5 ) )` | Distorts UV coordinates with a spherical effect around a center point. | `vec2` | | `spritesheetUV( count, uv = uv(), frame = float( 0 ) )` | Computes UV coordinates for a sprite sheet based on the number of frames, UV coordinates, and frame index. | `vec2` | | `equirectUV( direction = positionWorldDirection )` | Computes UV coordinates for equirectangular mapping based on the direction vector. | `vec2` | +| `equirectDirection( uv = uv() )` | Computes a direction vector from the given equirectangular UV coordinates (inverse of `equirectUV`). | `vec3` | ```js import { texture, matcapUV } from 'three/tsl'; @@ -1420,6 +1424,35 @@ const customFragment = Fn( () => { material.colorNode = customFragment(); ``` +## Override Node + +Override nodes allow you to replace specific target nodes within a node sub-graph or flow dynamically during compilation, without having to reconstruct or duplicate the source nodes. This is useful, for example, to inject a custom `positionLocal` or normal into an existing flow through the material's `contextNode`. + +| Name | Description | +| -- | -- | +| `overrideNode( targetNode, callback = null, flowNode = null )` | Overrides a single target node. `callback` returns the overriding node (receiving the builder as argument) or can be the overriding node itself. | +| `overrideNodes( overrides, flowNode = null )` | Overrides multiple target nodes at once using a `Map` or an array of `[ targetNode, callback \| node ]` pairs. | + +Example: + +```js +import { overrideNode, overrideNodes, positionLocal, positionView, vec3 } from 'three/tsl'; + +const customPositionView = positionLocal.add( vec3( 1, 0, 0 ) ); + +// Override a single node through the material context +material.contextNode = overrideNode( positionLocal, () => positionLocal.add( vec3( 1, 0, 0 ) ) ); + +// Override multiple nodes at once +material.contextNode = overrideNodes( [ + [ positionView, customPositionView ], + [ positionLocal, ( builder ) => positionLocal.add( vec3( 1, 0, 0 ) ) ] +] ); + +// Method chaining is also supported +node.overrideNode( positionLocal, () => positionLocal.add( vec3( 1, 0, 0 ) ) ); +``` + ## Fog Functions for creating fog effects in the scene. Assign the fog node to `scene.fogNode`. @@ -1477,6 +1510,7 @@ Utility functions for common shader tasks. | -- | -- | -- | | `billboarding( { position, horizontal, vertical } )` | Orients flat meshes always towards the camera. `position`: vertex positions in world space (default: `null`). `horizontal`: follow camera horizontally (default: `true`). `vertical`: follow camera vertically (default: `false`). | `vec3` | | `checker( coord )` | Creates a 2x2 checkerboard pattern. | `float` | +| `negateOnBackSide( vector )` | Negates a vector when rendering the back side of a face, according to the material's `side` configuration (`BackSide`, `DoubleSide` or `FrontSide`). | `vec3` | Example: From e98d15037eb5699f33db34ca72e7c4a49eeed68e Mon Sep 17 00:00:00 2001 From: sunag Date: Wed, 24 Jun 2026 11:35:24 -0300 Subject: [PATCH 07/10] Inspector: Group duplicate console messages and allow detached tab panels to remain visible (#33864) --- examples/jsm/inspector/tabs/Console.js | 92 ++++++++++++++++++----- examples/jsm/inspector/ui/List.js | 2 +- examples/jsm/inspector/ui/Profiler.js | 22 ------ examples/jsm/inspector/ui/Style.js | 100 +++++++++++++++++++++---- examples/jsm/inspector/ui/Tab.js | 4 +- 5 files changed, 164 insertions(+), 56 deletions(-) diff --git a/examples/jsm/inspector/tabs/Console.js b/examples/jsm/inspector/tabs/Console.js index 8b4cb56d2558b5..62c30eb259a07d 100644 --- a/examples/jsm/inspector/tabs/Console.js +++ b/examples/jsm/inspector/tabs/Console.js @@ -33,6 +33,8 @@ class Console extends Tab { this.logContainer.classList.add( 'console-log' ); this.content.appendChild( this.logContainer ); + this.lastMessage = null; + } buildHeader() { @@ -74,9 +76,13 @@ class Console extends Tab { const checkmark = document.createElement( 'span' ); checkmark.className = 'checkmark'; + const labelText = document.createElement( 'span' ); + labelText.className = 'checkbox-text'; + labelText.textContent = type.charAt( 0 ).toUpperCase() + type.slice( 1 ); + label.appendChild( checkbox ); label.appendChild( checkmark ); - label.append( type.charAt( 0 ).toUpperCase() + type.slice( 1 ) ); + label.appendChild( labelText ); buttonsGroup.appendChild( label ); } ); @@ -190,10 +196,6 @@ class Console extends Tab { const parts = fullPrefix.slice( 0, - 2 ).split( '.' ); const shortPrefix = ( parts.length > 1 ? parts[ parts.length - 1 ] : parts[ 0 ] ) + ':'; - const icon = this._getIcon( type, shortPrefix.split( ':' )[ 0 ].toLowerCase() ); - - fragment.appendChild( document.createTextNode( icon + ' ' ) ); - const prefixSpan = document.createElement( 'span' ); prefixSpan.className = 'log-prefix'; prefixSpan.textContent = shortPrefix; @@ -232,7 +234,7 @@ class Console extends Tab { super.setActive( isActive ); - if ( isActive && this.profiler && this.profiler.panel.classList.contains( 'visible' ) ) { + if ( isActive ) { this.clearUnread(); @@ -319,25 +321,79 @@ class Console extends Tab { addMessage( type, text ) { - const msg = document.createElement( 'div' ); - msg.className = `log-message ${type}`; - msg.dataset.type = type; - msg.dataset.rawText = text; + if ( this.lastMessage && this.lastMessage.type === type && this.lastMessage.text === text ) { - msg.appendChild( this._formatMessage( type, text ) ); + this.lastMessage.count ++; + this.lastMessage.countBadge.textContent = this.lastMessage.count; + this.lastMessage.countBadge.style.display = ''; - const showByType = this.filters[ type ]; - const showByText = text.toLowerCase().includes( this.filterText ); - msg.classList.toggle( 'hidden', ! ( showByType && showByText ) ); + } else { - this.logContainer.appendChild( msg ); - this.logContainer.scrollTop = this.logContainer.scrollHeight; - if ( this.logContainer.children.length > 200 ) { + const msg = document.createElement( 'div' ); + msg.className = `log-message ${type}`; + msg.dataset.type = type; + msg.dataset.rawText = text; + + const countBadge = document.createElement( 'span' ); + countBadge.className = 'log-count-badge'; + countBadge.style.display = 'none'; + msg.appendChild( countBadge ); + + let icon = null; + const prefixMatch = text.match( /^([\w\.]+:\s)/ ); + if ( prefixMatch ) { + + const fullPrefix = prefixMatch[ 0 ]; + const parts = fullPrefix.slice( 0, - 2 ).split( '.' ); + const shortPrefix = ( parts.length > 1 ? parts[ parts.length - 1 ] : parts[ 0 ] ) + ':'; + icon = this._getIcon( type, shortPrefix.split( ':' )[ 0 ].toLowerCase() ); + + } + + if ( icon ) { + + const iconSpan = document.createElement( 'span' ); + iconSpan.className = 'log-icon'; + iconSpan.textContent = icon; + msg.appendChild( iconSpan ); + + } + + const body = document.createElement( 'span' ); + body.className = 'log-body'; + body.appendChild( this._formatMessage( type, text ) ); + msg.appendChild( body ); + + const showByType = this.filters[ type ]; + const showByText = text.toLowerCase().includes( this.filterText ); + msg.classList.toggle( 'hidden', ! ( showByType && showByText ) ); + + this.logContainer.appendChild( msg ); + + if ( this.logContainer.children.length > 200 ) { - this.logContainer.removeChild( this.logContainer.firstChild ); + const firstChild = this.logContainer.firstChild; + this.logContainer.removeChild( firstChild ); + if ( this.lastMessage && this.lastMessage.element === firstChild ) { + + this.lastMessage = null; + + } + + } + + this.lastMessage = { + type, + text, + count: 1, + element: msg, + countBadge + }; } + this.logContainer.scrollTop = this.logContainer.scrollHeight; + // Update unread counts if the console is not active/visible const isUnread = ! this.isActive; diff --git a/examples/jsm/inspector/ui/List.js b/examples/jsm/inspector/ui/List.js index 4f44c34a963d7f..53d574a9690a8f 100644 --- a/examples/jsm/inspector/ui/List.js +++ b/examples/jsm/inspector/ui/List.js @@ -7,7 +7,7 @@ export class List { this.children = []; this.domElement = document.createElement( 'div' ); this.domElement.className = 'list-container'; - this.domElement.style.padding = '10px'; + this.domElement.style.padding = '5px 10px 10px 10px'; this.id = `list-${Math.random().toString( 36 ).slice( 2, 11 )}`; this.domElement.dataset.listId = this.id; diff --git a/examples/jsm/inspector/ui/Profiler.js b/examples/jsm/inspector/ui/Profiler.js index 1dae26840850a7..bbc58f11c4ab50 100644 --- a/examples/jsm/inspector/ui/Profiler.js +++ b/examples/jsm/inspector/ui/Profiler.js @@ -1175,13 +1175,7 @@ export class Profiler extends EventDispatcher { windowPanel.style.left = `${ constrainedX }px`; windowPanel.style.top = `${ constrainedY }px`; - if ( ! this.panel.classList.contains( 'visible' ) ) { - windowPanel.style.opacity = '0'; - windowPanel.style.visibility = 'hidden'; - windowPanel.style.pointerEvents = 'none'; - - } // Hide detached window if tab is not visible if ( ! tab.isVisible ) { @@ -1692,23 +1686,7 @@ export class Profiler extends EventDispatcher { } - this.detachedWindows.forEach( detachedWindow => { - - if ( isVisible ) { - - detachedWindow.panel.style.opacity = ''; - detachedWindow.panel.style.visibility = ''; - detachedWindow.panel.style.pointerEvents = ''; - } else { - - detachedWindow.panel.style.opacity = '0'; - detachedWindow.panel.style.visibility = 'hidden'; - detachedWindow.panel.style.pointerEvents = 'none'; - - } - - } ); this.dispatchEvent( { type: 'resize' } ); diff --git a/examples/jsm/inspector/ui/Style.js b/examples/jsm/inspector/ui/Style.js index 39cf891904e6d0..7f77e94a6b60b3 100644 --- a/examples/jsm/inspector/ui/Style.js +++ b/examples/jsm/inspector/ui/Style.js @@ -128,7 +128,7 @@ export class Style { .tab-badge-container { position: absolute; - top: 2px; + top: 1px; right: 3px; display: flex; gap: 2px; @@ -1081,7 +1081,7 @@ export class Style { } .parameters .list-item-row { - min-height: 31px; + min-height: 23px; } .mini-panel-content .parameters .list-item-row { @@ -1095,6 +1095,10 @@ export class Style { -webkit-user-select: none; } + .list-item-wrapper:has(> .list-item-row .graph-container) { + margin-left: -1.5em; + } + .list-item-wrapper:first-child { /*margin-top: 0;*/ } @@ -1258,7 +1262,7 @@ export class Style { border: 1px solid var(--profiler-border); color: var(--text-primary); border-radius: 4px; - padding: 4px 8px; + padding: 4px 10px 2px 10px; font-family: var(--font-mono); flex-grow: 1; max-width: 300px; @@ -1304,13 +1308,64 @@ export class Style { } .log-message { - padding: 2px 5px; - white-space: pre-wrap; - word-break: break-all; + display: flex; + align-items: flex-start; + gap: 6px; + padding: 3px 5px; border-radius: 3px; line-height: 1.5 !important; } + .log-count-badge { + display: inline-block; + text-align: center; + min-width: 14px; + height: 14px; + border-radius: 7px; + padding: 0 3px; + font-size: 9px; + font-weight: bold; + line-height: 14px; + box-sizing: border-box; + margin-top: 0; + flex-shrink: 0; + } + + .log-icon { + display: inline-block; + text-align: center; + width: 14px; + height: 14px; + font-size: 11px; + line-height: 14px; + margin-top: 0; + flex-shrink: 0; + } + + .log-body { + flex-grow: 1; + white-space: pre-wrap; + word-break: break-all; + } + + .log-message.info .log-count-badge { + background-color: rgba(255, 255, 255, 0.12); + border: 1px solid rgba(255, 255, 255, 0.2); + color: var(--text-secondary); + } + + .log-message.warn .log-count-badge { + background-color: rgba(255, 193, 7, 0.18); + border: 1px solid rgba(255, 193, 7, 0.35); + color: var(--color-yellow); + } + + .log-message.error .log-count-badge { + background-color: rgba(244, 67, 54, 0.18); + border: 1px solid rgba(244, 67, 54, 0.35); + color: #ff8a80; + } + .log-message.hidden { display: none; } @@ -1411,6 +1466,7 @@ export class Style { cursor: pointer; gap: 8px; will-change: transform; + font-size: 12px; } .custom-checkbox input { @@ -1428,6 +1484,12 @@ export class Style { transition: background-color 0.2s, border-color 0.2s; } + .custom-checkbox .checkbox-text { + font-size: 12px; + margin-top: 1px; + color: inherit; + } + .custom-checkbox .checkmark::after { content: ''; width: 6px; @@ -1439,6 +1501,16 @@ export class Style { transition: transform 0.2s; } + .list-container .custom-checkbox .checkmark { + width: 13px; + height: 13px; + } + + .list-container .custom-checkbox .checkmark::after { + width: 7px; + height: 7px; + } + .custom-checkbox input:checked+.checkmark { border-color: var(--color-accent); } @@ -1646,12 +1718,6 @@ export class Style { font-size: 13px; } - .profiler-panel:not(.visible) ~ * .detached-tab-panel, - body:has(.profiler-panel:not(.visible)) .detached-tab-panel { - opacity: 0; - visibility: hidden; - pointer-events: none; - } .detached-tab-header { background: var(--profiler-header-background); @@ -1896,7 +1962,8 @@ export class Style { display: flex; align-items: center; justify-content: space-between; - padding: 6px 8px; + height: 32px; + padding: 4px 6px; border-bottom: 1px solid var(--profiler-border); background: var(--profiler-header-background); flex-shrink: 0; @@ -1905,12 +1972,17 @@ export class Style { } .toolbar span { - margin-right: 8px; color: var(--text-secondary); font-size: 12px; font-weight: 600; } + .toolbar .custom-checkbox .checkmark { + width: 12px; + height: 12px; + border-radius: 4px; + } + .viewer-content .toolbar { justify-content: flex-end; } diff --git a/examples/jsm/inspector/ui/Tab.js b/examples/jsm/inspector/ui/Tab.js index 27edd59bf3fbd7..0b77b35f6ceaa3 100644 --- a/examples/jsm/inspector/ui/Tab.js +++ b/examples/jsm/inspector/ui/Tab.js @@ -62,11 +62,13 @@ export class Tab extends EventDispatcher { get isActive() { + if ( this.isDetached && this.isVisible ) return true; + const isProfilerVisible = this.profiler && this.profiler.panel.classList.contains( 'visible' ); if ( ! isProfilerVisible ) return false; - return this.isDetached || this._isActive; + return this._isActive; } From 5402547a11f7239473e9085c3dcf724f7aa953ce Mon Sep 17 00:00:00 2001 From: sunag Date: Wed, 24 Jun 2026 11:38:15 -0300 Subject: [PATCH 08/10] Update TSL.md --- docs/TSL.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/TSL.md b/docs/TSL.md index dd6d1673efc3ce..3d9bbe4ebc5a03 100644 --- a/docs/TSL.md +++ b/docs/TSL.md @@ -1438,14 +1438,12 @@ Example: ```js import { overrideNode, overrideNodes, positionLocal, positionView, vec3 } from 'three/tsl'; -const customPositionView = positionLocal.add( vec3( 1, 0, 0 ) ); - // Override a single node through the material context material.contextNode = overrideNode( positionLocal, () => positionLocal.add( vec3( 1, 0, 0 ) ) ); // Override multiple nodes at once material.contextNode = overrideNodes( [ - [ positionView, customPositionView ], + [ positionView, customPositionView ], // You can use a node directly like customPositionView. [ positionLocal, ( builder ) => positionLocal.add( vec3( 1, 0, 0 ) ) ] ] ); From 2e1ece1c4e5ff453fd7a541cc2d97365cf9868db Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Wed, 24 Jun 2026 23:49:09 +0900 Subject: [PATCH 09/10] Updated docs. --- docs/index.html | 81 +- docs/llms-full.txt | 73 +- docs/llms.txt | 4 +- docs/pages/ARButton.html | 2 +- docs/pages/ARButton.html.md | 2 +- docs/pages/AmmoPhysics.html | 10 +- docs/pages/AmmoPhysics.html.md | 8 +- docs/pages/AnamorphicNode.html | 222 --- docs/pages/AnamorphicNode.html.md | 127 -- docs/pages/Backend.html | 1473 +++++++++++++++++++ docs/pages/Backend.html.md | 707 +++++++++ docs/pages/BatchNode.html | 89 -- docs/pages/BatchNode.html.md | 43 - docs/pages/BloomNode.html | 37 + docs/pages/BloomNode.html.md | 20 + docs/pages/Box3.html | 4 + docs/pages/Box3.html.md | 2 + docs/pages/CityGenerator.html | 43 + docs/pages/CityGenerator.html.md | 20 + docs/pages/DRACOExporter.html | 20 +- docs/pages/DRACOExporter.html.md | 15 +- docs/pages/DRACOLoader.html | 12 +- docs/pages/DRACOLoader.html.md | 11 +- docs/pages/DataTextureLoader.html | 23 + docs/pages/DataTextureLoader.html.md | 10 + docs/pages/ExternalTexture.html | 4 +- docs/pages/ExternalTexture.html.md | 2 - docs/pages/FaceFrame.html | 46 + docs/pages/FaceFrame.html.md | 21 + docs/pages/FirstPersonControls.html | 8 + docs/pages/FirstPersonControls.html.md | 6 + docs/pages/ForestGenerator.html | 47 + docs/pages/ForestGenerator.html.md | 20 + docs/pages/FrustumArray.html | 90 +- docs/pages/FrustumArray.html.md | 64 +- docs/pages/GLTFExporter.html | 5 +- docs/pages/GLTFExporter.html.md | 4 +- docs/pages/InstanceNode.html | 209 --- docs/pages/InstanceNode.html.md | 115 -- docs/pages/InstancedMesh.html | 8 - docs/pages/InstancedMesh.html.md | 6 - docs/pages/InstancedMeshNode.html | 57 - docs/pages/InstancedMeshNode.html.md | 25 - docs/pages/KTX2Loader.html | 4 +- docs/pages/KTX2Loader.html.md | 4 +- docs/pages/LWOLoader.html | 3 + docs/pages/LWOLoader.html.md | 2 + docs/pages/LightProbeGrid.html | 14 +- docs/pages/LightProbeGrid.html.md | 8 +- docs/pages/LightingContextNode.html | 13 +- docs/pages/LightingContextNode.html.md | 8 +- docs/pages/LightsNode.html | 61 +- docs/pages/LightsNode.html.md | 30 +- docs/pages/Line2NodeMaterial.html | 28 +- docs/pages/Line2NodeMaterial.html.md | 22 +- docs/pages/LineBasicMaterial.html | 3 + docs/pages/LineBasicMaterial.html.md | 2 + docs/pages/LoftGeometry.html | 132 ++ docs/pages/LoftGeometry.html.md | 80 + docs/pages/Material.html | 29 + docs/pages/Material.html.md | 14 + docs/pages/MaterialLoader.html | 27 + docs/pages/MaterialLoader.html.md | 12 + docs/pages/Matrix3.html | 9 + docs/pages/Matrix3.html.md | 6 + docs/pages/Matrix4.html | 13 + docs/pages/Matrix4.html.md | 10 + docs/pages/MeshBasicMaterial.html | 18 + docs/pages/MeshBasicMaterial.html.md | 12 + docs/pages/MeshDepthMaterial.html | 7 + docs/pages/MeshDepthMaterial.html.md | 6 + docs/pages/MeshDistanceMaterial.html | 7 + docs/pages/MeshDistanceMaterial.html.md | 6 + docs/pages/MeshLambertMaterial.html | 27 + docs/pages/MeshLambertMaterial.html.md | 20 + docs/pages/MeshMatcapMaterial.html | 16 + docs/pages/MeshMatcapMaterial.html.md | 12 + docs/pages/MeshNormalMaterial.html | 4 + docs/pages/MeshNormalMaterial.html.md | 4 + docs/pages/MeshPhongMaterial.html | 27 + docs/pages/MeshPhongMaterial.html.md | 20 + docs/pages/MeshPhysicalMaterial.html | 26 + docs/pages/MeshPhysicalMaterial.html.md | 24 + docs/pages/MeshStandardMaterial.html | 28 + docs/pages/MeshStandardMaterial.html.md | 22 + docs/pages/MeshToonMaterial.html | 22 + docs/pages/MeshToonMaterial.html.md | 18 + docs/pages/MorphNode.html | 115 -- docs/pages/MorphNode.html.md | 57 - docs/pages/Node.html | 3 +- docs/pages/Node.html.md | 2 +- docs/pages/NodeBuilder.html | 41 +- docs/pages/NodeBuilder.html.md | 26 +- docs/pages/NodeMaterial.html | 52 +- docs/pages/NodeMaterial.html.md | 40 +- docs/pages/NodeMaterialObserver.html | 2 +- docs/pages/NodeMaterialObserver.html.md | 2 +- docs/pages/Object3D.html | 12 +- docs/pages/Object3D.html.md | 8 +- docs/pages/OverrideContextNode.html | 95 ++ docs/pages/OverrideContextNode.html.md | 56 + docs/pages/PLYExporter.html | 13 + docs/pages/PLYExporter.html.md | 5 + docs/pages/PassNode.html | 18 - docs/pages/PassNode.html.md | 8 - docs/pages/PointsMaterial.html | 5 + docs/pages/PointsMaterial.html.md | 4 + docs/pages/PropertyNode.html | 18 +- docs/pages/PropertyNode.html.md | 14 +- docs/pages/RTTNode.html | 28 +- docs/pages/RTTNode.html.md | 22 +- docs/pages/Rhino3dmLoader.html | 2 +- docs/pages/Rhino3dmLoader.html.md | 2 +- docs/pages/SSGINode.html | 17 +- docs/pages/SSGINode.html.md | 14 +- docs/pages/SSSNode.html | 4 +- docs/pages/SSSNode.html.md | 4 +- docs/pages/ShaderMaterial.html | 33 + docs/pages/ShaderMaterial.html.md | 18 + docs/pages/SidewalkGenerator.html | 43 + docs/pages/SidewalkGenerator.html.md | 20 + docs/pages/Skeleton.html | 8 - docs/pages/Skeleton.html.md | 6 - docs/pages/SkinningNode.html | 286 ---- docs/pages/SkinningNode.html.md | 157 -- docs/pages/SkyscraperGenerator.html | 47 + docs/pages/SkyscraperGenerator.html.md | 22 + docs/pages/SpriteMaterial.html | 5 + docs/pages/SpriteMaterial.html.md | 4 + docs/pages/StandardNodeLibrary.html | 39 + docs/pages/StandardNodeLibrary.html.md | 15 + docs/pages/TSL.html | 599 +++++--- docs/pages/TSL.html.md | 353 +++-- docs/pages/TerrainGenerator.html | 49 + docs/pages/TerrainGenerator.html.md | 24 + docs/pages/TileCreasedNormalsPlugin.html | 109 ++ docs/pages/TileCreasedNormalsPlugin.html.md | 61 + docs/pages/TiledLighting.html | 77 - docs/pages/TiledLighting.html.md | 50 - docs/pages/TiledLightsNode.html | 79 - docs/pages/TiledLightsNode.html.md | 49 - docs/pages/TimestampQueryPool.html | 2 +- docs/pages/TimestampQueryPool.html.md | 2 +- docs/pages/TreeGenerator.html | 50 + docs/pages/TreeGenerator.html.md | 25 + docs/pages/USDLoader.html | 11 +- docs/pages/USDLoader.html.md | 8 +- docs/pages/USDZExporter.html | 23 + docs/pages/USDZExporter.html.md | 14 + docs/pages/ViewHelper.html | 7 + docs/pages/ViewHelper.html.md | 4 + docs/pages/global.html | 536 +++++++ docs/pages/global.html.md | 268 ++++ docs/pages/module-GroundedSkybox.html | 62 + docs/pages/module-GroundedSkybox.html.md | 29 + docs/scripts/page.js | 10 +- docs/search.json | 954 ++++++++---- 157 files changed, 6878 insertions(+), 2624 deletions(-) delete mode 100644 docs/pages/AnamorphicNode.html delete mode 100644 docs/pages/AnamorphicNode.html.md create mode 100644 docs/pages/Backend.html create mode 100644 docs/pages/Backend.html.md delete mode 100644 docs/pages/BatchNode.html delete mode 100644 docs/pages/BatchNode.html.md create mode 100644 docs/pages/CityGenerator.html create mode 100644 docs/pages/CityGenerator.html.md create mode 100644 docs/pages/FaceFrame.html create mode 100644 docs/pages/FaceFrame.html.md create mode 100644 docs/pages/ForestGenerator.html create mode 100644 docs/pages/ForestGenerator.html.md delete mode 100644 docs/pages/InstanceNode.html delete mode 100644 docs/pages/InstanceNode.html.md delete mode 100644 docs/pages/InstancedMeshNode.html delete mode 100644 docs/pages/InstancedMeshNode.html.md create mode 100644 docs/pages/LoftGeometry.html create mode 100644 docs/pages/LoftGeometry.html.md delete mode 100644 docs/pages/MorphNode.html delete mode 100644 docs/pages/MorphNode.html.md create mode 100644 docs/pages/OverrideContextNode.html create mode 100644 docs/pages/OverrideContextNode.html.md create mode 100644 docs/pages/SidewalkGenerator.html create mode 100644 docs/pages/SidewalkGenerator.html.md delete mode 100644 docs/pages/SkinningNode.html delete mode 100644 docs/pages/SkinningNode.html.md create mode 100644 docs/pages/SkyscraperGenerator.html create mode 100644 docs/pages/SkyscraperGenerator.html.md create mode 100644 docs/pages/StandardNodeLibrary.html create mode 100644 docs/pages/StandardNodeLibrary.html.md create mode 100644 docs/pages/TerrainGenerator.html create mode 100644 docs/pages/TerrainGenerator.html.md create mode 100644 docs/pages/TileCreasedNormalsPlugin.html create mode 100644 docs/pages/TileCreasedNormalsPlugin.html.md delete mode 100644 docs/pages/TiledLighting.html delete mode 100644 docs/pages/TiledLighting.html.md delete mode 100644 docs/pages/TiledLightsNode.html delete mode 100644 docs/pages/TiledLightsNode.html.md create mode 100644 docs/pages/TreeGenerator.html create mode 100644 docs/pages/TreeGenerator.html.md create mode 100644 docs/pages/module-GroundedSkybox.html create mode 100644 docs/pages/module-GroundedSkybox.html.md diff --git a/docs/index.html b/docs/index.html index a9ef2897978655..0da8d36579ea89 100644 --- a/docs/index.html +++ b/docs/index.html @@ -292,7 +292,6 @@

Nodes

  • BasicEnvironmentNode
  • BasicLightMapNode
  • BasicLightingModel
  • -
  • BatchNode
  • BitcastNode
  • BitcountNode
  • BufferAttributeNode
  • @@ -327,8 +326,6 @@

    Nodes

  • IndexNode
  • InputNode
  • InspectorNode
  • -
  • InstanceNode
  • -
  • InstancedMeshNode
  • IrradianceNode
  • IsolateNode
  • JoinNode
  • @@ -345,7 +342,6 @@

    Nodes

  • MaxMipLevelNode
  • MemberNode
  • ModelNode
  • -
  • MorphNode
  • Node
  • NodeAttribute
  • NodeBuilder
  • @@ -363,6 +359,7 @@

    Nodes

  • Object3DNode
  • OperatorNode
  • OutputStructNode
  • +
  • OverrideContextNode
  • PMREMNode
  • PackFloatNode
  • ParameterNode
  • @@ -392,7 +389,6 @@

    Nodes

  • ShadowBaseNode
  • ShadowMaskModel
  • ShadowNode
  • -
  • SkinningNode
  • SplitNode
  • SpotLightNode
  • StackNode
  • @@ -449,6 +445,7 @@

    Objects

    Renderers

    +

    Generators

    +

    Geometries

    Lights

    Textures

    @@ -995,9 +1003,10 @@

    TSL

  • afterImage
  • agxToneMapping
  • all
  • +
  • alphaLine
  • alphaT
  • +
  • ambientOcclusion
  • anaglyphPass
  • -
  • anamorphic
  • and
  • anisotropy
  • anisotropyB
  • @@ -1079,7 +1088,6 @@

    TSL

  • chromaticAberration
  • cineonToneMapping
  • circle
  • -
  • circleIntersectsAABB
  • clamp
  • clearcoat
  • clearcoatNormalView
  • @@ -1091,7 +1099,7 @@

    TSL

  • code
  • colorBleeding
  • colorSpaceToWorking
  • -
  • unpackRGBToNormal
  • +
  • colorToDirection
  • compute
  • computeBuiltin
  • computeKernel
  • @@ -1109,6 +1117,7 @@

    TSL

  • cubeMapNode
  • cubeTexture
  • cubeTextureBase
  • +
  • curlNoise
  • dFdx
  • dFdy
  • dashSize
  • @@ -1126,7 +1135,7 @@

    TSL

  • difference
  • diffuseColor
  • diffuseContribution
  • -
  • packNormalToRGB
  • +
  • directionToColor
  • directionToFaceDirection
  • dispersion
  • distance
  • @@ -1139,6 +1148,7 @@

    TSL

  • dynamicLights
  • emissive
  • equal
  • +
  • equirectDirection
  • equirectUV
  • exp
  • exp2
  • @@ -1286,7 +1296,9 @@

    TSL

  • motionBlur
  • mrt
  • mul
  • +
  • mvpLine
  • negate
  • +
  • negateOnBackSide
  • neutralToneMapping
  • normalFlat
  • normalGeometry
  • @@ -1318,7 +1330,10 @@

    TSL

  • output
  • outputStruct
  • overloadingFn
  • +
  • overrideNode
  • +
  • overrideNodes
  • packHalf2x16
  • +
  • packNormalToRGB
  • packSnorm2x16
  • packUnorm2x16
  • parabola
  • @@ -1329,6 +1344,7 @@

    TSL

  • pass
  • passTexture
  • pcurve
  • +
  • permute
  • perspectiveDepthToViewZ
  • pixelationPass
  • pmremTexture
  • @@ -1415,6 +1431,8 @@

    TSL

  • smaa
  • smoothstep
  • smoothstepElement
  • +
  • snoise
  • +
  • snoiseVec3
  • sobel
  • specularColor
  • specularColorBlended
  • @@ -1481,7 +1499,6 @@

    TSL

  • textureSize
  • textureStore
  • thickness
  • -
  • tiledLights
  • time
  • toneMapping
  • toneMappingExposure
  • @@ -1489,6 +1506,8 @@

    TSL

  • traa
  • transformDirection
  • transformNormal
  • +
  • transformNormalByInverseViewMatrix
  • +
  • transformNormalByViewMatrix
  • transformNormalToView
  • transformedClearcoatNormalView
  • transformedNormalView
  • @@ -1509,6 +1528,7 @@

    TSL

  • uniformTexture
  • unpackHalf2x16
  • unpackNormal
  • +
  • unpackRGBToNormal
  • unpackSnorm2x16
  • unpackUnorm2x16
  • unpremultiplyAlpha
  • @@ -1777,14 +1797,30 @@

    Global

  • ZeroFactor
  • ZeroSlopeEnding
  • ZeroStencilOp
  • +
  • addArcade
  • +
  • addCornice
  • +
  • addParapet
  • +
  • addSpandrelBands
  • +
  • bakeGroups
  • +
  • batchColor
  • buildData3DTexture
  • +
  • buildFaces
  • +
  • buildFootprint
  • buildMesh
  • +
  • buildingPalette
  • ceilPowerOfTwo
  • +
  • closestLineToLine
  • contain
  • convertArray
  • cover
  • +
  • createBuildingMaterial
  • createCanvasElement
  • createEvent
  • +
  • createForestMaterial
  • +
  • createInstanceMatrixNode
  • +
  • createRoadMaterial
  • +
  • createSkyscraperMaterial
  • +
  • createTreeMaterial
  • damp
  • degToRad
  • denormalize
  • @@ -1800,27 +1836,39 @@

    Global

  • generateMagicSquare
  • generateMagicSquareNoise
  • generateUUID
  • +
  • getBatchingColor
  • getByteLength
  • getCacheKey
  • getConsoleFunction
  • getDistanceAttenuation
  • getElementsByTagName
  • +
  • getEntry
  • getFilteredStack
  • getFloatLength
  • getFormat
  • +
  • getIndirectIndex
  • getKeyframeOrder
  • getMembersLayout
  • +
  • getMorph
  • +
  • getPreviousInstance
  • +
  • getPreviousSkinnedPosition
  • +
  • getSkinnedNormalAndTangent
  • +
  • getSkinnedPosition
  • getStrideLength
  • getTextureIndex
  • getUniforms
  • getVectorLength
  • getViewZNode
  • +
  • instanceColor
  • inverseLerp
  • isPowerOfTwo
  • isTypedArray
  • lerp
  • +
  • lineDistance
  • makeClipAdditive
  • mapLinear
  • +
  • outgoingLight
  • +
  • pickBuildingColor
  • pingpong
  • radToDeg
  • randFloat
  • @@ -1833,15 +1881,22 @@

    Global

  • setQuaternionFromProperEuler
  • setupWebGLXRFallback
  • shadowRenderObjectFunction
  • +
  • slab
  • smootherstep
  • sortedArray
  • subclip
  • toHalfFloat
  • +
  • totalDiffuse
  • +
  • totalSpecular
  • +
  • trimSegmentAlpha
  • updateCamera
  • updateUserCamera
  • viewportResolution
  • warn
  • warnOnce
  • +
  • worldEnd
  • +
  • worldPos
  • +
  • worldStart
  • yieldToMain
  • diff --git a/docs/llms-full.txt b/docs/llms-full.txt index c230cbb482493c..45b95ec6cbd95f 100644 --- a/docs/llms-full.txt +++ b/docs/llms-full.txt @@ -18,8 +18,8 @@ CORRECT - modern pattern (always use latest version): @@ -100,8 +100,8 @@ When using TSL, use node-based materials: @@ -175,9 +175,9 @@ renderer.setAnimationLoop( animate ); @@ -322,6 +322,7 @@ An Approach to Productive and Maintainable Shader Creation. - [Storage](#storage) - [Struct](#struct) - [Flow Control](#flow-control) +- [Override Node](#override-node) - [Fog](#fog) - [Color Adjustments](#color-adjustments) - [Utilities](#utilities) @@ -760,7 +761,7 @@ It's possible use `xyzw`, `rgba` or `stpq`. | Name | Description | | -- | -- | | `.add( node \| value, ... )` | Return the addition of two or more value. | -| `.sub( node \| value )` | Return the subraction of two or more value. | +| `.sub( node \| value )` | Return the subtraction of two or more value. | | `.mul( node \| value )` | Return the multiplication of two or more value. | | `.div( node \| value )` | Return the division of two or more value. | | `.mod( node \| value )` | Computes the remainder of dividing the first node by the second. | @@ -1173,6 +1174,8 @@ The module also provides `Break()` and `Continue()` TSL expression for loop cont | `step( edge, x )` | Generate a step function by comparing two values. | | `tan( x )` | Return the tangent of the parameter. | | `transformDirection( dir, matrix )` | Transform the direction of a vector by a matrix and then normalize the result. | +| `transformNormalByViewMatrix( normal, viewMatrix )` | Transform a normal vector (given in world space) by the view matrix and normalize the result. | +| `transformNormalByInverseViewMatrix( normal, viewMatrix )` | Transform a normal vector (given in view space) by the inverse of the view matrix and normalize the result. | | `trunc( x )` | Truncate the parameter, removing the fractional part. | ```js @@ -1356,6 +1359,7 @@ Screen nodes will return the values related to the current `frame buffer`, eithe | `spherizeUV( uv, strength, centerNode = vec2( 0.5 ) )` | Distorts UV coordinates with a spherical effect around a center point. | `vec2` | | `spritesheetUV( count, uv = uv(), frame = float( 0 ) )` | Computes UV coordinates for a sprite sheet based on the number of frames, UV coordinates, and frame index. | `vec2` | | `equirectUV( direction = positionWorldDirection )` | Computes UV coordinates for equirectangular mapping based on the direction vector. | `vec2` | +| `equirectDirection( uv = uv() )` | Computes a direction vector from the given equirectangular UV coordinates (inverse of `equirectUV`). | `vec3` | ```js import { texture, matcapUV } from 'three/tsl'; @@ -1404,7 +1408,7 @@ const matcap = texture( matcapMap, matcapUV ); | Variable | Description | Type | | -- | -- | -- | | `packNormalToRGB( value )` | Converts normal vector to color. | `color` | -| `unpackRGBToNormal( value )` | Converts color to normal vector. | `vec3` | +| `unpackRGBToNormal( value )` | Converts color to normal vector. | `vec3` | ## Render Pipeline @@ -1448,7 +1452,7 @@ const scenePass = pass( scene, camera ); scenePass.setMRT( mrt( { output: output, // Final color output - normal: packNormalToRGB( normalView ), // View-space normals encoded as colors + normal: packNormalToRGB( normalView ), // View-space normals encoded as colors velocity: velocity // Motion vectors for temporal effects } ) ); ``` @@ -1690,6 +1694,33 @@ const customFragment = Fn( () => { material.colorNode = customFragment(); ``` +## Override Node + +Override nodes allow you to replace specific target nodes within a node sub-graph or flow dynamically during compilation, without having to reconstruct or duplicate the source nodes. This is useful, for example, to inject a custom `positionLocal` or normal into an existing flow through the material's `contextNode`. + +| Name | Description | +| -- | -- | +| `overrideNode( targetNode, callback = null, flowNode = null )` | Overrides a single target node. `callback` returns the overriding node (receiving the builder as argument) or can be the overriding node itself. | +| `overrideNodes( overrides, flowNode = null )` | Overrides multiple target nodes at once using a `Map` or an array of `[ targetNode, callback \| node ]` pairs. | + +Example: + +```js +import { overrideNode, overrideNodes, positionLocal, positionView, vec3 } from 'three/tsl'; + +// Override a single node through the material context +material.contextNode = overrideNode( positionLocal, () => positionLocal.add( vec3( 1, 0, 0 ) ) ); + +// Override multiple nodes at once +material.contextNode = overrideNodes( [ + [ positionView, customPositionView ], // You can use a node directly like customPositionView. + [ positionLocal, ( builder ) => positionLocal.add( vec3( 1, 0, 0 ) ) ] +] ); + +// Method chaining is also supported +node.overrideNode( positionLocal, () => positionLocal.add( vec3( 1, 0, 0 ) ) ); +``` + ## Fog Functions for creating fog effects in the scene. Assign the fog node to `scene.fogNode`. @@ -1747,6 +1778,7 @@ Utility functions for common shader tasks. | -- | -- | -- | | `billboarding( { position, horizontal, vertical } )` | Orients flat meshes always towards the camera. `position`: vertex positions in world space (default: `null`). `horizontal`: follow camera horizontally (default: `true`). `vertical`: follow camera vertically (default: `false`). | `vec3` | | `checker( coord )` | Creates a 2x2 checkerboard pattern. | `float` | +| `negateOnBackSide( vector )` | Negates a vector when rendering the back side of a face, according to the material's `side` configuration (`BackSide`, `DoubleSide` or `FrontSide`). | `vec3` | Example: @@ -1898,6 +1930,7 @@ The following documentation pages are available in markdown format at `https://t - [ARButton](https://threejs.org/docs/pages/ARButton.html.md) - [AmmoPhysics](https://threejs.org/docs/pages/AmmoPhysics.html.md) +- [Backend](https://threejs.org/docs/pages/Backend.html.md) - [BasicLightingModel](https://threejs.org/docs/pages/BasicLightingModel.html.md) - [BatchedMesh](https://threejs.org/docs/pages/BatchedMesh.html.md) - [BezierInterpolant](https://threejs.org/docs/pages/BezierInterpolant.html.md) @@ -1919,6 +1952,7 @@ The following documentation pages are available in markdown format at `https://t - [CanvasTarget](https://threejs.org/docs/pages/CanvasTarget.html.md) - [Capsule](https://threejs.org/docs/pages/Capsule.html.md) - [CinquefoilKnot](https://threejs.org/docs/pages/CinquefoilKnot.html.md) +- [CityGenerator](https://threejs.org/docs/pages/CityGenerator.html.md) - [ClippingGroup](https://threejs.org/docs/pages/ClippingGroup.html.md) - [Clock](https://threejs.org/docs/pages/Clock.html.md) - [ClusteredLighting](https://threejs.org/docs/pages/ClusteredLighting.html.md) @@ -1946,6 +1980,7 @@ The following documentation pages are available in markdown format at `https://t - [EdgeSplitModifier](https://threejs.org/docs/pages/EdgeSplitModifier.html.md) - [EffectComposer](https://threejs.org/docs/pages/EffectComposer.html.md) - [EventDispatcher](https://threejs.org/docs/pages/EventDispatcher.html.md) +- [FaceFrame](https://threejs.org/docs/pages/FaceFrame.html.md) - [FigureEightPolynomialKnot](https://threejs.org/docs/pages/FigureEightPolynomialKnot.html.md) - [Float16BufferAttribute](https://threejs.org/docs/pages/Float16BufferAttribute.html.md) - [Float32BufferAttribute](https://threejs.org/docs/pages/Float32BufferAttribute.html.md) @@ -1953,6 +1988,7 @@ The following documentation pages are available in markdown format at `https://t - [Fog](https://threejs.org/docs/pages/Fog.html.md) - [FogExp2](https://threejs.org/docs/pages/FogExp2.html.md) - [Font](https://threejs.org/docs/pages/Font.html.md) +- [ForestGenerator](https://threejs.org/docs/pages/ForestGenerator.html.md) - [FullScreenQuad](https://threejs.org/docs/pages/FullScreenQuad.html.md) - [GLBufferAttribute](https://threejs.org/docs/pages/GLBufferAttribute.html.md) - [GLSLNodeBuilder](https://threejs.org/docs/pages/GLSLNodeBuilder.html.md) @@ -2073,31 +2109,36 @@ The following documentation pages are available in markdown format at `https://t - [Shape](https://threejs.org/docs/pages/Shape.html.md) - [ShapePath](https://threejs.org/docs/pages/ShapePath.html.md) - [ShapeUtils](https://threejs.org/docs/pages/ShapeUtils.html.md) +- [SidewalkGenerator](https://threejs.org/docs/pages/SidewalkGenerator.html.md) - [SimplexNoise](https://threejs.org/docs/pages/SimplexNoise.html.md) - [SimplifyModifier](https://threejs.org/docs/pages/SimplifyModifier.html.md) - [Skeleton](https://threejs.org/docs/pages/Skeleton.html.md) - [SkinnedMesh](https://threejs.org/docs/pages/SkinnedMesh.html.md) - [Sky](https://threejs.org/docs/pages/Sky.html.md) - [SkyMesh](https://threejs.org/docs/pages/SkyMesh.html.md) +- [SkyscraperGenerator](https://threejs.org/docs/pages/SkyscraperGenerator.html.md) - [Source](https://threejs.org/docs/pages/Source.html.md) - [Spherical](https://threejs.org/docs/pages/Spherical.html.md) - [SphericalHarmonics3](https://threejs.org/docs/pages/SphericalHarmonics3.html.md) - [SpotLightShadow](https://threejs.org/docs/pages/SpotLightShadow.html.md) - [Sprite](https://threejs.org/docs/pages/Sprite.html.md) - [StackTrace](https://threejs.org/docs/pages/StackTrace.html.md) +- [StandardNodeLibrary](https://threejs.org/docs/pages/StandardNodeLibrary.html.md) - [StorageBufferAttribute](https://threejs.org/docs/pages/StorageBufferAttribute.html.md) - [StorageInstancedBufferAttribute](https://threejs.org/docs/pages/StorageInstancedBufferAttribute.html.md) - [StringKeyframeTrack](https://threejs.org/docs/pages/StringKeyframeTrack.html.md) - [TSL](https://threejs.org/docs/pages/TSL.html.md) - [Tab](https://threejs.org/docs/pages/Tab.html.md) +- [TerrainGenerator](https://threejs.org/docs/pages/TerrainGenerator.html.md) - [TessellateModifier](https://threejs.org/docs/pages/TessellateModifier.html.md) - [TextureUtils](https://threejs.org/docs/pages/TextureUtils.html.md) -- [TiledLighting](https://threejs.org/docs/pages/TiledLighting.html.md) +- [TileCreasedNormalsPlugin](https://threejs.org/docs/pages/TileCreasedNormalsPlugin.html.md) - [Timer](https://threejs.org/docs/pages/Timer.html.md) - [TimestampQueryPool](https://threejs.org/docs/pages/TimestampQueryPool.html.md) - [ToonLightingModel](https://threejs.org/docs/pages/ToonLightingModel.html.md) - [TorusKnot](https://threejs.org/docs/pages/TorusKnot.html.md) - [Transpiler](https://threejs.org/docs/pages/Transpiler.html.md) +- [TreeGenerator](https://threejs.org/docs/pages/TreeGenerator.html.md) - [TrefoilKnot](https://threejs.org/docs/pages/TrefoilKnot.html.md) - [TrefoilPolynomialKnot](https://threejs.org/docs/pages/TrefoilPolynomialKnot.html.md) - [TubePainter](https://threejs.org/docs/pages/TubePainter.html.md) @@ -2215,6 +2256,7 @@ The following documentation pages are available in markdown format at `https://t - [LatheGeometry](https://threejs.org/docs/pages/LatheGeometry.html.md) - [LineGeometry](https://threejs.org/docs/pages/LineGeometry.html.md) - [LineSegmentsGeometry](https://threejs.org/docs/pages/LineSegmentsGeometry.html.md) +- [LoftGeometry](https://threejs.org/docs/pages/LoftGeometry.html.md) - [OctahedronGeometry](https://threejs.org/docs/pages/OctahedronGeometry.html.md) - [ParametricGeometry](https://threejs.org/docs/pages/ParametricGeometry.html.md) - [PlaneGeometry](https://threejs.org/docs/pages/PlaneGeometry.html.md) @@ -2487,7 +2529,6 @@ The following documentation pages are available in markdown format at `https://t - [AmbientLightDataNode](https://threejs.org/docs/pages/AmbientLightDataNode.html.md) - [AmbientLightNode](https://threejs.org/docs/pages/AmbientLightNode.html.md) - [AnalyticLightNode](https://threejs.org/docs/pages/AnalyticLightNode.html.md) -- [AnamorphicNode](https://threejs.org/docs/pages/AnamorphicNode.html.md) - [ArrayElementNode](https://threejs.org/docs/pages/ArrayElementNode.html.md) - [ArrayNode](https://threejs.org/docs/pages/ArrayNode.html.md) - [AssignNode](https://threejs.org/docs/pages/AssignNode.html.md) @@ -2496,7 +2537,6 @@ The following documentation pages are available in markdown format at `https://t - [BarrierNode](https://threejs.org/docs/pages/BarrierNode.html.md) - [BasicEnvironmentNode](https://threejs.org/docs/pages/BasicEnvironmentNode.html.md) - [BasicLightMapNode](https://threejs.org/docs/pages/BasicLightMapNode.html.md) -- [BatchNode](https://threejs.org/docs/pages/BatchNode.html.md) - [BilateralBlurNode](https://threejs.org/docs/pages/BilateralBlurNode.html.md) - [BitcastNode](https://threejs.org/docs/pages/BitcastNode.html.md) - [BitcountNode](https://threejs.org/docs/pages/BitcountNode.html.md) @@ -2546,8 +2586,6 @@ The following documentation pages are available in markdown format at `https://t - [IndexNode](https://threejs.org/docs/pages/IndexNode.html.md) - [InputNode](https://threejs.org/docs/pages/InputNode.html.md) - [InspectorNode](https://threejs.org/docs/pages/InspectorNode.html.md) -- [InstanceNode](https://threejs.org/docs/pages/InstanceNode.html.md) -- [InstancedMeshNode](https://threejs.org/docs/pages/InstancedMeshNode.html.md) - [IrradianceNode](https://threejs.org/docs/pages/IrradianceNode.html.md) - [IsolateNode](https://threejs.org/docs/pages/IsolateNode.html.md) - [JoinNode](https://threejs.org/docs/pages/JoinNode.html.md) @@ -2565,13 +2603,13 @@ The following documentation pages are available in markdown format at `https://t - [MaxMipLevelNode](https://threejs.org/docs/pages/MaxMipLevelNode.html.md) - [MemberNode](https://threejs.org/docs/pages/MemberNode.html.md) - [ModelNode](https://threejs.org/docs/pages/ModelNode.html.md) -- [MorphNode](https://threejs.org/docs/pages/MorphNode.html.md) - [Node](https://threejs.org/docs/pages/Node.html.md) - [NormalMapNode](https://threejs.org/docs/pages/NormalMapNode.html.md) - [Object3DNode](https://threejs.org/docs/pages/Object3DNode.html.md) - [OperatorNode](https://threejs.org/docs/pages/OperatorNode.html.md) - [OutlineNode](https://threejs.org/docs/pages/OutlineNode.html.md) - [OutputStructNode](https://threejs.org/docs/pages/OutputStructNode.html.md) +- [OverrideContextNode](https://threejs.org/docs/pages/OverrideContextNode.html.md) - [PMREMNode](https://threejs.org/docs/pages/PMREMNode.html.md) - [PackFloatNode](https://threejs.org/docs/pages/PackFloatNode.html.md) - [ParameterNode](https://threejs.org/docs/pages/ParameterNode.html.md) @@ -2605,7 +2643,6 @@ The following documentation pages are available in markdown format at `https://t - [ShadowBaseNode](https://threejs.org/docs/pages/ShadowBaseNode.html.md) - [ShadowNode](https://threejs.org/docs/pages/ShadowNode.html.md) - [SharpenNode](https://threejs.org/docs/pages/SharpenNode.html.md) -- [SkinningNode](https://threejs.org/docs/pages/SkinningNode.html.md) - [SobelOperatorNode](https://threejs.org/docs/pages/SobelOperatorNode.html.md) - [SplitNode](https://threejs.org/docs/pages/SplitNode.html.md) - [SpotLightDataNode](https://threejs.org/docs/pages/SpotLightDataNode.html.md) @@ -2626,7 +2663,6 @@ The following documentation pages are available in markdown format at `https://t - [TextureNode](https://threejs.org/docs/pages/TextureNode.html.md) - [TextureSizeNode](https://threejs.org/docs/pages/TextureSizeNode.html.md) - [TileShadowNode](https://threejs.org/docs/pages/TileShadowNode.html.md) -- [TiledLightsNode](https://threejs.org/docs/pages/TiledLightsNode.html.md) - [ToneMappingNode](https://threejs.org/docs/pages/ToneMappingNode.html.md) - [TransitionNode](https://threejs.org/docs/pages/TransitionNode.html.md) - [UniformArrayElementNode](https://threejs.org/docs/pages/UniformArrayElementNode.html.md) @@ -2694,6 +2730,7 @@ The following documentation pages are available in markdown format at `https://t - [module-GammaCorrectionShader](https://threejs.org/docs/pages/module-GammaCorrectionShader.html.md) - [module-GeometryCompressionUtils](https://threejs.org/docs/pages/module-GeometryCompressionUtils.html.md) - [module-GeometryUtils](https://threejs.org/docs/pages/module-GeometryUtils.html.md) +- [module-GroundedSkybox](https://threejs.org/docs/pages/module-GroundedSkybox.html.md) - [module-HalftoneShader](https://threejs.org/docs/pages/module-HalftoneShader.html.md) - [module-HorizontalBlurShader](https://threejs.org/docs/pages/module-HorizontalBlurShader.html.md) - [module-HorizontalTiltShiftShader](https://threejs.org/docs/pages/module-HorizontalTiltShiftShader.html.md) diff --git a/docs/llms.txt b/docs/llms.txt index 2e63af0cdfd498..704900d06dead9 100644 --- a/docs/llms.txt +++ b/docs/llms.txt @@ -18,8 +18,8 @@ CORRECT - modern pattern (always use latest version): diff --git a/docs/pages/ARButton.html b/docs/pages/ARButton.html index 54653b09b49141..bfae40029ab1f8 100644 --- a/docs/pages/ARButton.html +++ b/docs/pages/ARButton.html @@ -14,7 +14,7 @@

    ARButton

    A utility class for creating a button that allows to initiate immersive AR sessions based on WebXR. The button can be created -with a factory method and then appended ot the website's DOM.

    +with a factory method and then appended to the website's DOM.

    Code Example

    document.body.appendChild( ARButton.createButton( renderer ) );
     
    diff --git a/docs/pages/ARButton.html.md b/docs/pages/ARButton.html.md index 2f190e000a3a8b..1f6102995fe3a5 100644 --- a/docs/pages/ARButton.html.md +++ b/docs/pages/ARButton.html.md @@ -1,6 +1,6 @@ # ARButton -A utility class for creating a button that allows to initiate immersive AR sessions based on WebXR. The button can be created with a factory method and then appended ot the website's DOM. +A utility class for creating a button that allows to initiate immersive AR sessions based on WebXR. The button can be created with a factory method and then appended to the website's DOM. ## Code Example diff --git a/docs/pages/AmmoPhysics.html b/docs/pages/AmmoPhysics.html index 44ce68af212448..c8295b305be1d6 100644 --- a/docs/pages/AmmoPhysics.html +++ b/docs/pages/AmmoPhysics.html @@ -13,11 +13,11 @@

    AmmoPhysics

    Can be used to include Ammo.js as a Physics engine into -three.js apps. Make sure to include ammo.wasm.js first:

    -
    <script src="jsm/libs/ammo.wasm.js"></script>
    -
    -

    It is then possible to initialize the API via:

    -
    const physics = await AmmoPhysics();
    +three.js apps. The API can be initialized via:

    +

    The component automatically imports Ammo.js from a CDN so make sure +to use the component with an active Internet connection.

    +

    Code Example

    +
    const physics = await AmmoPhysics();
     
    diff --git a/docs/pages/AmmoPhysics.html.md b/docs/pages/AmmoPhysics.html.md index 8fdb3f0af19cdf..c9f82be653e8e5 100644 --- a/docs/pages/AmmoPhysics.html.md +++ b/docs/pages/AmmoPhysics.html.md @@ -1,12 +1,10 @@ # AmmoPhysics -Can be used to include Ammo.js as a Physics engine into `three.js` apps. Make sure to include `ammo.wasm.js` first: +Can be used to include Ammo.js as a Physics engine into `three.js` apps. The API can be initialized via: -```js - -``` +The component automatically imports Ammo.js from a CDN so make sure to use the component with an active Internet connection. -It is then possible to initialize the API via: +## Code Example ```js const physics = await AmmoPhysics(); diff --git a/docs/pages/AnamorphicNode.html b/docs/pages/AnamorphicNode.html deleted file mode 100644 index d5546a6c3ff76b..00000000000000 --- a/docs/pages/AnamorphicNode.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - - AnamorphicNode - Three.js Docs - - - - - - -

    EventDispatcherNodeTempNode

    -

    AnamorphicNode

    -
    -
    -

    Post processing node for adding an anamorphic flare effect.

    -
    -
    -

    Import

    -

    AnamorphicNode is an addon, and must be imported explicitly, see Installation#Addons.

    -
    import { anamorphic } from 'three/addons/tsl/display/AnamorphicNode.js';
    -
    -

    Constructor

    -

    new AnamorphicNode( textureNode : TextureNode, thresholdNode : Node.<float>, scaleNode : Node.<float>, samples : number )

    -
    -
    -

    Constructs a new anamorphic node.

    -
    - - - - - - - - - - - - - - - - - - - -
    - textureNode - -

    The texture node that represents the input of the effect.

    -
    - thresholdNode - -

    The threshold is one option to control the intensity and size of the effect.

    -
    - scaleNode - -

    Defines the vertical scale of the flares.

    -
    - samples - -

    More samples result in larger flares and a more expensive runtime behavior.

    -
    -
    -
    -

    Properties

    -
    -

    .colorNode : Node.<vec3>

    -
    -

    The color of the flares.

    -
    -
    -
    -

    .resolution : Vector2

    -
    -

    The resolution scale.

    -

    Default is {(1,1)}.

    -
    -
    -
    Deprecated: Yes
    -
    -
    -
    -

    .resolutionScale : number

    -
    -

    The resolution scale.

    -
    -
    -
    -

    .samples : Node.<float>

    -
    -

    More samples result in larger flares and a more expensive runtime behavior.

    -
    -
    -
    -

    .scaleNode : Node.<float>

    -
    -

    Defines the vertical scale of the flares.

    -
    -
    -
    -

    .textureNode : TextureNode

    -
    -

    The texture node that represents the input of the effect.

    -
    -
    -
    -

    .thresholdNode : Node.<float>

    -
    -

    The threshold is one option to control the intensity and size of the effect.

    -
    -
    -
    -

    .updateBeforeType : string

    -
    -

    The updateBeforeType is set to NodeUpdateType.FRAME since the node renders -its effect once per frame in updateBefore().

    -

    Default is 'frame'.

    -
    -
    -
    Overrides: TempNode#updateBeforeType
    -
    -
    -

    Methods

    -

    .dispose()

    -
    -
    -

    Frees internal resources. This method should be called -when the effect is no longer required.

    -
    -
    -
    Overrides: TempNode#dispose
    -
    -
    -

    .getTextureNode() : PassTextureNode

    -
    -
    -

    Returns the result of the effect as a texture node.

    -
    -
    -
    Returns: A texture node that represents the result of the effect.
    -
    -
    -

    .setSize( width : number, height : number )

    -
    -
    -

    Sets the size of the effect.

    -
    - - - - - - - - - - - -
    - width - -

    The width of the effect.

    -
    - height - -

    The height of the effect.

    -
    -
    -

    .setup( builder : NodeBuilder ) : PassTextureNode

    -
    -
    -

    This method is used to setup the effect's TSL code.

    -
    - - - - - - - -
    - builder - -

    The current node builder.

    -
    -
    -
    Overrides: TempNode#setup
    -
    -
    -

    .updateBefore( frame : NodeFrame )

    -
    -
    -

    This method is used to render the effect once per frame.

    -
    - - - - - - - -
    - frame - -

    The current node frame.

    -
    -
    -
    Overrides: TempNode#updateBefore
    -
    -
    -

    Source

    -

    - examples/jsm/tsl/display/AnamorphicNode.js -

    -
    -
    - - - - \ No newline at end of file diff --git a/docs/pages/AnamorphicNode.html.md b/docs/pages/AnamorphicNode.html.md deleted file mode 100644 index 513c182fd1f7fb..00000000000000 --- a/docs/pages/AnamorphicNode.html.md +++ /dev/null @@ -1,127 +0,0 @@ -*Inheritance: EventDispatcher → Node → TempNode →* - -# AnamorphicNode - -Post processing node for adding an anamorphic flare effect. - -## Import - -AnamorphicNode is an addon, and must be imported explicitly, see [Installation#Addons](https://threejs.org/manual/#en/installation). - -```js -import { anamorphic } from 'three/addons/tsl/display/AnamorphicNode.js'; -``` - -## Constructor - -### new AnamorphicNode( textureNode : TextureNode, thresholdNode : Node., scaleNode : Node., samples : number ) - -Constructs a new anamorphic node. - -**textureNode** - -The texture node that represents the input of the effect. - -**thresholdNode** - -The threshold is one option to control the intensity and size of the effect. - -**scaleNode** - -Defines the vertical scale of the flares. - -**samples** - -More samples result in larger flares and a more expensive runtime behavior. - -## Properties - -### .colorNode : Node. - -The color of the flares. - -### .resolution : Vector2 - -The resolution scale. - -Default is `{(1,1)}`. - -**Deprecated:** Yes - -### .resolutionScale : number - -The resolution scale. - -### .samples : Node. - -More samples result in larger flares and a more expensive runtime behavior. - -### .scaleNode : Node. - -Defines the vertical scale of the flares. - -### .textureNode : TextureNode - -The texture node that represents the input of the effect. - -### .thresholdNode : Node. - -The threshold is one option to control the intensity and size of the effect. - -### .updateBeforeType : string - -The `updateBeforeType` is set to `NodeUpdateType.FRAME` since the node renders its effect once per frame in `updateBefore()`. - -Default is `'frame'`. - -**Overrides:** [TempNode#updateBeforeType](TempNode.html#updateBeforeType) - -## Methods - -### .dispose() - -Frees internal resources. This method should be called when the effect is no longer required. - -**Overrides:** [TempNode#dispose](TempNode.html#dispose) - -### .getTextureNode() : PassTextureNode - -Returns the result of the effect as a texture node. - -**Returns:** A texture node that represents the result of the effect. - -### .setSize( width : number, height : number ) - -Sets the size of the effect. - -**width** - -The width of the effect. - -**height** - -The height of the effect. - -### .setup( builder : NodeBuilder ) : PassTextureNode - -This method is used to setup the effect's TSL code. - -**builder** - -The current node builder. - -**Overrides:** [TempNode#setup](TempNode.html#setup) - -### .updateBefore( frame : NodeFrame ) - -This method is used to render the effect once per frame. - -**frame** - -The current node frame. - -**Overrides:** [TempNode#updateBefore](TempNode.html#updateBefore) - -## Source - -[examples/jsm/tsl/display/AnamorphicNode.js](https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/AnamorphicNode.js) \ No newline at end of file diff --git a/docs/pages/Backend.html b/docs/pages/Backend.html new file mode 100644 index 00000000000000..ac5c43ead9a7bc --- /dev/null +++ b/docs/pages/Backend.html @@ -0,0 +1,1473 @@ + + + + + Backend - Three.js Docs + + + + + + +

    Backend

    +
    +
    +

    Most of the rendering related logic is implemented in the +Renderer module and related management components. +Sometimes it is required though to execute commands which are +specific to the current 3D backend (which is WebGPU or WebGL 2). +This abstract base class defines an interface that encapsulates +all backend-related logic. Derived classes for each backend must +implement the interface.

    +
    +
    +
    +

    Constructor

    +

    new Backend( parameters : Object ) (abstract)

    +
    +
    +

    Constructs a new backend.

    +
    + + + + + + + +
    + parameters + +

    An object holding parameters for the backend.

    +
    +
    +
    +

    Properties

    +
    +

    .coordinateSystem : number (abstract, readonly)

    +
    +

    The coordinate system of the backend.

    +
    +
    +
    +

    .data : WeakMap.<Object, Object>

    +
    +

    This weak map holds backend-specific data of objects +like textures, attributes or render targets.

    +
    +
    +
    +

    .domElement : HTMLCanvasElement | OffscreenCanvas

    +
    +

    A reference to the canvas element the renderer is drawing to.

    +

    Default is null.

    +
    +
    +
    +

    .hasTimestamp : boolean (readonly)

    +
    +

    Whether the backend supports query timestamps or not.

    +
    +
    +
    +

    .parameters : Object

    +
    +

    The parameters of the backend.

    +
    +
    +
    +

    .renderer : Renderer

    +
    +

    A reference to the renderer.

    +

    Default is null.

    +
    +
    +
    +

    .timestampQueryPool : Object

    +
    +

    A reference to the timestamp query pool.

    +
    +
    +
    +

    .trackTimestamp : boolean

    +
    +

    Whether to track timestamps with a Timestamp Query API or not.

    +

    Default is false.

    +
    +
    +

    Methods

    +

    ._getQueryPool( uid : string ) : TimestampQueryPool

    +
    +
    +

    Returns the query pool for the given uid.

    +
    + + + + + + + +
    + uid + +

    The unique identifier.

    +
    +
    +
    Returns: The query pool.
    +
    +
    +

    .beginCompute( computeGroup : Node | Array.<Node> ) (abstract)

    +
    +
    +

    This method is executed at the beginning of a compute call and +can be used by the backend to prepare the state for upcoming +compute tasks.

    +
    + + + + + + + +
    + computeGroup + +

    The compute node(s).

    +
    +
    +

    .beginRender( renderContext : RenderContext ) (abstract)

    +
    +
    +

    This method is executed at the beginning of a render call and +can be used by the backend to prepare the state for upcoming +draw calls.

    +
    + + + + + + + +
    + renderContext + +

    The render context.

    +
    +
    +

    .compute( computeGroup : Node | Array.<Node>, computeNode : Node, bindings : Array.<BindGroup>, computePipeline : ComputePipeline ) (abstract)

    +
    +
    +

    Executes a compute command for the given compute node.

    +
    + + + + + + + + + + + + + + + + + + + +
    + computeGroup + +

    The group of compute nodes of a compute call. Can be a single compute node.

    +
    + computeNode + +

    The compute node.

    +
    + bindings + +

    The bindings.

    +
    + computePipeline + +

    The compute pipeline.

    +
    +
    +

    .copyFramebufferToTexture( texture : Texture, renderContext : RenderContext, rectangle : Vector4 ) (abstract)

    +
    +
    +

    Copies the current bound framebuffer to the given texture.

    +
    + + + + + + + + + + + + + + + +
    + texture + +

    The destination texture.

    +
    + renderContext + +

    The render context.

    +
    + rectangle + +

    A four dimensional vector defining the origin and dimension of the copy.

    +
    +
    +

    .copyTextureToBuffer( texture : Texture, x : number, y : number, width : number, height : number, faceIndex : number ) : Promise.<TypedArray> (async, abstract)

    +
    +
    +

    Returns texture data as a typed array.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + texture + +

    The texture to copy.

    +
    + x + +

    The x coordinate of the copy origin.

    +
    + y + +

    The y coordinate of the copy origin.

    +
    + width + +

    The width of the copy.

    +
    + height + +

    The height of the copy.

    +
    + faceIndex + +

    The face index.

    +
    +
    +
    Returns: A Promise that resolves with a typed array when the copy operation has finished.
    +
    +
    +

    .copyTextureToTexture( srcTexture : Texture, dstTexture : Texture, srcRegion : Box3 | Box2, dstPosition : Vector2 | Vector3, srcLevel : number, dstLevel : number ) (abstract)

    +
    +
    +

    Copies data of the given source texture to the given destination texture.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + srcTexture + +

    The source texture.

    +
    + dstTexture + +

    The destination texture.

    +
    + srcRegion + +

    The region of the source texture to copy.

    +

    Default is null.

    +
    + dstPosition + +

    The destination position of the copy.

    +

    Default is null.

    +
    + srcLevel + +

    The source mip level to copy from.

    +

    Default is 0.

    +
    + dstLevel + +

    The destination mip level to copy to.

    +

    Default is 0.

    +
    +
    +

    .createAttribute( attribute : BufferAttribute ) (abstract)

    +
    +
    +

    Creates the GPU buffer of a shader attribute.

    +
    + + + + + + + +
    + attribute + +

    The buffer attribute.

    +
    +
    +

    .createBindings( bindGroup : BindGroup, bindings : Array.<BindGroup>, cacheIndex : number, version : number ) (abstract)

    +
    +
    +

    Creates bindings from the given bind group definition.

    +
    + + + + + + + + + + + + + + + + + + + +
    + bindGroup + +

    The bind group.

    +
    + bindings + +

    Array of bind groups.

    +
    + cacheIndex + +

    The cache index.

    +
    + version + +

    The version.

    +
    +
    +

    .createComputePipeline( computePipeline : ComputePipeline, bindings : Array.<BindGroup> ) (abstract)

    +
    +
    +

    Creates a compute pipeline for the given compute node.

    +
    + + + + + + + + + + + +
    + computePipeline + +

    The compute pipeline.

    +
    + bindings + +

    The bindings.

    +
    +
    +

    .createDefaultTexture( texture : Texture ) (abstract)

    +
    +
    +

    Creates a default texture for the given texture that can be used +as a placeholder until the actual texture is ready for usage.

    +
    + + + + + + + +
    + texture + +

    The texture to create a default texture for.

    +
    +
    +

    .createIndexAttribute( attribute : BufferAttribute ) (abstract)

    +
    +
    +

    Creates the GPU buffer of an indexed shader attribute.

    +
    + + + + + + + +
    + attribute + +

    The indexed buffer attribute.

    +
    +
    +

    .createNodeBuilder( renderObject : RenderObject, renderer : Renderer ) : NodeBuilder (abstract)

    +
    +
    +

    Returns a node builder for the given render object.

    +
    + + + + + + + + + + + +
    + renderObject + +

    The render object.

    +
    + renderer + +

    The renderer.

    +
    +
    +
    Returns: The node builder.
    +
    +
    +

    .createProgram( program : ProgrammableStage ) (abstract)

    +
    +
    +

    Creates a shader program from the given programmable stage.

    +
    + + + + + + + +
    + program + +

    The programmable stage.

    +
    +
    +

    .createRenderPipeline( renderObject : RenderObject, promises : Array.<Promise> ) (abstract)

    +
    +
    +

    Creates a render pipeline for the given render object.

    +
    + + + + + + + + + + + +
    + renderObject + +

    The render object.

    +
    + promises + +

    An array of compilation promises which are used in compileAsync().

    +
    +
    +

    .createStorageAttribute( attribute : BufferAttribute ) (abstract)

    +
    +
    +

    Creates the GPU buffer of a storage attribute.

    +
    + + + + + + + +
    + attribute + +

    The buffer attribute.

    +
    +
    +

    .createTexture( texture : Texture, options : Object ) (abstract)

    +
    +
    +

    Defines a texture on the GPU for the given texture object.

    +
    + + + + + + + + + + + +
    + texture + +

    The texture.

    +
    + options + +

    Optional configuration parameter.

    +

    Default is {}.

    +
    +
    +

    .createUniformBuffer( uniformBuffer : Buffer ) (abstract)

    +
    +
    +

    Creates a uniform buffer.

    +
    + + + + + + + +
    + uniformBuffer + +

    The uniform buffer.

    +
    +
    +

    .delete( object : Object )

    +
    +
    +

    Deletes an object from the internal data structure.

    +
    + + + + + + + +
    + object + +

    The object to delete.

    +
    +
    +

    .deleteBindGroupData( bindGroup : BindGroup ) (abstract)

    +
    +
    +

    Delete GPU data associated with a bind group.

    +
    + + + + + + + +
    + bindGroup + +

    The bind group.

    +
    +
    +

    .destroyAttribute( attribute : BufferAttribute ) (abstract)

    +
    +
    +

    Destroys the GPU buffer of a shader attribute.

    +
    + + + + + + + +
    + attribute + +

    The buffer attribute to destroy.

    +
    +
    +

    .destroyProgram( program : ProgrammableStage ) (abstract)

    +
    +
    +

    Destroys the shader program of the given programmable stage.

    +
    + + + + + + + +
    + program + +

    The programmable stage.

    +
    +
    +

    .destroySampler( binding : Sampler ) (abstract)

    +
    +
    +

    Frees the GPU sampler for the given sampler binding.

    +
    + + + + + + + +
    + binding + +

    The sampler binding to free.

    +
    +
    +

    .destroyTexture( texture : Texture, isDefaultTexture : boolean ) (abstract)

    +
    +
    +

    Destroys the GPU data for the given texture object.

    +
    + + + + + + + + + + + +
    + texture + +

    The texture.

    +
    + isDefaultTexture + +

    Whether the texture uses a default GPU texture or not.

    +

    Default is false.

    +
    +
    +

    .destroyUniformBuffer( uniformBuffer : Buffer ) (abstract)

    +
    +
    +

    Destroys a uniform buffer.

    +
    + + + + + + + +
    + uniformBuffer + +

    The uniform buffer.

    +
    +
    +

    .dispose() (abstract)

    +
    +
    +

    Frees internal resources.

    +
    +
    +

    .draw( renderObject : RenderObject, info : Info ) (abstract)

    +
    +
    +

    Executes a draw command for the given render object.

    +
    + + + + + + + + + + + +
    + renderObject + +

    The render object to draw.

    +
    + info + +

    Holds a series of statistical information about the GPU memory and the rendering process.

    +
    +
    +

    .finishCompute( computeGroup : Node | Array.<Node> ) (abstract)

    +
    +
    +

    This method is executed at the end of a compute call and +can be used by the backend to finalize work after compute +tasks.

    +
    + + + + + + + +
    + computeGroup + +

    The compute node(s).

    +
    +
    +

    .finishRender( renderContext : RenderContext ) (abstract)

    +
    +
    +

    This method is executed at the end of a render call and +can be used by the backend to finalize work after draw +calls.

    +
    + + + + + + + +
    + renderContext + +

    The render context.

    +
    +
    +

    .generateMipmaps( texture : Texture ) (abstract)

    +
    +
    +

    Generates mipmaps for the given texture.

    +
    + + + + + + + +
    + texture + +

    The texture.

    +
    +
    +

    .get( object : Object ) : Object

    +
    +
    +

    Returns the dictionary for the given object.

    +
    + + + + + + + +
    + object + +

    The object.

    +
    +
    +
    Returns: The object's dictionary.
    +
    +
    +

    .getArrayBufferAsync( attribute : StorageBufferAttribute ) : Promise.<ArrayBuffer> (async)

    +
    +
    +

    This method performs a readback operation by moving buffer data from +a storage buffer attribute from the GPU to the CPU.

    +
    + + + + + + + +
    + attribute + +

    The storage buffer attribute.

    +
    +
    +
    Returns: A promise that resolves with the buffer data when the data are ready.
    +
    +
    +

    .getClearColor() : Color4

    +
    +
    +

    Returns the clear color and alpha into a single +color object.

    +
    +
    +
    Returns: The clear color.
    +
    +
    +

    .getContext() : Object (abstract)

    +
    +
    +

    Returns the backend's rendering context.

    +
    +
    +
    Returns: The rendering context.
    +
    +
    +

    .getDomElement() : HTMLCanvasElement

    +
    +
    +

    Returns the DOM element. If no DOM element exists, the backend +creates a new one.

    +
    +
    +
    Returns: The DOM element.
    +
    +
    +

    .getDrawingBufferSize() : Vector2

    +
    +
    +

    Returns the drawing buffer size.

    +
    +
    +
    Returns: The drawing buffer size.
    +
    +
    +

    .getRenderCacheKey( renderObject : RenderObject ) : string (abstract)

    +
    +
    +

    Returns a cache key that is used to identify render pipelines.

    +
    + + + + + + + +
    + renderObject + +

    The render object.

    +
    +
    +
    Returns: The cache key.
    +
    +
    +

    .getTimestamp( uid : string ) : number

    +
    +
    +

    Returns the timestamp for the given uid.

    +
    + + + + + + + +
    + uid + +

    The unique identifier.

    +
    +
    +
    Returns: The timestamp.
    +
    +
    +

    .getTimestampFrames( type : string ) : Array.<number>

    +
    +
    +

    Returns all timestamp frames for the given type.

    +
    + + + + + + + +
    + type + +

    The type of the time stamp.

    +
    +
    +
    Returns: The timestamp frames.
    +
    +
    +

    .getTimestampUID( abstractRenderContext : RenderContext | ComputeNode ) : string

    +
    +
    +

    Returns a unique identifier for the given render context that can be used +to allocate resources like occlusion queries or timestamp queries.

    +
    + + + + + + + +
    + abstractRenderContext + +

    The render context.

    +
    +
    +
    Returns: The unique identifier.
    +
    +
    +

    .has( object : Object ) : boolean

    +
    +
    +

    Checks if the given object has a dictionary +with data defined.

    +
    + + + + + + + +
    + object + +

    The object.

    +
    +
    +
    Returns: Whether a dictionary for the given object as been defined or not.
    +
    +
    +

    .hasCompatibility( name : string ) : boolean (abstract)

    +
    +
    +

    Checks if the backend has the given compatibility.

    +
    + + + + + + + +
    + name + +

    The compatibility.

    +
    +
    +
    Returns: Whether the backend has the given compatibility or not.
    +
    +
    +

    .hasFeature( name : string ) : boolean (abstract)

    +
    +
    +

    Checks if the given feature is supported by the backend.

    +
    + + + + + + + +
    + name + +

    The feature's name.

    +
    +
    +
    Returns: Whether the feature is supported or not.
    +
    +
    +

    .hasFeatureAsync( name : string ) : Promise.<boolean> (async, abstract)

    +
    +
    +

    Checks if the given feature is supported by the backend.

    +
    + + + + + + + +
    + name + +

    The feature's name.

    +
    +
    +
    Returns: A Promise that resolves with a bool that indicates whether the feature is supported or not.
    +
    +
    +

    .hasTimestampQuery( uid : string ) : boolean

    +
    +
    +

    Returns true if a timestamp for the given uid is available.

    +
    + + + + + + + +
    + uid + +

    The unique identifier.

    +
    +
    +
    Returns: Whether the timestamp is available or not.
    +
    +
    +

    .init( renderer : Renderer ) : Promise (async)

    +
    +
    +

    Initializes the backend so it is ready for usage. Concrete backends +are supposed to implement their rendering context creation and related +operations in this method.

    +
    + + + + + + + +
    + renderer + +

    The renderer.

    +
    +
    +
    Returns: A Promise that resolves when the backend has been initialized.
    +
    +
    +

    .initRenderTarget( renderContext : RenderContext ) (abstract)

    +
    +
    +

    Initializes the render target defined in the given render context.

    +
    + + + + + + + +
    + renderContext + +

    The render context.

    +
    +
    +

    .isOccluded( renderContext : RenderContext, object : Object3D ) : boolean (abstract)

    +
    +
    +

    Returns true if the given 3D object is fully occluded by other +3D objects in the scene. Backends must implement this method by using +a Occlusion Query API.

    +
    + + + + + + + + + + + +
    + renderContext + +

    The render context.

    +
    + object + +

    The 3D object to test.

    +
    +
    +
    Returns: Whether the 3D object is fully occluded or not.
    +
    +
    +

    .needsRenderUpdate( renderObject : RenderObject ) : boolean (abstract)

    +
    +
    +

    Returns true if the render pipeline requires an update.

    +
    + + + + + + + +
    + renderObject + +

    The render object.

    +
    +
    +
    Returns: Whether the render pipeline requires an update or not.
    +
    +
    +

    .resolveTimestampsAsync( type : string ) : Promise.<number> (async, abstract)

    +
    +
    +

    Resolves the time stamp for the given render context and type.

    +
    + + + + + + + +
    + type + +

    The type of the time stamp.

    +

    Default is 'render'.

    +
    +
    +
    Returns: A Promise that resolves with the time stamp.
    +
    +
    +

    .set( object : Object, value : Object )

    +
    +
    +

    Sets a dictionary for the given object into the +internal data structure.

    +
    + + + + + + + + + + + +
    + object + +

    The object.

    +
    + value + +

    The dictionary to set.

    +
    +
    +

    .setScissorTest( boolean : boolean ) (abstract)

    +
    +
    +

    Defines the scissor test.

    +
    + + + + + + + +
    + boolean + +

    Whether the scissor test should be enabled or not.

    +
    +
    +

    .setXRTarget( xrTarget : Object )

    +
    +
    +

    Sets the XR rendering destination.

    +

    Backends that render directly into XR framebuffers can override this hook.

    +
    + + + + + + + +
    + xrTarget + +

    The XR rendering destination.

    +
    +
    +

    .updateAttribute( attribute : BufferAttribute ) (abstract)

    +
    +
    +

    Updates the GPU buffer of a shader attribute.

    +
    + + + + + + + +
    + attribute + +

    The buffer attribute to update.

    +
    +
    +

    .updateBinding( binding : Buffer ) (abstract)

    +
    +
    +

    Updates a buffer binding.

    +
    + + + + + + + +
    + binding + +

    The buffer binding to update.

    +
    +
    +

    .updateBindings( bindGroup : BindGroup, bindings : Array.<BindGroup>, cacheIndex : number, version : number ) (abstract)

    +
    +
    +

    Updates the given bind group definition.

    +
    + + + + + + + + + + + + + + + + + + + +
    + bindGroup + +

    The bind group.

    +
    + bindings + +

    Array of bind groups.

    +
    + cacheIndex + +

    The cache index.

    +
    + version + +

    The version.

    +
    +
    +

    .updateSampler( binding : Sampler ) : string (abstract)

    +
    +
    +

    Updates a GPU sampler for the given texture.

    +
    + + + + + + + +
    + binding + +

    The sampler binding to update.

    +
    +
    +
    Returns: The current sampler key.
    +
    +
    +

    .updateSize() (abstract)

    +
    +
    +

    Backends can use this method if they have to run +logic when the renderer gets resized.

    +
    +
    +

    .updateTexture( texture : Texture, options : Object ) (abstract)

    +
    +
    +

    Uploads the updated texture data to the GPU.

    +
    + + + + + + + + + + + +
    + texture + +

    The texture.

    +
    + options + +

    Optional configuration parameter.

    +

    Default is {}.

    +
    +
    +

    .updateTimeStampUID( abstractRenderContext : RenderContext | ComputeNode )

    +
    +
    +

    Updates a unique identifier for the given render context that can be used +to allocate resources like occlusion queries or timestamp queries.

    +
    + + + + + + + +
    + abstractRenderContext + +

    The render context.

    +
    +
    +

    .updateViewport( renderContext : RenderContext ) (abstract)

    +
    +
    +

    Updates the viewport with the values from the given render context.

    +
    + + + + + + + +
    + renderContext + +

    The render context.

    +
    +
    +

    Source

    +

    + src/renderers/common/Backend.js +

    +
    +
    + + + + \ No newline at end of file diff --git a/docs/pages/Backend.html.md b/docs/pages/Backend.html.md new file mode 100644 index 00000000000000..1212c19d545809 --- /dev/null +++ b/docs/pages/Backend.html.md @@ -0,0 +1,707 @@ +# Backend + +Most of the rendering related logic is implemented in the [Renderer](Renderer.html) module and related management components. Sometimes it is required though to execute commands which are specific to the current 3D backend (which is WebGPU or WebGL 2). This abstract base class defines an interface that encapsulates all backend-related logic. Derived classes for each backend must implement the interface. + +## Constructor + +### new Backend( parameters : Object ) (abstract) + +Constructs a new backend. + +**parameters** + +An object holding parameters for the backend. + +## Properties + +### .coordinateSystem : number (abstract, readonly) + +The coordinate system of the backend. + +### .data : WeakMap. + +This weak map holds backend-specific data of objects like textures, attributes or render targets. + +### .domElement : HTMLCanvasElement | OffscreenCanvas + +A reference to the canvas element the renderer is drawing to. + +Default is `null`. + +### .hasTimestamp : boolean (readonly) + +Whether the backend supports query timestamps or not. + +### .parameters : Object + +The parameters of the backend. + +### .renderer : Renderer + +A reference to the renderer. + +Default is `null`. + +### .timestampQueryPool : Object + +A reference to the timestamp query pool. + +### .trackTimestamp : boolean + +Whether to track timestamps with a Timestamp Query API or not. + +Default is `false`. + +## Methods + +### ._getQueryPool( uid : string ) : TimestampQueryPool + +Returns the query pool for the given uid. + +**uid** + +The unique identifier. + +**Returns:** The query pool. + +### .beginCompute( computeGroup : Node | Array. ) (abstract) + +This method is executed at the beginning of a compute call and can be used by the backend to prepare the state for upcoming compute tasks. + +**computeGroup** + +The compute node(s). + +### .beginRender( renderContext : RenderContext ) (abstract) + +This method is executed at the beginning of a render call and can be used by the backend to prepare the state for upcoming draw calls. + +**renderContext** + +The render context. + +### .compute( computeGroup : Node | Array., computeNode : Node, bindings : Array., computePipeline : ComputePipeline ) (abstract) + +Executes a compute command for the given compute node. + +**computeGroup** + +The group of compute nodes of a compute call. Can be a single compute node. + +**computeNode** + +The compute node. + +**bindings** + +The bindings. + +**computePipeline** + +The compute pipeline. + +### .copyFramebufferToTexture( texture : Texture, renderContext : RenderContext, rectangle : Vector4 ) (abstract) + +Copies the current bound framebuffer to the given texture. + +**texture** + +The destination texture. + +**renderContext** + +The render context. + +**rectangle** + +A four dimensional vector defining the origin and dimension of the copy. + +### .copyTextureToBuffer( texture : Texture, x : number, y : number, width : number, height : number, faceIndex : number ) : Promise. (async, abstract) + +Returns texture data as a typed array. + +**texture** + +The texture to copy. + +**x** + +The x coordinate of the copy origin. + +**y** + +The y coordinate of the copy origin. + +**width** + +The width of the copy. + +**height** + +The height of the copy. + +**faceIndex** + +The face index. + +**Returns:** A Promise that resolves with a typed array when the copy operation has finished. + +### .copyTextureToTexture( srcTexture : Texture, dstTexture : Texture, srcRegion : Box3 | Box2, dstPosition : Vector2 | Vector3, srcLevel : number, dstLevel : number ) (abstract) + +Copies data of the given source texture to the given destination texture. + +**srcTexture** + +The source texture. + +**dstTexture** + +The destination texture. + +**srcRegion** + +The region of the source texture to copy. + +Default is `null`. + +**dstPosition** + +The destination position of the copy. + +Default is `null`. + +**srcLevel** + +The source mip level to copy from. + +Default is `0`. + +**dstLevel** + +The destination mip level to copy to. + +Default is `0`. + +### .createAttribute( attribute : BufferAttribute ) (abstract) + +Creates the GPU buffer of a shader attribute. + +**attribute** + +The buffer attribute. + +### .createBindings( bindGroup : BindGroup, bindings : Array., cacheIndex : number, version : number ) (abstract) + +Creates bindings from the given bind group definition. + +**bindGroup** + +The bind group. + +**bindings** + +Array of bind groups. + +**cacheIndex** + +The cache index. + +**version** + +The version. + +### .createComputePipeline( computePipeline : ComputePipeline, bindings : Array. ) (abstract) + +Creates a compute pipeline for the given compute node. + +**computePipeline** + +The compute pipeline. + +**bindings** + +The bindings. + +### .createDefaultTexture( texture : Texture ) (abstract) + +Creates a default texture for the given texture that can be used as a placeholder until the actual texture is ready for usage. + +**texture** + +The texture to create a default texture for. + +### .createIndexAttribute( attribute : BufferAttribute ) (abstract) + +Creates the GPU buffer of an indexed shader attribute. + +**attribute** + +The indexed buffer attribute. + +### .createNodeBuilder( renderObject : RenderObject, renderer : Renderer ) : NodeBuilder (abstract) + +Returns a node builder for the given render object. + +**renderObject** + +The render object. + +**renderer** + +The renderer. + +**Returns:** The node builder. + +### .createProgram( program : ProgrammableStage ) (abstract) + +Creates a shader program from the given programmable stage. + +**program** + +The programmable stage. + +### .createRenderPipeline( renderObject : RenderObject, promises : Array. ) (abstract) + +Creates a render pipeline for the given render object. + +**renderObject** + +The render object. + +**promises** + +An array of compilation promises which are used in `compileAsync()`. + +### .createStorageAttribute( attribute : BufferAttribute ) (abstract) + +Creates the GPU buffer of a storage attribute. + +**attribute** + +The buffer attribute. + +### .createTexture( texture : Texture, options : Object ) (abstract) + +Defines a texture on the GPU for the given texture object. + +**texture** + +The texture. + +**options** + +Optional configuration parameter. + +Default is `{}`. + +### .createUniformBuffer( uniformBuffer : Buffer ) (abstract) + +Creates a uniform buffer. + +**uniformBuffer** + +The uniform buffer. + +### .delete( object : Object ) + +Deletes an object from the internal data structure. + +**object** + +The object to delete. + +### .deleteBindGroupData( bindGroup : BindGroup ) (abstract) + +Delete GPU data associated with a bind group. + +**bindGroup** + +The bind group. + +### .destroyAttribute( attribute : BufferAttribute ) (abstract) + +Destroys the GPU buffer of a shader attribute. + +**attribute** + +The buffer attribute to destroy. + +### .destroyProgram( program : ProgrammableStage ) (abstract) + +Destroys the shader program of the given programmable stage. + +**program** + +The programmable stage. + +### .destroySampler( binding : Sampler ) (abstract) + +Frees the GPU sampler for the given sampler binding. + +**binding** + +The sampler binding to free. + +### .destroyTexture( texture : Texture, isDefaultTexture : boolean ) (abstract) + +Destroys the GPU data for the given texture object. + +**texture** + +The texture. + +**isDefaultTexture** + +Whether the texture uses a default GPU texture or not. + +Default is `false`. + +### .destroyUniformBuffer( uniformBuffer : Buffer ) (abstract) + +Destroys a uniform buffer. + +**uniformBuffer** + +The uniform buffer. + +### .dispose() (abstract) + +Frees internal resources. + +### .draw( renderObject : RenderObject, info : Info ) (abstract) + +Executes a draw command for the given render object. + +**renderObject** + +The render object to draw. + +**info** + +Holds a series of statistical information about the GPU memory and the rendering process. + +### .finishCompute( computeGroup : Node | Array. ) (abstract) + +This method is executed at the end of a compute call and can be used by the backend to finalize work after compute tasks. + +**computeGroup** + +The compute node(s). + +### .finishRender( renderContext : RenderContext ) (abstract) + +This method is executed at the end of a render call and can be used by the backend to finalize work after draw calls. + +**renderContext** + +The render context. + +### .generateMipmaps( texture : Texture ) (abstract) + +Generates mipmaps for the given texture. + +**texture** + +The texture. + +### .get( object : Object ) : Object + +Returns the dictionary for the given object. + +**object** + +The object. + +**Returns:** The object's dictionary. + +### .getArrayBufferAsync( attribute : StorageBufferAttribute ) : Promise. (async) + +This method performs a readback operation by moving buffer data from a storage buffer attribute from the GPU to the CPU. + +**attribute** + +The storage buffer attribute. + +**Returns:** A promise that resolves with the buffer data when the data are ready. + +### .getClearColor() : Color4 + +Returns the clear color and alpha into a single color object. + +**Returns:** The clear color. + +### .getContext() : Object (abstract) + +Returns the backend's rendering context. + +**Returns:** The rendering context. + +### .getDomElement() : HTMLCanvasElement + +Returns the DOM element. If no DOM element exists, the backend creates a new one. + +**Returns:** The DOM element. + +### .getDrawingBufferSize() : Vector2 + +Returns the drawing buffer size. + +**Returns:** The drawing buffer size. + +### .getRenderCacheKey( renderObject : RenderObject ) : string (abstract) + +Returns a cache key that is used to identify render pipelines. + +**renderObject** + +The render object. + +**Returns:** The cache key. + +### .getTimestamp( uid : string ) : number + +Returns the timestamp for the given uid. + +**uid** + +The unique identifier. + +**Returns:** The timestamp. + +### .getTimestampFrames( type : string ) : Array. + +Returns all timestamp frames for the given type. + +**type** + +The type of the time stamp. + +**Returns:** The timestamp frames. + +### .getTimestampUID( abstractRenderContext : RenderContext | ComputeNode ) : string + +Returns a unique identifier for the given render context that can be used to allocate resources like occlusion queries or timestamp queries. + +**abstractRenderContext** + +The render context. + +**Returns:** The unique identifier. + +### .has( object : Object ) : boolean + +Checks if the given object has a dictionary with data defined. + +**object** + +The object. + +**Returns:** Whether a dictionary for the given object as been defined or not. + +### .hasCompatibility( name : string ) : boolean (abstract) + +Checks if the backend has the given compatibility. + +**name** + +The compatibility. + +**Returns:** Whether the backend has the given compatibility or not. + +### .hasFeature( name : string ) : boolean (abstract) + +Checks if the given feature is supported by the backend. + +**name** + +The feature's name. + +**Returns:** Whether the feature is supported or not. + +### .hasFeatureAsync( name : string ) : Promise. (async, abstract) + +Checks if the given feature is supported by the backend. + +**name** + +The feature's name. + +**Returns:** A Promise that resolves with a bool that indicates whether the feature is supported or not. + +### .hasTimestampQuery( uid : string ) : boolean + +Returns `true` if a timestamp for the given uid is available. + +**uid** + +The unique identifier. + +**Returns:** Whether the timestamp is available or not. + +### .init( renderer : Renderer ) : Promise (async) + +Initializes the backend so it is ready for usage. Concrete backends are supposed to implement their rendering context creation and related operations in this method. + +**renderer** + +The renderer. + +**Returns:** A Promise that resolves when the backend has been initialized. + +### .initRenderTarget( renderContext : RenderContext ) (abstract) + +Initializes the render target defined in the given render context. + +**renderContext** + +The render context. + +### .isOccluded( renderContext : RenderContext, object : Object3D ) : boolean (abstract) + +Returns `true` if the given 3D object is fully occluded by other 3D objects in the scene. Backends must implement this method by using a Occlusion Query API. + +**renderContext** + +The render context. + +**object** + +The 3D object to test. + +**Returns:** Whether the 3D object is fully occluded or not. + +### .needsRenderUpdate( renderObject : RenderObject ) : boolean (abstract) + +Returns `true` if the render pipeline requires an update. + +**renderObject** + +The render object. + +**Returns:** Whether the render pipeline requires an update or not. + +### .resolveTimestampsAsync( type : string ) : Promise. (async, abstract) + +Resolves the time stamp for the given render context and type. + +**type** + +The type of the time stamp. + +Default is `'render'`. + +**Returns:** A Promise that resolves with the time stamp. + +### .set( object : Object, value : Object ) + +Sets a dictionary for the given object into the internal data structure. + +**object** + +The object. + +**value** + +The dictionary to set. + +### .setScissorTest( boolean : boolean ) (abstract) + +Defines the scissor test. + +**boolean** + +Whether the scissor test should be enabled or not. + +### .setXRTarget( xrTarget : Object ) + +Sets the XR rendering destination. + +Backends that render directly into XR framebuffers can override this hook. + +**xrTarget** + +The XR rendering destination. + +### .updateAttribute( attribute : BufferAttribute ) (abstract) + +Updates the GPU buffer of a shader attribute. + +**attribute** + +The buffer attribute to update. + +### .updateBinding( binding : Buffer ) (abstract) + +Updates a buffer binding. + +**binding** + +The buffer binding to update. + +### .updateBindings( bindGroup : BindGroup, bindings : Array., cacheIndex : number, version : number ) (abstract) + +Updates the given bind group definition. + +**bindGroup** + +The bind group. + +**bindings** + +Array of bind groups. + +**cacheIndex** + +The cache index. + +**version** + +The version. + +### .updateSampler( binding : Sampler ) : string (abstract) + +Updates a GPU sampler for the given texture. + +**binding** + +The sampler binding to update. + +**Returns:** The current sampler key. + +### .updateSize() (abstract) + +Backends can use this method if they have to run logic when the renderer gets resized. + +### .updateTexture( texture : Texture, options : Object ) (abstract) + +Uploads the updated texture data to the GPU. + +**texture** + +The texture. + +**options** + +Optional configuration parameter. + +Default is `{}`. + +### .updateTimeStampUID( abstractRenderContext : RenderContext | ComputeNode ) + +Updates a unique identifier for the given render context that can be used to allocate resources like occlusion queries or timestamp queries. + +**abstractRenderContext** + +The render context. + +### .updateViewport( renderContext : RenderContext ) (abstract) + +Updates the viewport with the values from the given render context. + +**renderContext** + +The render context. + +## Source + +[src/renderers/common/Backend.js](https://github.com/mrdoob/three.js/blob/master/src/renderers/common/Backend.js) \ No newline at end of file diff --git a/docs/pages/BatchNode.html b/docs/pages/BatchNode.html deleted file mode 100644 index 77e43ec5b22cae..00000000000000 --- a/docs/pages/BatchNode.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - BatchNode - Three.js Docs - - - - - - -

    EventDispatcherNode

    -

    BatchNode

    -
    -
    -

    This node implements the vertex shader logic which is required -when rendering 3D objects via batching. BatchNode must be used -with instances of BatchedMesh.

    -
    -
    -
    -

    Constructor

    -

    new BatchNode( batchMesh : BatchedMesh )

    -
    -
    -

    Constructs a new batch node.

    -
    - - - - - - - -
    - batchMesh - -

    A reference to batched mesh.

    -
    -
    -
    -

    Properties

    -
    -

    .batchMesh : BatchedMesh

    -
    -

    A reference to batched mesh.

    -
    -
    -
    -

    .batchingIdNode : IndexNode

    -
    -

    The batching index node.

    -

    Default is null.

    -
    -
    -

    Methods

    -

    .setup( builder : NodeBuilder )

    -
    -
    -

    Setups the internal buffers and nodes and assigns the transformed vertex data -to predefined node variables for accumulation. That follows the same patterns -like with morph and skinning nodes.

    -
    - - - - - - - -
    - builder - -

    The current node builder.

    -
    -
    -
    Overrides: Node#setup
    -
    -
    -

    Source

    -

    - src/nodes/accessors/BatchNode.js -

    -
    -
    - - - - \ No newline at end of file diff --git a/docs/pages/BatchNode.html.md b/docs/pages/BatchNode.html.md deleted file mode 100644 index 47e2452c793af4..00000000000000 --- a/docs/pages/BatchNode.html.md +++ /dev/null @@ -1,43 +0,0 @@ -*Inheritance: EventDispatcher → Node →* - -# BatchNode - -This node implements the vertex shader logic which is required when rendering 3D objects via batching. `BatchNode` must be used with instances of [BatchedMesh](BatchedMesh.html). - -## Constructor - -### new BatchNode( batchMesh : BatchedMesh ) - -Constructs a new batch node. - -**batchMesh** - -A reference to batched mesh. - -## Properties - -### .batchMesh : BatchedMesh - -A reference to batched mesh. - -### .batchingIdNode : IndexNode - -The batching index node. - -Default is `null`. - -## Methods - -### .setup( builder : NodeBuilder ) - -Setups the internal buffers and nodes and assigns the transformed vertex data to predefined node variables for accumulation. That follows the same patterns like with morph and skinning nodes. - -**builder** - -The current node builder. - -**Overrides:** [Node#setup](Node.html#setup) - -## Source - -[src/nodes/accessors/BatchNode.js](https://github.com/mrdoob/three.js/blob/master/src/nodes/accessors/BatchNode.js) \ No newline at end of file diff --git a/docs/pages/BloomNode.html b/docs/pages/BloomNode.html index bdf969ec4ef6ad..8ccb029b14172d 100644 --- a/docs/pages/BloomNode.html +++ b/docs/pages/BloomNode.html @@ -88,6 +88,12 @@

    new Properties

    +
    +

    .highPassFn : function

    +
    +

    Can be used to inject a custom high pass filter (e.g., for anamorphic effects).

    +
    +

    .inputNode : Node.<vec4>

    @@ -140,6 +146,15 @@

    .dis
    Overrides: TempNode#dispose

    +

    .getResolutionScale() : number

    +
    +
    +

    Gets the current resolution scale of the pass.

    +
    +
    +
    Returns: The current resolution scale. A value of 1 means full resolution.
    +
    +

    .getTextureNode() : PassTextureNode

    +

    .setResolutionScale( resolutionScale : number ) : BloomNode

    +
    +
    +

    Sets the resolution scale for the pass. +The resolution scale is a factor that is multiplied with the renderer's width and height.

    +
    + + + + + + + +
    + resolutionScale + +

    The resolution scale to set. A value of 1 means full resolution.

    +
    +
    +
    Returns: A reference to this node.
    +
    +

    .setSize( width : number, height : number )

    diff --git a/docs/pages/BloomNode.html.md b/docs/pages/BloomNode.html.md index 62e7955f9e7f0e..7af68ddd894513 100644 --- a/docs/pages/BloomNode.html.md +++ b/docs/pages/BloomNode.html.md @@ -65,6 +65,10 @@ Default is `0`. ## Properties +### .highPassFn : function + +Can be used to inject a custom high pass filter (e.g., for anamorphic effects). + ### .inputNode : Node. The node that represents the input of the effect. @@ -101,12 +105,28 @@ Frees internal resources. This method should be called when the effect is no lon **Overrides:** [TempNode#dispose](TempNode.html#dispose) +### .getResolutionScale() : number + +Gets the current resolution scale of the pass. + +**Returns:** The current resolution scale. A value of `1` means full resolution. + ### .getTextureNode() : PassTextureNode Returns the result of the effect as a texture node. **Returns:** A texture node that represents the result of the effect. +### .setResolutionScale( resolutionScale : number ) : BloomNode + +Sets the resolution scale for the pass. The resolution scale is a factor that is multiplied with the renderer's width and height. + +**resolutionScale** + +The resolution scale to set. A value of `1` means full resolution. + +**Returns:** A reference to this node. + ### .setSize( width : number, height : number ) Sets the size of the effect. diff --git a/docs/pages/Box3.html b/docs/pages/Box3.html index 3208afa358711a..8c4eb19b6377fc 100644 --- a/docs/pages/Box3.html +++ b/docs/pages/Box3.html @@ -686,6 +686,10 @@

    . diff --git a/docs/pages/Box3.html.md b/docs/pages/Box3.html.md index c69e04cb22c25f..e1a217808a48d1 100644 --- a/docs/pages/Box3.html.md +++ b/docs/pages/Box3.html.md @@ -332,6 +332,8 @@ The x, y and z dimensions of the box. Computes the world-axis-aligned bounding box for the given 3D object (including its children), accounting for the object's, and children's, world transforms. The function may result in a larger box than strictly necessary. +Note: To compute the correct bounding box, make sure the given 3D object has an up-to-date world matrix that reflects the current transformation of its ancestor nodes. Call `object.updateWorldMatrix( true, false )` beforehand if you're unsure. + **object** The 3D object to compute the bounding box for. diff --git a/docs/pages/CityGenerator.html b/docs/pages/CityGenerator.html new file mode 100644 index 00000000000000..afc3e191bb2d66 --- /dev/null +++ b/docs/pages/CityGenerator.html @@ -0,0 +1,43 @@ + + + + + CityGenerator - Three.js Docs + + + + + + +

    CityGenerator

    +
    +
    +

    Lays out a grid of city blocks and fills each lot with a SkyscraperGenerator +tower of its own seed, height and footprint, optionally on raised sidewalk +slabs (curbs). Returns a THREE.Group ready to add to a scene.

    +

    Pass a building material to dress the towers; the sidewalks dress themselves +via SidewalkGenerator. The layout is exposed as +CityGenerator#layout so the surrounding scene (road markings, etc.) +can align to the same grid.

    +

    Code Example

    +
    const city = new CityGenerator( { seed: 1 } );
    +scene.add( city.build( materials ) );
    +
    +
    + +
    + + + + \ No newline at end of file diff --git a/docs/pages/CityGenerator.html.md b/docs/pages/CityGenerator.html.md new file mode 100644 index 00000000000000..0736119ae25559 --- /dev/null +++ b/docs/pages/CityGenerator.html.md @@ -0,0 +1,20 @@ +# CityGenerator + +Lays out a grid of city blocks and fills each lot with a [SkyscraperGenerator](SkyscraperGenerator.html) tower of its own seed, height and footprint, optionally on raised sidewalk slabs (curbs). Returns a `THREE.Group` ready to add to a scene. + +Pass a building material to dress the towers; the sidewalks dress themselves via [SidewalkGenerator](SidewalkGenerator.html). The layout is exposed as CityGenerator#layout so the surrounding scene (road markings, etc.) can align to the same grid. + +## Code Example + +```js +const city = new CityGenerator( { seed: 1 } ); +scene.add( city.build( materials ) ); +``` + +## Constructor + +### new CityGenerator() + +## Source + +[examples/jsm/generators/CityGenerator.js](https://github.com/mrdoob/three.js/blob/master/examples/jsm/generators/CityGenerator.js) \ No newline at end of file diff --git a/docs/pages/DRACOExporter.html b/docs/pages/DRACOExporter.html index e1b33eb343f199..1e3bba295dfde4 100644 --- a/docs/pages/DRACOExporter.html +++ b/docs/pages/DRACOExporter.html @@ -20,10 +20,12 @@

    DRACOExporter

    normals, colors, and other attributes. Draco files do not contain materials, textures, animation, or node hierarchies – to use these features, embed Draco geometry inside of a glTF file. A normal glTF file can be converted to a Draco-compressed glTF file -using glTF-Pipeline.

    -

    Code Example

    -
    const exporter = new DRACOExporter();
    -const data = exporter.parse( mesh, options );
    +using glTF-Pipeline.

    +

    The exporter requires the Draco encoder to be loaded as a global script in advance:

    +
    <script src="https://cdn.jsdelivr.net/gh/google/draco@1.5.7/javascript/draco_encoder.js"></script>
    +
    +
    const exporter = new DRACOExporter();
    +const data = await exporter.parseAsync( mesh, options );
     
    @@ -52,7 +54,13 @@

    .Methods

    -

    .parse( object : Mesh | Points, options : DRACOExporter~Options ) : Int8Array

    +

    .parse()

    +
    +
    +
    Deprecated: Use DRACOExporter#parseAsync instead.
    +
    +
    +

    .parseAsync( object : Mesh | Points, options : DRACOExporter~Options ) : Promise.<Int8Array> (async)

    Parses the given mesh or point cloud and generates the Draco output.

    @@ -78,7 +86,7 @@

    .parse
    -
    Returns: The exported Draco.
    +
    Returns: A Promise that resolves with the exported Draco.

    Type Definitions

    diff --git a/docs/pages/DRACOExporter.html.md b/docs/pages/DRACOExporter.html.md index 8c03e8ff560014..2f22b2ce3b070f 100644 --- a/docs/pages/DRACOExporter.html.md +++ b/docs/pages/DRACOExporter.html.md @@ -6,11 +6,14 @@ An exporter to compress geometry with the Draco library. Standalone Draco files have a `.drc` extension, and contain vertex positions, normals, colors, and other attributes. Draco files _do not_ contain materials, textures, animation, or node hierarchies – to use these features, embed Draco geometry inside of a glTF file. A normal glTF file can be converted to a Draco-compressed glTF file using [glTF-Pipeline](https://github.com/AnalyticalGraphicsInc/gltf-pipeline). -## Code Example +The exporter requires the Draco encoder to be loaded as a global script in advance: +```js + +``` ```js const exporter = new DRACOExporter(); -const data = exporter.parse( mesh, options ); +const data = await exporter.parseAsync( mesh, options ); ``` ## Import @@ -41,7 +44,11 @@ Default is `0`. ## Methods -### .parse( object : Mesh | Points, options : DRACOExporter~Options ) : Int8Array +### .parse() + +**Deprecated:** Use [DRACOExporter#parseAsync](DRACOExporter.html#parseAsync) instead. + +### .parseAsync( object : Mesh | Points, options : DRACOExporter~Options ) : Promise. (async) Parses the given mesh or point cloud and generates the Draco output. @@ -53,7 +60,7 @@ The mesh or point cloud to export. The export options. -**Returns:** The exported Draco. +**Returns:** A Promise that resolves with the exported Draco. ## Type Definitions diff --git a/docs/pages/DRACOLoader.html b/docs/pages/DRACOLoader.html index 456acb5851ab9c..f2900bc071112e 100644 --- a/docs/pages/DRACOLoader.html +++ b/docs/pages/DRACOLoader.html @@ -28,10 +28,9 @@

    DRACOLoader

    browser capabilities.

    Code Example

    const loader = new DRACOLoader();
    -loader.setDecoderPath( '/examples/jsm/libs/draco/' );
    -const geometry = await dracoLoader.loadAsync( 'models/draco/bunny.drc' );
    +const geometry = await loader.loadAsync( 'models/draco/bunny.drc' );
     geometry.computeVertexNormals(); // optional
    -dracoLoader.dispose();
    +loader.dispose();
     
    @@ -160,11 +159,14 @@

    . +
    Deprecated: Yes
    +
    Returns: A reference to this loader.
    -

    .setDecoderPath( path : string ) : DRACOLoader

    +

    .setDecoderPath( path : string | Object ) : DRACOLoader

    Provides configuration for the decoder libraries. Configuration cannot be changed after decoding begins.

    @@ -176,7 +178,7 @@

    .path -

    The decoder path.

    +

    The decoder path, or a config object with explicit URLs for each decoder file.

    diff --git a/docs/pages/DRACOLoader.html.md b/docs/pages/DRACOLoader.html.md index ee9fc49b6f23b8..dbcb4266361417 100644 --- a/docs/pages/DRACOLoader.html.md +++ b/docs/pages/DRACOLoader.html.md @@ -16,10 +16,9 @@ It is recommended to create one DRACOLoader instance and reuse it to avoid loadi ```js const loader = new DRACOLoader(); -loader.setDecoderPath( '/examples/jsm/libs/draco/' ); -const geometry = await dracoLoader.loadAsync( 'models/draco/bunny.drc' ); +const geometry = await loader.loadAsync( 'models/draco/bunny.drc' ); geometry.computeVertexNormals(); // optional -dracoLoader.dispose(); +loader.dispose(); ``` ## Import @@ -90,15 +89,17 @@ Provides configuration for the decoder libraries. Configuration cannot be change The decoder config. +**Deprecated:** Yes + **Returns:** A reference to this loader. -### .setDecoderPath( path : string ) : DRACOLoader +### .setDecoderPath( path : string | Object ) : DRACOLoader Provides configuration for the decoder libraries. Configuration cannot be changed after decoding begins. **path** -The decoder path. +The decoder path, or a config object with explicit URLs for each decoder file. **Returns:** A reference to this loader. diff --git a/docs/pages/DataTextureLoader.html b/docs/pages/DataTextureLoader.html index aec7bc21286bd0..41a329bc2622bf 100644 --- a/docs/pages/DataTextureLoader.html +++ b/docs/pages/DataTextureLoader.html @@ -41,6 +41,29 @@

    new Methods

    +

    .createDataTexture( buffer : ArrayBuffer ) : DataTexture

    +
    +
    +

    Parses the given buffer and returns a configured data texture. Use this method +for parsing texture data that is already in memory (e.g. drag and drop or data +loaded from a server) without going through DataTextureLoader#load.

    +
    + + + + + + + +
    + buffer + +

    The raw texture data.

    +
    +
    +
    Returns: The data texture.
    +
    +

    .load( url : string, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback ) : DataTexture

    diff --git a/docs/pages/DataTextureLoader.html.md b/docs/pages/DataTextureLoader.html.md index eff5fffc2ce9dc..11d6fabc470967 100644 --- a/docs/pages/DataTextureLoader.html.md +++ b/docs/pages/DataTextureLoader.html.md @@ -18,6 +18,16 @@ The loading manager. ## Methods +### .createDataTexture( buffer : ArrayBuffer ) : DataTexture + +Parses the given buffer and returns a configured data texture. Use this method for parsing texture data that is already in memory (e.g. drag and drop or data loaded from a server) without going through [DataTextureLoader#load](DataTextureLoader.html#load). + +**buffer** + +The raw texture data. + +**Returns:** The data texture. + ### .load( url : string, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback ) : DataTexture Starts loading from the given URL and passes the loaded data texture to the `onLoad()` callback. The method also returns a new texture object which can directly be used for material creation. If you do it this way, the texture may pop up in your scene once the respective loading process is finished. diff --git a/docs/pages/ExternalTexture.html b/docs/pages/ExternalTexture.html index d8eb8a47c61d3b..9214bad9cfeef4 100644 --- a/docs/pages/ExternalTexture.html +++ b/docs/pages/ExternalTexture.html @@ -15,9 +15,7 @@

    ExternalTexture

    Represents a texture created externally with the same renderer context.

    This may be a texture from a protected media stream, device camera feed, -or other data feeds like a depth sensor.

    -

    Note that this class is only supported in WebGLRenderer, and in -the WebGPURenderer WebGPU backend.

    +or other data feeds like a depth sensor.

    diff --git a/docs/pages/ExternalTexture.html.md b/docs/pages/ExternalTexture.html.md index f21c493278e5ac..b4f06001e6b6a2 100644 --- a/docs/pages/ExternalTexture.html.md +++ b/docs/pages/ExternalTexture.html.md @@ -6,8 +6,6 @@ Represents a texture created externally with the same renderer context. This may be a texture from a protected media stream, device camera feed, or other data feeds like a depth sensor. -Note that this class is only supported in [WebGLRenderer](WebGLRenderer.html), and in the [WebGPURenderer](WebGPURenderer.html) WebGPU backend. - ## Constructor ### new ExternalTexture( sourceTexture : WebGLTexture | GPUTexture ) diff --git a/docs/pages/FaceFrame.html b/docs/pages/FaceFrame.html new file mode 100644 index 00000000000000..545376c4215042 --- /dev/null +++ b/docs/pages/FaceFrame.html @@ -0,0 +1,46 @@ + + + + + FaceFrame - Three.js Docs + + + + + + +

    FaceFrame

    +
    +
    +

    A face's local ( u along edge, v up, n outward ) frame in world space.

    +
    + +
    + + + + \ No newline at end of file diff --git a/docs/pages/FaceFrame.html.md b/docs/pages/FaceFrame.html.md new file mode 100644 index 00000000000000..c5430e60a95531 --- /dev/null +++ b/docs/pages/FaceFrame.html.md @@ -0,0 +1,21 @@ +# FaceFrame + +A face's local ( u along edge, v up, n outward ) frame in world space. + +## Constructor + +### new FaceFrame() + +## Methods + +### .bays() + +How many bays of `bayWidth` fit, with the remainder split into end margins. + +### .matrix() + +Places a piece authored in the canonical local frame ( x across, y up, z outward ). + +## Source + +[examples/jsm/generators/city/SkyscraperGenerator.js](https://github.com/mrdoob/three.js/blob/master/examples/jsm/generators/city/SkyscraperGenerator.js) \ No newline at end of file diff --git a/docs/pages/FirstPersonControls.html b/docs/pages/FirstPersonControls.html index 6be068bf5db137..7fa48a4d99903f 100644 --- a/docs/pages/FirstPersonControls.html +++ b/docs/pages/FirstPersonControls.html @@ -64,6 +64,14 @@

    . +

    .dampingFactor : number

    +
    +

    How quickly the movement and look velocity catches up to the input. Lower +values feel heavier (more inertia), 1 disables damping.

    +

    Default is 0.1.

    +
    +

    .heightCoef : number

    diff --git a/docs/pages/FirstPersonControls.html.md b/docs/pages/FirstPersonControls.html.md index bebf0bef427c43..9632f6322ec1f0 100644 --- a/docs/pages/FirstPersonControls.html.md +++ b/docs/pages/FirstPersonControls.html.md @@ -42,6 +42,12 @@ Whether or not looking around is vertically constrained by `verticalMin` and `ve Default is `false`. +### .dampingFactor : number + +How quickly the movement and look velocity catches up to the input. Lower values feel heavier (more inertia), `1` disables damping. + +Default is `0.1`. + ### .heightCoef : number Determines how much faster the camera moves when it's y-component is near `heightMax`. diff --git a/docs/pages/ForestGenerator.html b/docs/pages/ForestGenerator.html new file mode 100644 index 00000000000000..49c39246062cc5 --- /dev/null +++ b/docs/pages/ForestGenerator.html @@ -0,0 +1,47 @@ + + + + + ForestGenerator - Three.js Docs + + + + + + +

    ForestGenerator

    +
    +
    +

    Carpets a TerrainGenerator ( or anything exposing sampleHeight, +sampleSlope, minY, maxY and parameters.size ) with a forest of hundreds +of thousands of trees in a single draw call.

    +

    Each tree is the cheapest thing that still reads as a tree: a ~20-face icosphere +squashed into a tapered teardrop and lumped with a little noise, carrying a baked +dark-base / bright-top gradient. Tens of triangles each, so a single +THREE.InstancedMesh of half a million of them costs one draw call. Trees +are placed by rejection sampling against ecological rules — a min/max altitude +band ( above the mist floor, below the snowline ), a slope limit ( none on +cliffs ) and a low-frequency density mask that opens clearings — then jittered in +yaw, lean and ( squared-biased ) scale so the stand never reads as copies.

    +

    Code Example

    +
    const forest = new ForestGenerator( { count: 500000 } );
    +scene.add( forest.build( terrain ) );
    +
    +
    + +
    + + + + \ No newline at end of file diff --git a/docs/pages/ForestGenerator.html.md b/docs/pages/ForestGenerator.html.md new file mode 100644 index 00000000000000..f3851224c83e71 --- /dev/null +++ b/docs/pages/ForestGenerator.html.md @@ -0,0 +1,20 @@ +# ForestGenerator + +Carpets a [TerrainGenerator](TerrainGenerator.html) ( or anything exposing `sampleHeight`, `sampleSlope`, `minY`, `maxY` and `parameters.size` ) with a forest of hundreds of thousands of trees in a single draw call. + +Each tree is the cheapest thing that still reads as a tree: a ~20-face icosphere squashed into a tapered teardrop and lumped with a little noise, carrying a baked dark-base / bright-top gradient. Tens of triangles each, so a single THREE.InstancedMesh of half a million of them costs one draw call. Trees are placed by rejection sampling against ecological rules — a min/max altitude band ( above the mist floor, below the snowline ), a slope limit ( none on cliffs ) and a low-frequency density mask that opens clearings — then jittered in yaw, lean and ( squared-biased ) scale so the stand never reads as copies. + +## Code Example + +```js +const forest = new ForestGenerator( { count: 500000 } ); +scene.add( forest.build( terrain ) ); +``` + +## Constructor + +### new ForestGenerator() + +## Source + +[examples/jsm/generators/ForestGenerator.js](https://github.com/mrdoob/three.js/blob/master/examples/jsm/generators/ForestGenerator.js) \ No newline at end of file diff --git a/docs/pages/FrustumArray.html b/docs/pages/FrustumArray.html index 95238698648b2b..d2907a15d5b76a 100644 --- a/docs/pages/FrustumArray.html +++ b/docs/pages/FrustumArray.html @@ -43,11 +43,11 @@

    .cloneReturns: A clone of this instance.

    -

    .containsPoint( point : Vector3, cameraArray : Object ) : boolean

    +

    .containsPoint( point : Vector3 ) : boolean

    -

    Returns true if the given point lies within any frustum -from the camera array.

    +

    Returns true if the given point lies within any cached frustum.

    +

    FrustumArray#setFromArrayCamera must be called once per render before this method.

    @@ -59,25 +59,38 @@

    . +
    Returns: Whether the point is visible in any camera.
    + + +

    .copy( frustumArray : FrustumArray ) : FrustumArray

    +
    +
    +

    Copies the values of the given frustum array to this instance.

    +
    +

    +
    - cameraArray + frustumArray -

    An object with a cameras property containing an array of cameras.

    +

    The frustum array to copy.

    -
    Returns: Whether the point is visible in any camera.
    +
    Returns: A reference to this frustum array.
    -

    .intersectsBox( box : Box3, cameraArray : Object ) : boolean

    +

    .intersectsBox( box : Box3 ) : boolean

    -

    Returns true if the given bounding box is intersecting any frustum -from the camera array.

    +

    Returns true if the given bounding box is intersecting any cached frustum.

    +

    FrustumArray#setFromArrayCamera must be called once per render before this method.

    @@ -89,25 +102,17 @@

    . - cameraArray - -

    -
    -

    An object with a cameras property containing an array of cameras.

    -
    Returns: Whether the box is visible in any camera.
    -

    .intersectsObject( object : Object3D, cameraArray : Object ) : boolean

    +

    .intersectsObject( object : Object3D ) : boolean

    -

    Returns true if the 3D object's bounding sphere is intersecting any frustum -from the camera array.

    +

    Returns true if the 3D object's bounding sphere is intersecting any cached frustum.

    +

    FrustumArray#setFromArrayCamera must be called once per render before this method.

    @@ -119,25 +124,17 @@

    . - cameraArray - -

    -
    -

    An object with a cameras property containing an array of cameras.

    -
    Returns: Whether the 3D object is visible in any camera.
    -

    .intersectsSphere( sphere : Sphere, cameraArray : Object ) : boolean

    +

    .intersectsSphere( sphere : Sphere ) : boolean

    -

    Returns true if the given bounding sphere is intersecting any frustum -from the camera array.

    +

    Returns true if the given bounding sphere is intersecting any cached frustum.

    +

    FrustumArray#setFromArrayCamera must be called once per render before this method.

    @@ -149,25 +146,17 @@

    . - cameraArray - -

    -
    -

    An object with a cameras property containing an array of cameras.

    -
    Returns: Whether the sphere is visible in any camera.
    -

    .intersectsSprite( sprite : Sprite, cameraArray : Object ) : boolean

    +

    .intersectsSprite( sprite : Sprite ) : boolean

    -

    Returns true if the given sprite is intersecting any frustum -from the camera array.

    +

    Returns true if the given sprite is intersecting any cached frustum.

    +

    FrustumArray#setFromArrayCamera must be called once per render before this method.

    @@ -179,18 +168,31 @@

    . +
    Returns: Whether the sprite is visible in any camera.
    + + +

    .setFromArrayCamera( cameraArray : ArrayCamera ) : FrustumArray

    +
    +
    +

    Computes and caches a frustum for each camera of the given array camera.

    +
    +

    +
    cameraArray -

    An object with a cameras property containing an array of cameras.

    +

    The array camera whose sub-cameras define the frustums.

    -
    Returns: Whether the sprite is visible in any camera.
    +
    Returns: A reference to this frustum array.

    Source

    diff --git a/docs/pages/FrustumArray.html.md b/docs/pages/FrustumArray.html.md index a7d437ec41db98..882d34052890b9 100644 --- a/docs/pages/FrustumArray.html.md +++ b/docs/pages/FrustumArray.html.md @@ -24,75 +24,85 @@ Returns a new frustum array with copied values from this instance. **Returns:** A clone of this instance. -### .containsPoint( point : Vector3, cameraArray : Object ) : boolean +### .containsPoint( point : Vector3 ) : boolean -Returns `true` if the given point lies within any frustum from the camera array. +Returns `true` if the given point lies within any cached frustum. + +[FrustumArray#setFromArrayCamera](FrustumArray.html#setFromArrayCamera) must be called once per render before this method. **point** The point to test. -**cameraArray** +**Returns:** Whether the point is visible in any camera. -An object with a cameras property containing an array of cameras. +### .copy( frustumArray : FrustumArray ) : FrustumArray -**Returns:** Whether the point is visible in any camera. +Copies the values of the given frustum array to this instance. -### .intersectsBox( box : Box3, cameraArray : Object ) : boolean +**frustumArray** -Returns `true` if the given bounding box is intersecting any frustum from the camera array. +The frustum array to copy. -**box** +**Returns:** A reference to this frustum array. -The bounding box to test. +### .intersectsBox( box : Box3 ) : boolean -**cameraArray** +Returns `true` if the given bounding box is intersecting any cached frustum. -An object with a cameras property containing an array of cameras. +[FrustumArray#setFromArrayCamera](FrustumArray.html#setFromArrayCamera) must be called once per render before this method. + +**box** + +The bounding box to test. **Returns:** Whether the box is visible in any camera. -### .intersectsObject( object : Object3D, cameraArray : Object ) : boolean +### .intersectsObject( object : Object3D ) : boolean + +Returns `true` if the 3D object's bounding sphere is intersecting any cached frustum. -Returns `true` if the 3D object's bounding sphere is intersecting any frustum from the camera array. +[FrustumArray#setFromArrayCamera](FrustumArray.html#setFromArrayCamera) must be called once per render before this method. **object** The 3D object to test. -**cameraArray** - -An object with a cameras property containing an array of cameras. - **Returns:** Whether the 3D object is visible in any camera. -### .intersectsSphere( sphere : Sphere, cameraArray : Object ) : boolean +### .intersectsSphere( sphere : Sphere ) : boolean + +Returns `true` if the given bounding sphere is intersecting any cached frustum. -Returns `true` if the given bounding sphere is intersecting any frustum from the camera array. +[FrustumArray#setFromArrayCamera](FrustumArray.html#setFromArrayCamera) must be called once per render before this method. **sphere** The bounding sphere to test. -**cameraArray** - -An object with a cameras property containing an array of cameras. - **Returns:** Whether the sphere is visible in any camera. -### .intersectsSprite( sprite : Sprite, cameraArray : Object ) : boolean +### .intersectsSprite( sprite : Sprite ) : boolean -Returns `true` if the given sprite is intersecting any frustum from the camera array. +Returns `true` if the given sprite is intersecting any cached frustum. + +[FrustumArray#setFromArrayCamera](FrustumArray.html#setFromArrayCamera) must be called once per render before this method. **sprite** The sprite to test. +**Returns:** Whether the sprite is visible in any camera. + +### .setFromArrayCamera( cameraArray : ArrayCamera ) : FrustumArray + +Computes and caches a frustum for each camera of the given array camera. + **cameraArray** -An object with a cameras property containing an array of cameras. +The array camera whose sub-cameras define the frustums. -**Returns:** Whether the sprite is visible in any camera. +**Returns:** A reference to this frustum array. ## Source diff --git a/docs/pages/GLTFExporter.html b/docs/pages/GLTFExporter.html index 6807ce73e3d6d5..c0235b604f5398 100644 --- a/docs/pages/GLTFExporter.html +++ b/docs/pages/GLTFExporter.html @@ -299,9 +299,12 @@

    .Options < animations
    Array.<AnimationClip> +| +Array.<Array.<AnimationClip>> -

    List of animations to be included in the export.

    +

    List of animations to be included in the export. When exporting a single 3D object or scene, this is a flat list of clips. +When exporting an array of multiple scenes, this must be a nested array with one list of clips per scene, matched to the input by index.

    Default is [].

    diff --git a/docs/pages/GLTFExporter.html.md b/docs/pages/GLTFExporter.html.md index 485ee6539224da..3c3883bb62a13f 100644 --- a/docs/pages/GLTFExporter.html.md +++ b/docs/pages/GLTFExporter.html.md @@ -175,9 +175,9 @@ Restricts the image maximum size (both width and height) to the given value. Default is `Infinity`. **animations** -Array.<[AnimationClip](AnimationClip.html)\> +Array.<[AnimationClip](AnimationClip.html)\> | Array.> -List of animations to be included in the export. +List of animations to be included in the export. When exporting a single 3D object or scene, this is a flat list of clips. When exporting an array of multiple scenes, this must be a nested array with one list of clips per scene, matched to the input by index. Default is `[]`. diff --git a/docs/pages/InstanceNode.html b/docs/pages/InstanceNode.html deleted file mode 100644 index 7f69b3e4dc4e7b..00000000000000 --- a/docs/pages/InstanceNode.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - - InstanceNode - Three.js Docs - - - - - - -

    EventDispatcherNode

    -

    InstanceNode

    -
    -
    -

    This node implements the vertex shader logic which is required -when rendering 3D objects via instancing. The code makes sure -vertex positions, normals and colors can be modified via instanced -data.

    -
    -
    -
    -

    Constructor

    -

    new InstanceNode( count : number, instanceMatrix : InstancedBufferAttribute | StorageInstancedBufferAttribute, instanceColor : InstancedBufferAttribute | StorageInstancedBufferAttribute )

    -
    -
    -

    Constructs a new instance node.

    -
    - - - - - - - - - - - - - - - -
    - count - -

    The number of instances.

    -
    - instanceMatrix - -

    Instanced buffer attribute representing the instance transformations.

    -
    - instanceColor - -

    Instanced buffer attribute representing the instance colors.

    -

    Default is null.

    -
    -
    -
    -

    Properties

    -
    -

    .buffer : InstancedInterleavedBuffer

    -
    -

    A reference to a buffer that is used by instanceMatrixNode.

    -
    -
    -
    -

    .bufferColor : InstancedBufferAttribute

    -
    -

    A reference to a buffer that is used by instanceColorNode.

    -
    -
    -
    -

    .count : number

    -
    -

    The number of instances.

    -
    -
    -
    -

    .instanceColor : InstancedBufferAttribute

    -
    -

    Instanced buffer attribute representing the color of instances.

    -
    -
    -
    -

    .instanceColorNode : Node

    -
    -

    The node that represents the instance color data.

    -

    Default is null.

    -
    -
    -
    -

    .instanceMatrix : InstancedBufferAttribute

    -
    -

    Instanced buffer attribute representing the transformation of instances.

    -
    -
    -
    -

    .instanceMatrixNode : Node

    -
    -

    The node that represents the instance matrix data.

    -
    -
    -
    -

    .isStorageColor : boolean

    -
    -

    Tracks whether the color data is provided via a storage buffer.

    -
    -
    -
    -

    .isStorageMatrix : boolean

    -
    -

    Tracks whether the matrix data is provided via a storage buffer.

    -
    -
    -
    -

    .previousInstanceMatrixNode : Node

    -
    -

    The previous instance matrices. Required for computing motion vectors.

    -

    Default is null.

    -
    -
    -
    -

    .updateType : string

    -
    -

    The update type is set to frame since an update -of instanced buffer data must be checked per frame.

    -

    Default is 'frame'.

    -
    -
    -
    Overrides: Node#updateType
    -
    -
    -

    Methods

    -

    .getPreviousInstancedPosition( builder : NodeBuilder ) : Node.<vec3>

    -
    -
    -

    Computes the transformed/instanced vertex position of the previous frame.

    -
    - - - - - - - -
    - builder - -

    The current node builder.

    -
    -
    -
    Returns: The instanced position from the previous frame.
    -
    -
    -

    .setup( builder : NodeBuilder )

    -
    -
    -

    Setups the internal buffers and nodes and assigns the transformed vertex data -to predefined node variables for accumulation. That follows the same patterns -like with morph and skinning nodes.

    -
    - - - - - - - -
    - builder - -

    The current node builder.

    -
    -
    -
    Overrides: Node#setup
    -
    -
    -

    .update( frame : NodeFrame )

    -
    -
    -

    Checks if the internal buffers require an update.

    -
    - - - - - - - -
    - frame - -

    The current node frame.

    -
    -
    -
    Overrides: Node#update
    -
    -
    -

    Source

    -

    - src/nodes/accessors/InstanceNode.js -

    -
    -
    - - - - \ No newline at end of file diff --git a/docs/pages/InstanceNode.html.md b/docs/pages/InstanceNode.html.md deleted file mode 100644 index 6b7f7b78f6b771..00000000000000 --- a/docs/pages/InstanceNode.html.md +++ /dev/null @@ -1,115 +0,0 @@ -*Inheritance: EventDispatcher → Node →* - -# InstanceNode - -This node implements the vertex shader logic which is required when rendering 3D objects via instancing. The code makes sure vertex positions, normals and colors can be modified via instanced data. - -## Constructor - -### new InstanceNode( count : number, instanceMatrix : InstancedBufferAttribute | StorageInstancedBufferAttribute, instanceColor : InstancedBufferAttribute | StorageInstancedBufferAttribute ) - -Constructs a new instance node. - -**count** - -The number of instances. - -**instanceMatrix** - -Instanced buffer attribute representing the instance transformations. - -**instanceColor** - -Instanced buffer attribute representing the instance colors. - -Default is `null`. - -## Properties - -### .buffer : InstancedInterleavedBuffer - -A reference to a buffer that is used by `instanceMatrixNode`. - -### .bufferColor : InstancedBufferAttribute - -A reference to a buffer that is used by `instanceColorNode`. - -### .count : number - -The number of instances. - -### .instanceColor : InstancedBufferAttribute - -Instanced buffer attribute representing the color of instances. - -### .instanceColorNode : Node - -The node that represents the instance color data. - -Default is `null`. - -### .instanceMatrix : InstancedBufferAttribute - -Instanced buffer attribute representing the transformation of instances. - -### .instanceMatrixNode : Node - -The node that represents the instance matrix data. - -### .isStorageColor : boolean - -Tracks whether the color data is provided via a storage buffer. - -### .isStorageMatrix : boolean - -Tracks whether the matrix data is provided via a storage buffer. - -### .previousInstanceMatrixNode : Node - -The previous instance matrices. Required for computing motion vectors. - -Default is `null`. - -### .updateType : string - -The update type is set to `frame` since an update of instanced buffer data must be checked per frame. - -Default is `'frame'`. - -**Overrides:** [Node#updateType](Node.html#updateType) - -## Methods - -### .getPreviousInstancedPosition( builder : NodeBuilder ) : Node. - -Computes the transformed/instanced vertex position of the previous frame. - -**builder** - -The current node builder. - -**Returns:** The instanced position from the previous frame. - -### .setup( builder : NodeBuilder ) - -Setups the internal buffers and nodes and assigns the transformed vertex data to predefined node variables for accumulation. That follows the same patterns like with morph and skinning nodes. - -**builder** - -The current node builder. - -**Overrides:** [Node#setup](Node.html#setup) - -### .update( frame : NodeFrame ) - -Checks if the internal buffers require an update. - -**frame** - -The current node frame. - -**Overrides:** [Node#update](Node.html#update) - -## Source - -[src/nodes/accessors/InstanceNode.js](https://github.com/mrdoob/three.js/blob/master/src/nodes/accessors/InstanceNode.js) \ No newline at end of file diff --git a/docs/pages/InstancedMesh.html b/docs/pages/InstancedMesh.html index b9aed18a6955a1..615ec013cbe185 100644 --- a/docs/pages/InstancedMesh.html +++ b/docs/pages/InstancedMesh.html @@ -114,14 +114,6 @@

    .morph

    Default is null.

    -
    -

    .previousInstanceMatrix : InstancedBufferAttribute

    -
    -

    Represents the local transformation of all instances of the previous frame. -Required for computing velocity. Maintained in InstanceNode.

    -

    Default is null.

    -
    -

    Methods

    .computeBoundingBox()

    diff --git a/docs/pages/InstancedMesh.html.md b/docs/pages/InstancedMesh.html.md index 21a1b249e0b05d..5cf091b4c55138 100644 --- a/docs/pages/InstancedMesh.html.md +++ b/docs/pages/InstancedMesh.html.md @@ -64,12 +64,6 @@ Represents the morph target weights of all instances. You have to set its [Textu Default is `null`. -### .previousInstanceMatrix : InstancedBufferAttribute - -Represents the local transformation of all instances of the previous frame. Required for computing velocity. Maintained in [InstanceNode](InstanceNode.html). - -Default is `null`. - ## Methods ### .computeBoundingBox() diff --git a/docs/pages/InstancedMeshNode.html b/docs/pages/InstancedMeshNode.html deleted file mode 100644 index ae9878fa3c4141..00000000000000 --- a/docs/pages/InstancedMeshNode.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - InstancedMeshNode - Three.js Docs - - - - - - -

    EventDispatcherNodeInstanceNode

    -

    InstancedMeshNode

    -
    -
    -

    This is a special version of InstanceNode which requires the usage of InstancedMesh. -It allows an easier setup of the instance node.

    -
    - -
    - - - - \ No newline at end of file diff --git a/docs/pages/InstancedMeshNode.html.md b/docs/pages/InstancedMeshNode.html.md deleted file mode 100644 index dddddc0695d141..00000000000000 --- a/docs/pages/InstancedMeshNode.html.md +++ /dev/null @@ -1,25 +0,0 @@ -*Inheritance: EventDispatcher → Node → InstanceNode →* - -# InstancedMeshNode - -This is a special version of `InstanceNode` which requires the usage of [InstancedMesh](InstancedMesh.html). It allows an easier setup of the instance node. - -## Constructor - -### new InstancedMeshNode( instancedMesh : InstancedMesh ) - -Constructs a new instanced mesh node. - -**instancedMesh** - -The instanced mesh. - -## Properties - -### .instancedMesh : InstancedMesh - -A reference to the instanced mesh. - -## Source - -[src/nodes/accessors/InstancedMeshNode.js](https://github.com/mrdoob/three.js/blob/master/src/nodes/accessors/InstancedMeshNode.js) \ No newline at end of file diff --git a/docs/pages/KTX2Loader.html b/docs/pages/KTX2Loader.html index 295fbe52319df7..4da80b6f4d712e 100644 --- a/docs/pages/KTX2Loader.html +++ b/docs/pages/KTX2Loader.html @@ -201,8 +201,8 @@

    .parse.setTranscoderPath( path : string ) : KTX2Loader

    -

    Sets the transcoder path.

    -

    The WASM transcoder and JS wrapper are available from the examples/jsm/libs/basis directory.

    +

    Sets the transcoder path to optionally set the decoder load path from a CDN.

    +

    By default The WASM transcoder and JS wrapper are loaded from the examples/jsm/libs/basis directory.

    diff --git a/docs/pages/KTX2Loader.html.md b/docs/pages/KTX2Loader.html.md index a20c003e5fa0ba..1aadf7b62a0f8f 100644 --- a/docs/pages/KTX2Loader.html.md +++ b/docs/pages/KTX2Loader.html.md @@ -115,9 +115,9 @@ Executed when errors occur. ### .setTranscoderPath( path : string ) : KTX2Loader -Sets the transcoder path. +Sets the transcoder path to optionally set the decoder load path from a CDN. -The WASM transcoder and JS wrapper are available from the `examples/jsm/libs/basis` directory. +By default The WASM transcoder and JS wrapper are loaded from the `examples/jsm/libs/basis` directory. **path** diff --git a/docs/pages/LWOLoader.html b/docs/pages/LWOLoader.html index 6f0118b79f7696..cebd277ea066ad 100644 --- a/docs/pages/LWOLoader.html +++ b/docs/pages/LWOLoader.html @@ -50,6 +50,9 @@

    new +
    Deprecated: since r185.
    +

    Methods

    diff --git a/docs/pages/LWOLoader.html.md b/docs/pages/LWOLoader.html.md index fa8cc1f439d8c3..666f835182a937 100644 --- a/docs/pages/LWOLoader.html.md +++ b/docs/pages/LWOLoader.html.md @@ -38,6 +38,8 @@ Constructs a new LWO loader. The loading manager. +**Deprecated:** since r185. + ## Methods ### .load( url : string, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback ) diff --git a/docs/pages/LightProbeGrid.html b/docs/pages/LightProbeGrid.html index 0c0dda5932116d..31b555383b371a 100644 --- a/docs/pages/LightProbeGrid.html +++ b/docs/pages/LightProbeGrid.html @@ -154,7 +154,10 @@

    .bake<

    Bakes all probes by rendering cubemaps at each probe position -and projecting to L2 SH. Fully GPU-resident with zero CPU readback.

    +and projecting to L2 SH. Optionally iterates additional passes to +capture indirect bounces — each extra pass samples the previous pass's +atlas as indirect light, so a grid added to the scene before baking +accumulates one bounce per extra pass.

    @@ -209,6 +212,15 @@

    .bake<

    Default is 100.

    +

    + + +
    + bounces + +

    Additional bounce passes after the initial direct pass.

    +

    Default is 0.

    +
    diff --git a/docs/pages/LightProbeGrid.html.md b/docs/pages/LightProbeGrid.html.md index ab6e8750d0e3fb..07a846c1b5d694 100644 --- a/docs/pages/LightProbeGrid.html.md +++ b/docs/pages/LightProbeGrid.html.md @@ -107,7 +107,7 @@ The full width of the volume along X. ### .bake( renderer : WebGLRenderer, scene : Scene, options : Object ) -Bakes all probes by rendering cubemaps at each probe position and projecting to L2 SH. Fully GPU-resident with zero CPU readback. +Bakes all probes by rendering cubemaps at each probe position and projecting to L2 SH. Optionally iterates additional passes to capture indirect bounces — each extra pass samples the previous pass's atlas as indirect light, so a grid added to the scene before baking accumulates one bounce per extra pass. **renderer** @@ -139,6 +139,12 @@ Far plane for the cube camera. Default is `100`. +**bounces** + +Additional bounce passes after the initial direct pass. + +Default is `0`. + ### .dispose() Frees GPU resources. diff --git a/docs/pages/LightingContextNode.html b/docs/pages/LightingContextNode.html index 7971b59975f3f8..9c97010cb0d03e 100644 --- a/docs/pages/LightingContextNode.html +++ b/docs/pages/LightingContextNode.html @@ -20,7 +20,7 @@

    LightingContextNode

    Constructor

    -

    new LightingContextNode( lightsNode : LightsNode, lightingModel : LightingModel, backdropNode : Node.<vec3>, backdropAlphaNode : Node.<float> )

    +

    new LightingContextNode( lightsNode : LightsNode, lightingModel : LightingModel, materialLightings : Array.<LightingNode>, backdropNode : Node.<vec3>, backdropAlphaNode : Node.<float> )

    +

    Methods

    .getContext() : Object

    diff --git a/docs/pages/LightingContextNode.html.md b/docs/pages/LightingContextNode.html.md index c266122542beb2..e0ef9e8d02a39a 100644 --- a/docs/pages/LightingContextNode.html.md +++ b/docs/pages/LightingContextNode.html.md @@ -6,7 +6,7 @@ ## Constructor -### new LightingContextNode( lightsNode : LightsNode, lightingModel : LightingModel, backdropNode : Node., backdropAlphaNode : Node. ) +### new LightingContextNode( lightsNode : LightsNode, lightingModel : LightingModel, materialLightings : Array., backdropNode : Node., backdropAlphaNode : Node. ) Constructs a new lighting context node. @@ -20,6 +20,10 @@ The current lighting model. Default is `null`. +**materialLightings** + +The material lightings nodes. + **backdropNode** A backdrop node. @@ -52,6 +56,8 @@ The current lighting model. Default is `null`. +### .materialLightings : Array. + ## Methods ### .getContext() : Object diff --git a/docs/pages/LightsNode.html b/docs/pages/LightsNode.html index 1d924843a836c6..95add287316459 100644 --- a/docs/pages/LightsNode.html +++ b/docs/pages/LightsNode.html @@ -63,6 +63,28 @@

    .Methods

    +

    .analyze( builder : NodeBuilder )

    +
    +
    +

    Analyzes the node's dependencies by building all nested light nodes +and the output node.

    +
    + + + + + + + +
    + builder + +

    A reference to the current node builder.

    +
    +
    +
    Overrides: Node#analyze
    +
    +

    .customCacheKey() : number

    @@ -190,6 +212,40 @@

    ..setupDirectRectAreaLight( builder : Object, lightNode : Object, lightData : Object )

    +
    +
    +

    Sets up a direct rect area light in the lighting model.

    +
    + + + + + + + + + + + + + + + +
    + builder + +

    The builder object containing the context and stack.

    +
    + lightNode + +

    The light node.

    +
    + lightData + +

    The light object containing color and area light properties.

    +
    +

    .setupLights( builder : NodeBuilder, lightNodes : Array.<LightingNode> )

    @@ -217,7 +273,7 @@

    ..setupLightsNode( builder : NodeBuilder )

    +

    .setupLightsNode( builder : NodeBuilder ) : Array.<LightingNode>

    Creates lighting nodes for each scene light. This makes it possible to further @@ -235,6 +291,9 @@

    . +
    Returns: The array of lighting nodes.
    +

    Source

    diff --git a/docs/pages/LightsNode.html.md b/docs/pages/LightsNode.html.md index 2f190fceec0932..33350747fa1464 100644 --- a/docs/pages/LightsNode.html.md +++ b/docs/pages/LightsNode.html.md @@ -38,6 +38,16 @@ A node representing the total specular light. ## Methods +### .analyze( builder : NodeBuilder ) + +Analyzes the node's dependencies by building all nested light nodes and the output node. + +**builder** + +A reference to the current node builder. + +**Overrides:** [Node#analyze](Node.html#analyze) + ### .customCacheKey() : number Overwrites the default [Node#customCacheKey](Node.html#customCacheKey) implementation by including light data into the cache key. @@ -102,6 +112,22 @@ The light node. The light object containing color and direction properties. +### .setupDirectRectAreaLight( builder : Object, lightNode : Object, lightData : Object ) + +Sets up a direct rect area light in the lighting model. + +**builder** + +The builder object containing the context and stack. + +**lightNode** + +The light node. + +**lightData** + +The light object containing color and area light properties. + ### .setupLights( builder : NodeBuilder, lightNodes : Array. ) Setups the internal lights by building all respective light nodes. @@ -114,7 +140,7 @@ A reference to the current node builder. An array of lighting nodes. -### .setupLightsNode( builder : NodeBuilder ) +### .setupLightsNode( builder : NodeBuilder ) : Array. Creates lighting nodes for each scene light. This makes it possible to further process lights in the node system. @@ -122,6 +148,8 @@ Creates lighting nodes for each scene light. This makes it possible to further p A reference to the current node builder. +**Returns:** The array of lighting nodes. + ## Source [src/nodes/lighting/LightsNode.js](https://github.com/mrdoob/three.js/blob/master/src/nodes/lighting/LightsNode.js) \ No newline at end of file diff --git a/docs/pages/Line2NodeMaterial.html b/docs/pages/Line2NodeMaterial.html index b1c69c8c029dfe..e5aa2ee1f30cbd 100644 --- a/docs/pages/Line2NodeMaterial.html +++ b/docs/pages/Line2NodeMaterial.html @@ -107,8 +107,10 @@

    ..lineColorNode : Node.<vec3>

    Defines the lines color.

    -

    Default is null.

    +
    +
    Deprecated: since r185. Use NodeMaterial#colorNode instead.
    +

    .offsetNode : Node.<float>

    @@ -136,34 +138,33 @@

    .worldUnit

    Methods

    -

    .copy( source : Line2NodeMaterial ) : Line2NodeMaterial

    +

    .setupDiffuseColor( builder : NodeBuilder )

    -

    Copies the properties of the given material to this instance.

    +

    Setups the diffuse color of the line material in the fragment stage. +Overrides the base setup to incorporate line/dash rendering and blending.

    - source + builder -

    The material to copy.

    +

    The current node builder.

    -
    Overrides: NodeMaterial#copy
    -
    -
    -
    Returns: A reference to this material.
    +
    Overrides: NodeMaterial#setupDiffuseColor
    -

    .setup( builder : NodeBuilder )

    +

    .setupModelViewProjection( builder : NodeBuilder ) : Node.<vec4>

    -

    Setups the vertex and fragment stage of this node material.

    +

    Setups the position in clip space for the vertex stage of the fat line. +Overrides the default model-view-projection to return the expanded fat line vertex coordinates.

    @@ -178,7 +179,10 @@

    .setup

    -
    Overrides: NodeMaterial#setup
    +
    Overrides: NodeMaterial#setupModelViewProjection
    +
    +
    +
    Returns: The position of the fat line vertex in clip space.

    Source

    diff --git a/docs/pages/Line2NodeMaterial.html.md b/docs/pages/Line2NodeMaterial.html.md index 56e8fa2f0b495d..afd56e6a9bc032 100644 --- a/docs/pages/Line2NodeMaterial.html.md +++ b/docs/pages/Line2NodeMaterial.html.md @@ -74,7 +74,7 @@ Default is `true`. Defines the lines color. -Default is `null`. +**Deprecated:** since r185. Use [NodeMaterial#colorNode](NodeMaterial.html#colorNode) instead. ### .offsetNode : Node. @@ -98,27 +98,27 @@ Default is `false`. ## Methods -### .copy( source : Line2NodeMaterial ) : Line2NodeMaterial - -Copies the properties of the given material to this instance. +### .setupDiffuseColor( builder : NodeBuilder ) -**source** +Setups the diffuse color of the line material in the fragment stage. Overrides the base setup to incorporate line/dash rendering and blending. -The material to copy. +**builder** -**Overrides:** [NodeMaterial#copy](NodeMaterial.html#copy) +The current node builder. -**Returns:** A reference to this material. +**Overrides:** [NodeMaterial#setupDiffuseColor](NodeMaterial.html#setupDiffuseColor) -### .setup( builder : NodeBuilder ) +### .setupModelViewProjection( builder : NodeBuilder ) : Node. -Setups the vertex and fragment stage of this node material. +Setups the position in clip space for the vertex stage of the fat line. Overrides the default model-view-projection to return the expanded fat line vertex coordinates. **builder** The current node builder. -**Overrides:** [NodeMaterial#setup](NodeMaterial.html#setup) +**Overrides:** [NodeMaterial#setupModelViewProjection](NodeMaterial.html#setupModelViewProjection) + +**Returns:** The position of the fat line vertex in clip space. ## Source diff --git a/docs/pages/LineBasicMaterial.html b/docs/pages/LineBasicMaterial.html index 2148f375223498..6714803eb44a09 100644 --- a/docs/pages/LineBasicMaterial.html +++ b/docs/pages/LineBasicMaterial.html @@ -98,6 +98,9 @@

    .map

    Sets the color of the lines using data from a texture. The texture map color is modulated by the diffuse color.

    +

    map represents color data, and the texture must be assigned a +Texture#colorSpace. Most map textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    diff --git a/docs/pages/LineBasicMaterial.html.md b/docs/pages/LineBasicMaterial.html.md index f00e2afae9942a..de15a0c4a44645 100644 --- a/docs/pages/LineBasicMaterial.html.md +++ b/docs/pages/LineBasicMaterial.html.md @@ -70,6 +70,8 @@ Default is `1`. Sets the color of the lines using data from a texture. The texture map color is modulated by the diffuse `color`. +`map` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `map` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ## Source diff --git a/docs/pages/LoftGeometry.html b/docs/pages/LoftGeometry.html new file mode 100644 index 00000000000000..ccb693b7737503 --- /dev/null +++ b/docs/pages/LoftGeometry.html @@ -0,0 +1,132 @@ + + + + + LoftGeometry - Three.js Docs + + + + + + +

    EventDispatcherBufferGeometry

    +

    LoftGeometry

    +
    +
    +

    This class can be used to generate a geometry by lofting (skinning) a surface +through a series of cross sections. Each section is an array of points in 3D +space and all sections must have the same number of points.

    +

    LoftGeometry is the general case of geometries like LatheGeometry +(which revolves a fixed profile around an axis) or TubeGeometry +(which sweeps a circular section along a path): the sections can have any +shape, and can change shape, size, position and orientation from one +section to the next.

    +

    Sections wind around the loft so the resulting face normals point outwards +when each section is ordered counterclockwise as seen from the end of the +loft, looking back towards the start. If the surface appears inside out, +reverse the point order of each section.

    +

    Code Example

    +
    const sections = [];
    +for ( let i = 0; i <= 10; i ++ ) {
    +	const points = [];
    +	const radius = 2 + Math.sin( i * 0.8 );
    +	for ( let j = 0; j < 32; j ++ ) {
    +		const angle = j / 32 * Math.PI * 2;
    +		points.push( new THREE.Vector3( Math.sin( angle ) * radius, i, Math.cos( angle ) * radius ) );
    +	}
    +	sections.push( points );
    +}
    +const geometry = new LoftGeometry( sections, { capStart: true, capEnd: true } );
    +const material = new THREE.MeshStandardMaterial( { color: 0x00ff00 } );
    +const mesh = new THREE.Mesh( geometry, material );
    +scene.add( mesh );
    +
    +
    +
    +

    Import

    +

    LoftGeometry is an addon, and must be imported explicitly, see Installation#Addons.

    +
    import { LoftGeometry } from 'three/addons/geometries/LoftGeometry.js';
    +
    +

    Constructor

    +

    new LoftGeometry( sections : Array.<Array.<Vector3>>, options : Object )

    +
    +
    +

    Constructs a new loft geometry.

    +
    + + + + + + + + + + + +
    + sections + +

    The cross sections to skin. At least +two sections are required and all sections must have the same number of points.

    +
    + options + +

    The loft options.

    +

    Default is {}.

    + + + + + + + + + + + + + + + +
    + closed + +

    Whether each section is treated as a +closed ring (e.g. a fuselage) or an open strip (e.g. a ribbon).

    +

    Default is true.

    +
    + capStart + +

    Whether the first section is closed +with a cap or not.

    +

    Default is false.

    +
    + capEnd + +

    Whether the last section is closed +with a cap or not.

    +

    Default is false.

    +
    +
    +
    +
    +

    Properties

    +
    +

    .parameters : Object

    +
    +

    Holds the constructor parameters that have been +used to generate the geometry. Any modification +after instantiation does not change the geometry.

    +
    +
    +

    Source

    +

    + examples/jsm/geometries/LoftGeometry.js +

    +
    +
    + + + + \ No newline at end of file diff --git a/docs/pages/LoftGeometry.html.md b/docs/pages/LoftGeometry.html.md new file mode 100644 index 00000000000000..389d6dd87c6882 --- /dev/null +++ b/docs/pages/LoftGeometry.html.md @@ -0,0 +1,80 @@ +*Inheritance: EventDispatcher → BufferGeometry →* + +# LoftGeometry + +This class can be used to generate a geometry by lofting (skinning) a surface through a series of cross sections. Each section is an array of points in 3D space and all sections must have the same number of points. + +`LoftGeometry` is the general case of geometries like [LatheGeometry](LatheGeometry.html) (which revolves a fixed profile around an axis) or [TubeGeometry](TubeGeometry.html) (which sweeps a circular section along a path): the sections can have any shape, and can change shape, size, position and orientation from one section to the next. + +Sections wind around the loft so the resulting face normals point outwards when each section is ordered counterclockwise as seen from the end of the loft, looking back towards the start. If the surface appears inside out, reverse the point order of each section. + +## Code Example + +```js +const sections = []; +for ( let i = 0; i <= 10; i ++ ) { + const points = []; + const radius = 2 + Math.sin( i * 0.8 ); + for ( let j = 0; j < 32; j ++ ) { + const angle = j / 32 * Math.PI * 2; + points.push( new THREE.Vector3( Math.sin( angle ) * radius, i, Math.cos( angle ) * radius ) ); + } + sections.push( points ); +} +const geometry = new LoftGeometry( sections, { capStart: true, capEnd: true } ); +const material = new THREE.MeshStandardMaterial( { color: 0x00ff00 } ); +const mesh = new THREE.Mesh( geometry, material ); +scene.add( mesh ); +``` + +## Import + +LoftGeometry is an addon, and must be imported explicitly, see [Installation#Addons](https://threejs.org/manual/#en/installation). + +```js +import { LoftGeometry } from 'three/addons/geometries/LoftGeometry.js'; +``` + +## Constructor + +### new LoftGeometry( sections : Array.>, options : Object ) + +Constructs a new loft geometry. + +**sections** + +The cross sections to skin. At least two sections are required and all sections must have the same number of points. + +**options** + +The loft options. + +Default is `{}`. + +**closed** + +Whether each section is treated as a closed ring (e.g. a fuselage) or an open strip (e.g. a ribbon). + +Default is `true`. + +**capStart** + +Whether the first section is closed with a cap or not. + +Default is `false`. + +**capEnd** + +Whether the last section is closed with a cap or not. + +Default is `false`. + +## Properties + +### .parameters : Object + +Holds the constructor parameters that have been used to generate the geometry. Any modification after instantiation does not change the geometry. + +## Source + +[examples/jsm/geometries/LoftGeometry.js](https://github.com/mrdoob/three.js/blob/master/examples/jsm/geometries/LoftGeometry.js) \ No newline at end of file diff --git a/docs/pages/Material.html b/docs/pages/Material.html index 0cea1cfea462d2..9b81252c4ca7fd 100644 --- a/docs/pages/Material.html +++ b/docs/pages/Material.html @@ -482,6 +482,35 @@
    Fires:
  • Material#event:dispose
  • +

    .fromJSON( json : Object, textures : Object.<string, Texture> ) : Material

    +
    +
    +

    Deserializes the material from the given JSON.

    +
    + + + + + + + + + + + +
    + json + +

    The JSON holding the serialized material.

    +
    + textures + +

    A dictionary holding textures referenced by the material.

    +
    +
    +
    Returns: A reference to this material.
    +
    +

    .onBeforeCompile( shaderobject : Object, renderer : WebGLRenderer )

    diff --git a/docs/pages/Material.html.md b/docs/pages/Material.html.md index df7a60bac0b3ec..18c2c19ee63338 100644 --- a/docs/pages/Material.html.md +++ b/docs/pages/Material.html.md @@ -364,6 +364,20 @@ Frees the GPU-related resources allocated by this instance. Call this method whe * [Material#event:dispose](Material.html#event:dispose) +### .fromJSON( json : Object, textures : Object. ) : Material + +Deserializes the material from the given JSON. + +**json** + +The JSON holding the serialized material. + +**textures** + +A dictionary holding textures referenced by the material. + +**Returns:** A reference to this material. + ### .onBeforeCompile( shaderobject : Object, renderer : WebGLRenderer ) An optional callback that is executed immediately before the shader program is compiled. This function is called with the shader source code as a parameter. Useful for the modification of built-in materials. diff --git a/docs/pages/MaterialLoader.html b/docs/pages/MaterialLoader.html index 9037c9fddc1bad..f44d0f2c0974f7 100644 --- a/docs/pages/MaterialLoader.html +++ b/docs/pages/MaterialLoader.html @@ -185,6 +185,33 @@

    .Returns: The new material.

    +

    .registerMaterial( type : string, materialClass : Material.constructor )

    +
    +
    +

    Registers the given material at the internal +material library.

    +
    + + + + + + + + + + + +
    + type + +

    The material type.

    +
    + materialClass + +

    The material class.

    +
    +

    Source

    src/loaders/MaterialLoader.js diff --git a/docs/pages/MaterialLoader.html.md b/docs/pages/MaterialLoader.html.md index 408a99c02246f9..2f23688352dcd9 100644 --- a/docs/pages/MaterialLoader.html.md +++ b/docs/pages/MaterialLoader.html.md @@ -97,6 +97,18 @@ The material type. **Returns:** The new material. +### .registerMaterial( type : string, materialClass : Material.constructor ) + +Registers the given material at the internal material library. + +**type** + +The material type. + +**materialClass** + +The material class. + ## Source [src/loaders/MaterialLoader.js](https://github.com/mrdoob/three.js/blob/master/src/loaders/MaterialLoader.js) \ No newline at end of file diff --git a/docs/pages/Matrix3.html b/docs/pages/Matrix3.html index f396a6a6e019aa..70fb7502c9e4b6 100644 --- a/docs/pages/Matrix3.html +++ b/docs/pages/Matrix3.html @@ -489,6 +489,9 @@

    .rotat +
    +
    Deprecated: Yes
    +
    Returns: A reference to this matrix.
    @@ -518,6 +521,9 @@

    .scale +
    +
    Deprecated: Yes
    +
    Returns: A reference to this matrix.
    @@ -755,6 +761,9 @@

    . +
    +
    Deprecated: Yes
    +
    Returns: A reference to this matrix.
    diff --git a/docs/pages/Matrix3.html.md b/docs/pages/Matrix3.html.md index 14f0b0dec32a54..641fb2c5662ef5 100644 --- a/docs/pages/Matrix3.html.md +++ b/docs/pages/Matrix3.html.md @@ -251,6 +251,8 @@ Rotates this matrix by the given angle. The rotation in radians. +**Deprecated:** Yes + **Returns:** A reference to this matrix. ### .scale( sx : number, sy : number ) : Matrix3 @@ -265,6 +267,8 @@ The amount to scale in the X axis. The amount to scale in the Y axis. +**Deprecated:** Yes + **Returns:** A reference to this matrix. ### .set( n11 : number, n12 : number, n13 : number, n21 : number, n22 : number, n23 : number, n31 : number, n32 : number, n33 : number ) : Matrix3 @@ -383,6 +387,8 @@ The amount to translate in the X axis. The amount to translate in the Y axis. +**Deprecated:** Yes + **Returns:** A reference to this matrix. ### .transpose() : Matrix3 diff --git a/docs/pages/Matrix4.html b/docs/pages/Matrix4.html index e9f7ac5c1ba8b4..6fe690c51b60f5 100644 --- a/docs/pages/Matrix4.html +++ b/docs/pages/Matrix4.html @@ -336,6 +336,19 @@

    .Returns: The determinant.

    +

    .determinantAffine() : number

    +
    +
    +

    Computes and returns the determinant of the 4x4 matrix, but assumes the +matrix is affine, saving some computations.

    +

    For affine matrices (like an object's world matrix), this value equals the +full 4x4 Matrix4#determinant but is cheaper to compute.

    +

    Assumes the bottom row is [0, 0, 0, 1].

    +
    +
    +
    Returns: The determinant of the matrix.
    +
    +

    .equals( matrix : Matrix4 ) : boolean

    diff --git a/docs/pages/Matrix4.html.md b/docs/pages/Matrix4.html.md index 42fb0d84763268..0ac5125c2ac468 100644 --- a/docs/pages/Matrix4.html.md +++ b/docs/pages/Matrix4.html.md @@ -179,6 +179,16 @@ Based on the method outlined [here](http://www.euclideanspace.com/maths/algebra/ **Returns:** The determinant. +### .determinantAffine() : number + +Computes and returns the determinant of the 4x4 matrix, but assumes the matrix is affine, saving some computations. + +For affine matrices (like an object's world matrix), this value equals the full 4x4 [Matrix4#determinant](Matrix4.html#determinant) but is cheaper to compute. + +Assumes the bottom row is \[0, 0, 0, 1\]. + +**Returns:** The determinant of the matrix. + ### .equals( matrix : Matrix4 ) : boolean Returns `true` if this matrix is equal with the given one. diff --git a/docs/pages/MeshBasicMaterial.html b/docs/pages/MeshBasicMaterial.html index d6bf6e613d6f69..16a5b8ce53089f 100644 --- a/docs/pages/MeshBasicMaterial.html +++ b/docs/pages/MeshBasicMaterial.html @@ -54,6 +54,8 @@

    .alphaMap< when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.

    +

    alphaMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -62,6 +64,8 @@

    .aoMap

    The red channel of this texture is used as the ambient occlusion map. Requires a second set of UVs.

    +

    aoMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -94,6 +98,10 @@

    .combine.envMap : Texture

    The environment map.

    +

    envMap represents luminance data, and the texture must be assigned +a Texture#colorSpace. Most envMap textures set +texture.colorSpace = LinearSRGBColorSpace and use float-type formats +such as .exr or .hdr.

    Default is null.

    @@ -122,6 +130,10 @@

    ..lightMap : Texture

    The light map. Requires a second set of UVs.

    +

    lightMap represents pre-baked illuminance data, and the texture must be assigned +a Texture#colorSpace. Most lightMap textures set +texture.colorSpace = LinearSRGBColorSpace and use float-type formats +such as .exr or .hdr.

    Default is null.

    @@ -138,6 +150,9 @@

    .mapMaterial#transparent or Material#alphaTest. The texture map color is modulated by the diffuse color.

    +

    map represents color data, and the texture must be assigned a +Texture#colorSpace. Most map textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    @@ -163,6 +178,9 @@

    ..specularMap : Texture

    Specular map used by the material.

    +

    specularMap represents color data, and the texture must be assigned a +Texture#colorSpace. Most specularMap textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    diff --git a/docs/pages/MeshBasicMaterial.html.md b/docs/pages/MeshBasicMaterial.html.md index 4337d8fdc7deea..3988ac20d24471 100644 --- a/docs/pages/MeshBasicMaterial.html.md +++ b/docs/pages/MeshBasicMaterial.html.md @@ -24,12 +24,16 @@ The alpha map is a grayscale texture that controls the opacity across the surfac Only the color of the texture is used, ignoring the alpha channel if one exists. For RGB and RGBA textures, the renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected. +`alphaMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .aoMap : Texture The red channel of this texture is used as the ambient occlusion map. Requires a second set of UVs. +`aoMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .aoMapIntensity : number @@ -56,6 +60,8 @@ Default is `MultiplyOperation`. The environment map. +`envMap` represents luminance data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `envMap` textures set `texture.colorSpace = LinearSRGBColorSpace` and use float-type formats such as `.exr` or `.hdr`. + Default is `null`. ### .envMapRotation : Euler @@ -80,6 +86,8 @@ Default is `true`. The light map. Requires a second set of UVs. +`lightMap` represents pre-baked illuminance data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `lightMap` textures set `texture.colorSpace = LinearSRGBColorSpace` and use float-type formats such as `.exr` or `.hdr`. + Default is `null`. ### .lightMapIntensity : number @@ -92,6 +100,8 @@ Default is `1`. The color map. May optionally include an alpha channel, typically combined with [Material#transparent](Material.html#transparent) or [Material#alphaTest](Material.html#alphaTest). The texture map color is modulated by the diffuse `color`. +`map` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `map` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .reflectivity : number @@ -110,6 +120,8 @@ Default is `0.98`. Specular map used by the material. +`specularMap` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `specularMap` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .wireframe : boolean diff --git a/docs/pages/MeshDepthMaterial.html b/docs/pages/MeshDepthMaterial.html index 00726f2ecfc9dc..a29d9998ac525a 100644 --- a/docs/pages/MeshDepthMaterial.html +++ b/docs/pages/MeshDepthMaterial.html @@ -54,6 +54,8 @@

    .alphaMap< when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.

    +

    alphaMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -82,6 +84,8 @@

    . +

    displacementMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -106,6 +110,9 @@

    .map

    The color map. May optionally include an alpha channel, typically combined with Material#transparent or Material#alphaTest.

    +

    map represents color data, and the texture must be assigned a +Texture#colorSpace. Most map textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    diff --git a/docs/pages/MeshDepthMaterial.html.md b/docs/pages/MeshDepthMaterial.html.md index b045ca57ec518f..73394735020510 100644 --- a/docs/pages/MeshDepthMaterial.html.md +++ b/docs/pages/MeshDepthMaterial.html.md @@ -22,6 +22,8 @@ The alpha map is a grayscale texture that controls the opacity across the surfac Only the color of the texture is used, ignoring the alpha channel if one exists. For RGB and RGBA textures, the renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected. +`alphaMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .depthPacking : BasicDepthPacking | RGBADepthPacking | RGBDepthPacking | RGDepthPacking @@ -40,6 +42,8 @@ Default is `0`. The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows, block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh. +`displacementMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .displacementScale : number @@ -58,6 +62,8 @@ Default is `true`. The color map. May optionally include an alpha channel, typically combined with [Material#transparent](Material.html#transparent) or [Material#alphaTest](Material.html#alphaTest). +`map` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `map` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .wireframe : boolean diff --git a/docs/pages/MeshDistanceMaterial.html b/docs/pages/MeshDistanceMaterial.html index 87519ef8e6ff53..fdcd8dd28163c6 100644 --- a/docs/pages/MeshDistanceMaterial.html +++ b/docs/pages/MeshDistanceMaterial.html @@ -57,6 +57,8 @@

    .alphaMap< when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.

    +

    alphaMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -78,6 +80,8 @@

    . +

    displacementMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -102,6 +106,9 @@

    .map

    The color map. May optionally include an alpha channel, typically combined with Material#transparent or Material#alphaTest.

    +

    map represents color data, and the texture must be assigned a +Texture#colorSpace. Most map textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    diff --git a/docs/pages/MeshDistanceMaterial.html.md b/docs/pages/MeshDistanceMaterial.html.md index ac824e7b5c460c..9022d61f45b32f 100644 --- a/docs/pages/MeshDistanceMaterial.html.md +++ b/docs/pages/MeshDistanceMaterial.html.md @@ -24,6 +24,8 @@ The alpha map is a grayscale texture that controls the opacity across the surfac Only the color of the texture is used, ignoring the alpha channel if one exists. For RGB and RGBA textures, the renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected. +`alphaMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .displacementBias : number @@ -36,6 +38,8 @@ Default is `0`. The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows, block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh. +`displacementMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .displacementScale : number @@ -54,6 +58,8 @@ Default is `true`. The color map. May optionally include an alpha channel, typically combined with [Material#transparent](Material.html#transparent) or [Material#alphaTest](Material.html#alphaTest). +`map` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `map` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ## Source diff --git a/docs/pages/MeshLambertMaterial.html b/docs/pages/MeshLambertMaterial.html index 4a1d392ca14030..650dea7ec636ac 100644 --- a/docs/pages/MeshLambertMaterial.html +++ b/docs/pages/MeshLambertMaterial.html @@ -62,6 +62,8 @@

    .alphaMap< when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.

    +

    alphaMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -70,6 +72,8 @@

    .aoMap

    The red channel of this texture is used as the ambient occlusion map. Requires a second set of UVs.

    +

    aoMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -89,6 +93,8 @@

    .bumpMap +

    bumpMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -135,6 +141,8 @@

    . +

    displacementMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -168,6 +176,9 @@

    .emissiv

    Set emissive (glow) map. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.

    +

    emissiveMap represents color data, and the texture must be assigned a +Texture#colorSpace. Most emissiveMap textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    @@ -175,6 +186,10 @@

    .emissiv

    .envMap : Texture

    The environment map.

    +

    envMap represents luminance data, and the texture must be assigned +a Texture#colorSpace. Most envMap textures set +texture.colorSpace = LinearSRGBColorSpace and use float-type formats +such as .exr or .hdr.

    Default is null.

    @@ -217,6 +232,10 @@

    ..lightMap : Texture

    The light map. Requires a second set of UVs.

    +

    lightMap represents pre-baked illuminance data, and the texture must be assigned +a Texture#colorSpace. Most lightMap textures set +texture.colorSpace = LinearSRGBColorSpace and use float-type formats +such as .exr or .hdr.

    Default is null.

    @@ -233,6 +252,9 @@

    .mapMaterial#transparent or Material#alphaTest. The texture map color is modulated by the diffuse color.

    +

    map represents color data, and the texture must be assigned a +Texture#colorSpace. Most map textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    @@ -245,6 +267,8 @@

    .normalMapy component of normalScale should be negated to compensate for the different handedness.

    +

    normalMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -284,6 +308,9 @@

    ..specularMap : Texture

    Specular map used by the material.

    +

    specularMap represents color data, and the texture must be assigned a +Texture#colorSpace. Most specularMap textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    diff --git a/docs/pages/MeshLambertMaterial.html.md b/docs/pages/MeshLambertMaterial.html.md index 2be0cd4680f03e..917f568fe3d1d7 100644 --- a/docs/pages/MeshLambertMaterial.html.md +++ b/docs/pages/MeshLambertMaterial.html.md @@ -26,12 +26,16 @@ The alpha map is a grayscale texture that controls the opacity across the surfac Only the color of the texture is used, ignoring the alpha channel if one exists. For RGB and RGBA textures, the renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected. +`alphaMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .aoMap : Texture The red channel of this texture is used as the ambient occlusion map. Requires a second set of UVs. +`aoMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .aoMapIntensity : number @@ -44,6 +48,8 @@ Default is `1`. The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights. Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored. +`bumpMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .bumpScale : number @@ -76,6 +82,8 @@ Default is `0`. The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows, block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh. For best results, pair a displacement map with a matching normal map, since the renderer can not recompute surface normals from the displaced vertices. +`displacementMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .displacementScale : number @@ -100,12 +108,16 @@ Default is `1`. Set emissive (glow) map. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black. +`emissiveMap` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `emissiveMap` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .envMap : Texture The environment map. +`envMap` represents luminance data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `envMap` textures set `texture.colorSpace = LinearSRGBColorSpace` and use float-type formats such as `.exr` or `.hdr`. + Default is `null`. ### .envMapIntensity : number @@ -142,6 +154,8 @@ Default is `true`. The light map. Requires a second set of UVs. +`lightMap` represents pre-baked illuminance data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `lightMap` textures set `texture.colorSpace = LinearSRGBColorSpace` and use float-type formats such as `.exr` or `.hdr`. + Default is `null`. ### .lightMapIntensity : number @@ -154,12 +168,16 @@ Default is `1`. The color map. May optionally include an alpha channel, typically combined with [Material#transparent](Material.html#transparent) or [Material#alphaTest](Material.html#alphaTest). The texture map color is modulated by the diffuse `color`. +`map` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `map` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .normalMap : Texture The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting. In case the material has a normal map authored using the left handed convention, the `y` component of `normalScale` should be negated to compensate for the different handedness. +`normalMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .normalMapType : TangentSpaceNormalMap | ObjectSpaceNormalMap @@ -190,6 +208,8 @@ Default is `0.98`. Specular map used by the material. +`specularMap` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `specularMap` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .wireframe : boolean diff --git a/docs/pages/MeshMatcapMaterial.html b/docs/pages/MeshMatcapMaterial.html index a264a443fce45b..5af57ef012197b 100644 --- a/docs/pages/MeshMatcapMaterial.html +++ b/docs/pages/MeshMatcapMaterial.html @@ -58,6 +58,8 @@

    .alphaMap< when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.

    +

    alphaMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -68,6 +70,8 @@

    .bumpMap +

    bumpMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -105,6 +109,8 @@

    . +

    displacementMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -144,6 +150,9 @@

    .mapMaterial#transparent or Material#alphaTest. The texture map color is modulated by the diffuse color.

    +

    map represents color data, and the texture must be assigned a +Texture#colorSpace. Most map textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    @@ -151,6 +160,11 @@

    .map.matcap : Texture

    The matcap map.

    +

    matcap represents luminance data, and the texture must be assigned +a Texture#colorSpace. HDR matcap textures (e.g. .exr) +typically set texture.colorSpace = LinearSRGBColorSpace, while LDR +matcap textures (e.g. .png, .jpg, .webp) typically set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    @@ -163,6 +177,8 @@

    .normalMapy component of normalScale should be negated to compensate for the different handedness.

    +

    normalMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    diff --git a/docs/pages/MeshMatcapMaterial.html.md b/docs/pages/MeshMatcapMaterial.html.md index 10e32e5c2d4a48..8447df2effa72d 100644 --- a/docs/pages/MeshMatcapMaterial.html.md +++ b/docs/pages/MeshMatcapMaterial.html.md @@ -24,12 +24,16 @@ The alpha map is a grayscale texture that controls the opacity across the surfac Only the color of the texture is used, ignoring the alpha channel if one exists. For RGB and RGBA textures, the renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected. +`alphaMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .bumpMap : Texture The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights. Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored. +`bumpMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .bumpScale : number @@ -54,6 +58,8 @@ Default is `0`. The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows, block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh. For best results, pair a displacement map with a matching normal map, since the renderer can not recompute surface normals from the displaced vertices. +`displacementMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .displacementScale : number @@ -84,18 +90,24 @@ Default is `true`. The color map. May optionally include an alpha channel, typically combined with [Material#transparent](Material.html#transparent) or [Material#alphaTest](Material.html#alphaTest). The texture map color is modulated by the diffuse `color`. +`map` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `map` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .matcap : Texture The matcap map. +`matcap` represents luminance data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). HDR `matcap` textures (e.g. `.exr`) typically set `texture.colorSpace = LinearSRGBColorSpace`, while LDR `matcap` textures (e.g. `.png`, `.jpg`, `.webp`) typically set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .normalMap : Texture The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting. In case the material has a normal map authored using the left handed convention, the `y` component of `normalScale` should be negated to compensate for the different handedness. +`normalMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .normalMapType : TangentSpaceNormalMap | ObjectSpaceNormalMap diff --git a/docs/pages/MeshNormalMaterial.html b/docs/pages/MeshNormalMaterial.html index e9bda8f6d0e867..239aee1648afc7 100644 --- a/docs/pages/MeshNormalMaterial.html +++ b/docs/pages/MeshNormalMaterial.html @@ -50,6 +50,8 @@

    .bumpMap +

    bumpMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -115,6 +117,8 @@

    .normalMapy component of normalScale should be negated to compensate for the different handedness.

    +

    normalMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    diff --git a/docs/pages/MeshNormalMaterial.html.md b/docs/pages/MeshNormalMaterial.html.md index 34a2d9fda7ce8e..a93a039851f123 100644 --- a/docs/pages/MeshNormalMaterial.html.md +++ b/docs/pages/MeshNormalMaterial.html.md @@ -20,6 +20,8 @@ An object with one or more properties defining the material's appearance. Any pr The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights. Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored. +`bumpMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .bumpScale : number @@ -62,6 +64,8 @@ Default is `true`. The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting. In case the material has a normal map authored using the left handed convention, the `y` component of `normalScale` should be negated to compensate for the different handedness. +`normalMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .normalMapType : TangentSpaceNormalMap | ObjectSpaceNormalMap diff --git a/docs/pages/MeshPhongMaterial.html b/docs/pages/MeshPhongMaterial.html index c93d985bf6842a..12326991c002e8 100644 --- a/docs/pages/MeshPhongMaterial.html +++ b/docs/pages/MeshPhongMaterial.html @@ -60,6 +60,8 @@

    .alphaMap< when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.

    +

    alphaMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -68,6 +70,8 @@

    .aoMap

    The red channel of this texture is used as the ambient occlusion map. Requires a second set of UVs.

    +

    aoMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -87,6 +91,8 @@

    .bumpMap +

    bumpMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -133,6 +139,8 @@

    . +

    displacementMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -166,6 +174,9 @@

    .emissiv

    Set emissive (glow) map. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.

    +

    emissiveMap represents color data, and the texture must be assigned a +Texture#colorSpace. Most emissiveMap textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    @@ -173,6 +184,10 @@

    .emissiv

    .envMap : Texture

    The environment map.

    +

    envMap represents luminance data, and the texture must be assigned +a Texture#colorSpace. Most envMap textures set +texture.colorSpace = LinearSRGBColorSpace and use float-type formats +such as .exr or .hdr.

    Default is null.

    @@ -215,6 +230,10 @@

    ..lightMap : Texture

    The light map. Requires a second set of UVs.

    +

    lightMap represents pre-baked illuminance data, and the texture must be assigned +a Texture#colorSpace. Most lightMap textures set +texture.colorSpace = LinearSRGBColorSpace and use float-type formats +such as .exr or .hdr.

    Default is null.

    @@ -231,6 +250,9 @@

    .mapMaterial#transparent or Material#alphaTest. The texture map color is modulated by the diffuse color.

    +

    map represents color data, and the texture must be assigned a +Texture#colorSpace. Most map textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    @@ -243,6 +265,8 @@

    .normalMapy component of normalScale should be negated to compensate for the different handedness.

    +

    normalMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -298,6 +322,9 @@

    .specula

    The specular map value affects both how much the specular surface highlight contributes and how much of the environment map affects the surface.

    +

    specularMap represents color data, and the texture must be assigned a +Texture#colorSpace. Most specularMap textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    diff --git a/docs/pages/MeshPhongMaterial.html.md b/docs/pages/MeshPhongMaterial.html.md index 5375085955dc34..0fb5f625dc8484 100644 --- a/docs/pages/MeshPhongMaterial.html.md +++ b/docs/pages/MeshPhongMaterial.html.md @@ -26,12 +26,16 @@ The alpha map is a grayscale texture that controls the opacity across the surfac Only the color of the texture is used, ignoring the alpha channel if one exists. For RGB and RGBA textures, the renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected. +`alphaMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .aoMap : Texture The red channel of this texture is used as the ambient occlusion map. Requires a second set of UVs. +`aoMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .aoMapIntensity : number @@ -44,6 +48,8 @@ Default is `1`. The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights. Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored. +`bumpMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .bumpScale : number @@ -76,6 +82,8 @@ Default is `0`. The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows, block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh. For best results, pair a displacement map with a matching normal map, since the renderer can not recompute surface normals from the displaced vertices. +`displacementMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .displacementScale : number @@ -100,12 +108,16 @@ Default is `1`. Set emissive (glow) map. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black. +`emissiveMap` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `emissiveMap` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .envMap : Texture The environment map. +`envMap` represents luminance data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `envMap` textures set `texture.colorSpace = LinearSRGBColorSpace` and use float-type formats such as `.exr` or `.hdr`. + Default is `null`. ### .envMapIntensity : number @@ -142,6 +154,8 @@ Default is `true`. The light map. Requires a second set of UVs. +`lightMap` represents pre-baked illuminance data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `lightMap` textures set `texture.colorSpace = LinearSRGBColorSpace` and use float-type formats such as `.exr` or `.hdr`. + Default is `null`. ### .lightMapIntensity : number @@ -154,12 +168,16 @@ Default is `1`. The color map. May optionally include an alpha channel, typically combined with [Material#transparent](Material.html#transparent) or [Material#alphaTest](Material.html#alphaTest). The texture map color is modulated by the diffuse `color`. +`map` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `map` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .normalMap : Texture The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting. In case the material has a normal map authored using the left handed convention, the `y` component of `normalScale` should be negated to compensate for the different handedness. +`normalMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .normalMapType : TangentSpaceNormalMap | ObjectSpaceNormalMap @@ -202,6 +220,8 @@ This defines how shiny the material is and the color of its shine. The specular map value affects both how much the specular surface highlight contributes and how much of the environment map affects the surface. +`specularMap` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `specularMap` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .wireframe : boolean diff --git a/docs/pages/MeshPhysicalMaterial.html b/docs/pages/MeshPhysicalMaterial.html index e43b92b06e0037..fe22ac042d81ed 100644 --- a/docs/pages/MeshPhysicalMaterial.html +++ b/docs/pages/MeshPhysicalMaterial.html @@ -76,6 +76,8 @@

    .ani

    Red and green channels represent the anisotropy direction in [-1, 1] tangent, bitangent space, to be rotated by anisotropyRotation. The blue channel contains strength as [0, 1] to be multiplied by anisotropy.

    +

    anisotropyMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -119,6 +121,8 @@

    .clear

    The red channel of this texture is multiplied against clearcoat, for per-pixel control over a coating's intensity.

    +

    clearcoatMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -126,6 +130,8 @@

    .clear

    .clearcoatNormalMap : Texture

    Can be used to enable independent normals for the clear coat layer.

    +

    clearcoatNormalMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -149,6 +155,8 @@

    .

    The green channel of this texture is multiplied against clearcoatRoughness, for per-pixel control over a coating's roughness.

    +

    clearcoatRoughnessMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -189,6 +197,8 @@

    .i

    The red channel of this texture is multiplied against iridescence, for per-pixel control over iridescence.

    +

    iridescenceMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -202,6 +212,8 @@

    ..she @@ -264,6 +279,8 @@

    .

    The alpha channel of this texture is multiplied against sheenRoughness, for per-pixel control over sheen roughness.

    +

    sheenRoughnessMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -279,6 +296,9 @@

    .

    The RGB channels of this texture are multiplied against specularColor, for per-pixel control over specular color.

    +

    specularColorMap represents color data, and the texture must be assigned a +Texture#colorSpace. Most specularColorMap textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    @@ -295,6 +315,8 @@

    .

    The alpha channel of this texture is multiplied against specularIntensity, for per-pixel control over specular intensity.

    +

    specularIntensityMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -312,6 +334,8 @@

    .thick

    A texture that defines the thickness, stored in the green channel. This will be multiplied by thickness.

    +

    thicknessMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -331,6 +355,8 @@

    .

    The red channel of this texture is multiplied against transmission, for per-pixel control over optical transparency.

    +

    transmissionMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    diff --git a/docs/pages/MeshPhysicalMaterial.html.md b/docs/pages/MeshPhysicalMaterial.html.md index 53c54f15df97f7..8766cb1871f194 100644 --- a/docs/pages/MeshPhysicalMaterial.html.md +++ b/docs/pages/MeshPhysicalMaterial.html.md @@ -35,6 +35,8 @@ Default is `0`. Red and green channels represent the anisotropy direction in `[-1, 1]` tangent, bitangent space, to be rotated by `anisotropyRotation`. The blue channel contains strength as `[0, 1]` to be multiplied by `anisotropy`. +`anisotropyMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .anisotropyRotation : number @@ -65,12 +67,16 @@ Default is `0`. The red channel of this texture is multiplied against `clearcoat`, for per-pixel control over a coating's intensity. +`clearcoatMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .clearcoatNormalMap : Texture Can be used to enable independent normals for the clear coat layer. +`clearcoatNormalMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .clearcoatNormalScale : Vector2 @@ -89,6 +95,8 @@ Default is `0`. The green channel of this texture is multiplied against `clearcoatRoughness`, for per-pixel control over a coating's roughness. +`clearcoatRoughnessMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .dispersion : number @@ -119,6 +127,8 @@ Default is `1.3`. The red channel of this texture is multiplied against `iridescence`, for per-pixel control over iridescence. +`iridescenceMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .iridescenceThicknessMap : Texture @@ -129,6 +139,8 @@ A texture that defines the thickness of the iridescence layer, stored in the gre * `1.0` in the green channel will result in thickness equal to second element of the array. * Values in-between will linearly interpolate between the elements of the array. +`iridescenceThicknessMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .iridescenceThicknessRange : Array. @@ -167,6 +179,8 @@ Default is `(0,0,0)`. The RGB channels of this texture are multiplied against `sheenColor`, for per-pixel control over sheen tint. +`sheenColorMap` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `sheenColorMap` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .sheenRoughness : number @@ -179,6 +193,8 @@ Default is `1`. The alpha channel of this texture is multiplied against `sheenRoughness`, for per-pixel control over sheen roughness. +`sheenRoughnessMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .specularColor : Color @@ -191,6 +207,8 @@ Default is `(1,1,1)`. The RGB channels of this texture are multiplied against `specularColor`, for per-pixel control over specular color. +`specularColorMap` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `specularColorMap` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .specularIntensity : number @@ -203,6 +221,8 @@ Default is `1`. The alpha channel of this texture is multiplied against `specularIntensity`, for per-pixel control over specular intensity. +`specularIntensityMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .thickness : number @@ -215,6 +235,8 @@ Default is `0`. A texture that defines the thickness, stored in the green channel. This will be multiplied by `thickness`. +`thicknessMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .transmission : number @@ -231,6 +253,8 @@ Default is `0`. The red channel of this texture is multiplied against `transmission`, for per-pixel control over optical transparency. +`transmissionMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ## Source diff --git a/docs/pages/MeshStandardMaterial.html b/docs/pages/MeshStandardMaterial.html index 55c6c79ca11fba..d871da13cd71f9 100644 --- a/docs/pages/MeshStandardMaterial.html +++ b/docs/pages/MeshStandardMaterial.html @@ -76,6 +76,8 @@

    .alphaMap< when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.

    +

    alphaMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -84,6 +86,8 @@

    .aoMap

    The red channel of this texture is used as the ambient occlusion map. Requires a second set of UVs.

    +

    aoMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -103,6 +107,8 @@

    .bumpMap +

    bumpMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -140,6 +146,8 @@

    . +

    displacementMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -173,6 +181,9 @@

    .emissiv

    Set emissive (glow) map. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.

    +

    emissiveMap represents color data, and the texture must be assigned a +Texture#colorSpace. Most emissiveMap textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    @@ -181,6 +192,10 @@

    .envMap

    The environment map. To ensure a physically correct rendering, environment maps are internally pre-processed with PMREMGenerator.

    +

    envMap represents luminance data, and the texture must be assigned +a Texture#colorSpace. Most envMap textures set +texture.colorSpace = LinearSRGBColorSpace and use float-type formats +such as .exr or .hdr.

    Default is null.

    @@ -223,6 +238,10 @@

    ..lightMap : Texture

    The light map. Requires a second set of UVs.

    +

    lightMap represents pre-baked illuminance data, and the texture must be assigned +a Texture#colorSpace. Most lightMap textures set +texture.colorSpace = LinearSRGBColorSpace and use float-type formats +such as .exr or .hdr.

    Default is null.

    @@ -239,6 +258,9 @@

    .mapMaterial#transparent or Material#alphaTest. The texture map color is modulated by the diffuse color.

    +

    map represents color data, and the texture must be assigned a +Texture#colorSpace. Most map textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    @@ -257,6 +279,8 @@

    .metal

    The blue channel of this texture is used to alter the metalness of the material.

    +

    metalnessMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -269,6 +293,8 @@

    .normalMapy component of normalScale should be negated to compensate for the different handedness.

    +

    normalMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -300,6 +326,8 @@

    .rough

    The green channel of this texture is used to alter the roughness of the material.

    +

    roughnessMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    diff --git a/docs/pages/MeshStandardMaterial.html.md b/docs/pages/MeshStandardMaterial.html.md index cce73058ea3a0b..59ee11c7d8d8ac 100644 --- a/docs/pages/MeshStandardMaterial.html.md +++ b/docs/pages/MeshStandardMaterial.html.md @@ -37,12 +37,16 @@ The alpha map is a grayscale texture that controls the opacity across the surfac Only the color of the texture is used, ignoring the alpha channel if one exists. For RGB and RGBA textures, the renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected. +`alphaMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .aoMap : Texture The red channel of this texture is used as the ambient occlusion map. Requires a second set of UVs. +`aoMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .aoMapIntensity : number @@ -55,6 +59,8 @@ Default is `1`. The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights. Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored. +`bumpMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .bumpScale : number @@ -79,6 +85,8 @@ Default is `0`. The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows, block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh. For best results, pair a displacement map with a matching normal map, since the renderer can not recompute surface normals from the displaced vertices. +`displacementMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .displacementScale : number @@ -103,12 +111,16 @@ Default is `1`. Set emissive (glow) map. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black. +`emissiveMap` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `emissiveMap` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .envMap : Texture The environment map. To ensure a physically correct rendering, environment maps are internally pre-processed with [PMREMGenerator](PMREMGenerator.html). +`envMap` represents luminance data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `envMap` textures set `texture.colorSpace = LinearSRGBColorSpace` and use float-type formats such as `.exr` or `.hdr`. + Default is `null`. ### .envMapIntensity : number @@ -145,6 +157,8 @@ Default is `true`. The light map. Requires a second set of UVs. +`lightMap` represents pre-baked illuminance data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `lightMap` textures set `texture.colorSpace = LinearSRGBColorSpace` and use float-type formats such as `.exr` or `.hdr`. + Default is `null`. ### .lightMapIntensity : number @@ -157,6 +171,8 @@ Default is `1`. The color map. May optionally include an alpha channel, typically combined with [Material#transparent](Material.html#transparent) or [Material#alphaTest](Material.html#alphaTest). The texture map color is modulated by the diffuse `color`. +`map` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `map` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .metalness : number @@ -169,12 +185,16 @@ Default is `0`. The blue channel of this texture is used to alter the metalness of the material. +`metalnessMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .normalMap : Texture The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting. In case the material has a normal map authored using the left handed convention, the `y` component of `normalScale` should be negated to compensate for the different handedness. +`normalMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .normalMapType : TangentSpaceNormalMap | ObjectSpaceNormalMap @@ -199,6 +219,8 @@ Default is `1`. The green channel of this texture is used to alter the roughness of the material. +`roughnessMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .wireframe : boolean diff --git a/docs/pages/MeshToonMaterial.html b/docs/pages/MeshToonMaterial.html index 958f8b13549b21..f9de86d70929ba 100644 --- a/docs/pages/MeshToonMaterial.html +++ b/docs/pages/MeshToonMaterial.html @@ -53,6 +53,8 @@

    .alphaMap< when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.

    +

    alphaMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -61,6 +63,8 @@

    .aoMap

    The red channel of this texture is used as the ambient occlusion map. Requires a second set of UVs.

    +

    aoMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -80,6 +84,8 @@

    .bumpMap +

    bumpMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -117,6 +123,8 @@

    . +

    displacementMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -150,6 +158,9 @@

    .emissiv

    Set emissive (glow) map. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.

    +

    emissiveMap represents color data, and the texture must be assigned a +Texture#colorSpace. Most emissiveMap textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    @@ -166,6 +177,8 @@

    .gradien

    Gradient map for toon shading. It's required to set Texture#minFilter and Texture#magFilter to NearestFilter when using this type of texture.

    +

    gradientMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -180,6 +193,10 @@

    ..lightMap : Texture

    The light map. Requires a second set of UVs.

    +

    lightMap represents pre-baked illuminance data, and the texture must be assigned +a Texture#colorSpace. Most lightMap textures set +texture.colorSpace = LinearSRGBColorSpace and use float-type formats +such as .exr or .hdr.

    Default is null.

    @@ -196,6 +213,9 @@

    .mapMaterial#transparent or Material#alphaTest. The texture map color is modulated by the diffuse color.

    +

    map represents color data, and the texture must be assigned a +Texture#colorSpace. Most map textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    @@ -208,6 +228,8 @@

    .normalMapy component of normalScale should be negated to compensate for the different handedness.

    +

    normalMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    diff --git a/docs/pages/MeshToonMaterial.html.md b/docs/pages/MeshToonMaterial.html.md index b657fc94edf1c4..0abb737c4012e7 100644 --- a/docs/pages/MeshToonMaterial.html.md +++ b/docs/pages/MeshToonMaterial.html.md @@ -22,12 +22,16 @@ The alpha map is a grayscale texture that controls the opacity across the surfac Only the color of the texture is used, ignoring the alpha channel if one exists. For RGB and RGBA textures, the renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected. +`alphaMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .aoMap : Texture The red channel of this texture is used as the ambient occlusion map. Requires a second set of UVs. +`aoMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .aoMapIntensity : number @@ -40,6 +44,8 @@ Default is `1`. The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights. Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored. +`bumpMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .bumpScale : number @@ -64,6 +70,8 @@ Default is `0`. The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows, block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh. For best results, pair a displacement map with a matching normal map, since the renderer can not recompute surface normals from the displaced vertices. +`displacementMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .displacementScale : number @@ -88,6 +96,8 @@ Default is `1`. Set emissive (glow) map. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black. +`emissiveMap` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `emissiveMap` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .fog : boolean @@ -100,6 +110,8 @@ Default is `true`. Gradient map for toon shading. It's required to set [Texture#minFilter](Texture.html#minFilter) and [Texture#magFilter](Texture.html#magFilter) to [NearestFilter](global.html#NearestFilter) when using this type of texture. +`gradientMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .isMeshToonMaterial : boolean (readonly) @@ -112,6 +124,8 @@ Default is `true`. The light map. Requires a second set of UVs. +`lightMap` represents pre-baked illuminance data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `lightMap` textures set `texture.colorSpace = LinearSRGBColorSpace` and use float-type formats such as `.exr` or `.hdr`. + Default is `null`. ### .lightMapIntensity : number @@ -124,12 +138,16 @@ Default is `1`. The color map. May optionally include an alpha channel, typically combined with [Material#transparent](Material.html#transparent) or [Material#alphaTest](Material.html#alphaTest). The texture map color is modulated by the diffuse `color`. +`map` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `map` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .normalMap : Texture The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting. In case the material has a normal map authored using the left handed convention, the `y` component of `normalScale` should be negated to compensate for the different handedness. +`normalMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .normalMapType : TangentSpaceNormalMap | ObjectSpaceNormalMap diff --git a/docs/pages/MorphNode.html b/docs/pages/MorphNode.html deleted file mode 100644 index b85a0289114eb7..00000000000000 --- a/docs/pages/MorphNode.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - MorphNode - Three.js Docs - - - - - - -

    EventDispatcherNode

    -

    MorphNode

    -
    -
    -

    This node implements the vertex transformation shader logic which is required -for morph target animation.

    -
    -
    -
    -

    Constructor

    -

    new MorphNode( mesh : Mesh )

    -
    -
    -

    Constructs a new morph node.

    -
    - - - - - - - -
    - mesh - -

    The mesh holding the morph targets.

    -
    -
    -
    -

    Properties

    -
    -

    .mesh : Mesh

    -
    -

    The mesh holding the morph targets.

    -
    -
    -
    -

    .morphBaseInfluence : UniformNode.<float>

    -
    -

    A uniform node which represents the morph base influence value.

    -
    -
    -
    -

    .updateType : string

    -
    -

    The update type overwritten since morph nodes are updated per object.

    -
    -
    -
    Overrides: Node#updateType
    -
    -
    -

    Methods

    -

    .setup( builder : NodeBuilder )

    -
    -
    -

    Setups the morph node by assigning the transformed vertex data to predefined node variables.

    -
    - - - - - - - -
    - builder - -

    The current node builder.

    -
    -
    -
    Overrides: Node#setup
    -
    -
    -

    .update( frame : NodeFrame )

    -
    -
    -

    Updates the state of the morphed mesh by updating the base influence.

    -
    - - - - - - - -
    - frame - -

    The current node frame.

    -
    -
    -
    Overrides: Node#update
    -
    -
    -

    Source

    -

    - src/nodes/accessors/MorphNode.js -

    -
    -
    - - - - \ No newline at end of file diff --git a/docs/pages/MorphNode.html.md b/docs/pages/MorphNode.html.md deleted file mode 100644 index 1dcf4a96b03059..00000000000000 --- a/docs/pages/MorphNode.html.md +++ /dev/null @@ -1,57 +0,0 @@ -*Inheritance: EventDispatcher → Node →* - -# MorphNode - -This node implements the vertex transformation shader logic which is required for morph target animation. - -## Constructor - -### new MorphNode( mesh : Mesh ) - -Constructs a new morph node. - -**mesh** - -The mesh holding the morph targets. - -## Properties - -### .mesh : Mesh - -The mesh holding the morph targets. - -### .morphBaseInfluence : UniformNode. - -A uniform node which represents the morph base influence value. - -### .updateType : string - -The update type overwritten since morph nodes are updated per object. - -**Overrides:** [Node#updateType](Node.html#updateType) - -## Methods - -### .setup( builder : NodeBuilder ) - -Setups the morph node by assigning the transformed vertex data to predefined node variables. - -**builder** - -The current node builder. - -**Overrides:** [Node#setup](Node.html#setup) - -### .update( frame : NodeFrame ) - -Updates the state of the morphed mesh by updating the base influence. - -**frame** - -The current node frame. - -**Overrides:** [Node#update](Node.html#update) - -## Source - -[src/nodes/accessors/MorphNode.js](https://github.com/mrdoob/three.js/blob/master/src/nodes/accessors/MorphNode.js) \ No newline at end of file diff --git a/docs/pages/Node.html b/docs/pages/Node.html index c307e337d203ce..f594a1ba803608 100644 --- a/docs/pages/Node.html +++ b/docs/pages/Node.html @@ -490,7 +490,8 @@

    .This method is used during the build process of a node and ensures equal nodes are not built multiple times but just once. For example if attribute( 'uv' ) is used multiple times by the user, the build -process makes sure to process just the first node.

    +process makes sure to process just the first node. It also handles +node overrides if an override context is set.

    diff --git a/docs/pages/Node.html.md b/docs/pages/Node.html.md index 1149414be066c2..be84a52e633c3c 100644 --- a/docs/pages/Node.html.md +++ b/docs/pages/Node.html.md @@ -286,7 +286,7 @@ Returns the child nodes as a JSON object. ### .getShared( builder : NodeBuilder ) : Node -This method is used during the build process of a node and ensures equal nodes are not built multiple times but just once. For example if `attribute( 'uv' )` is used multiple times by the user, the build process makes sure to process just the first node. +This method is used during the build process of a node and ensures equal nodes are not built multiple times but just once. For example if `attribute( 'uv' )` is used multiple times by the user, the build process makes sure to process just the first node. It also handles node overrides if an override context is set. **builder** diff --git a/docs/pages/NodeBuilder.html b/docs/pages/NodeBuilder.html index 330eea55f3dc65..bb666a14184fda 100644 --- a/docs/pages/NodeBuilder.html +++ b/docs/pages/NodeBuilder.html @@ -224,6 +224,13 @@

    .globalC

    Default is this.cache.

    +
    +

    .hardwareClipping : boolean

    +
    +

    Whether the built material uses hardware clipping or not.

    +

    Default is false.

    +
    +

    .hashNodes : Object.<number, Node>

    @@ -244,7 +251,7 @@

    .material<

    -

    .nodes : Array.<Node>

    +

    .nodes : Set.<Node>

    A list of all nodes the builder is processing for this 3D object.

    @@ -283,7 +290,7 @@

    .scene

    -

    .sequentialNodes : Array.<Node>

    +

    .sequentialNodes : Set.<Node>

    A list of all nodes the builder is processing in sequential order.

    This is used to determine the update order of nodes, which is important for @@ -2691,6 +2698,27 @@

    .Returns: Whether the given attribute name is defined in the geometry.

    +

    .hasWriteUsage( node : Node ) : boolean

    +
    +
    +

    Returns whether the given node has been written to in any shader stage.

    +
    +

    + + + + + + +
    + node + +

    The node to check.

    +
    +
    +
    Returns: Whether the node has been written to.
    +
    +

    .includes( node : Node ) : boolean

    +

    .isContextAssign() : boolean

    +
    +
    +

    Returns whether the builder is currently in an assignment context.

    +
    +
    +
    Returns: Whether the builder is in an assignment context.
    +
    +

    .isDeterministic( node : Node ) : boolean

    diff --git a/docs/pages/NodeBuilder.html.md b/docs/pages/NodeBuilder.html.md index ca765d3bc1ab3b..1c8b7c10d6c78d 100644 --- a/docs/pages/NodeBuilder.html.md +++ b/docs/pages/NodeBuilder.html.md @@ -138,6 +138,12 @@ Since the [NodeBuilder#cache](NodeBuilder.html#cache) might be temporarily overw Default is `this.cache`. +### .hardwareClipping : boolean + +Whether the built material uses hardware clipping or not. + +Default is `false`. + ### .hashNodes : Object. A dictionary that assigns each node to a unique hash. @@ -152,7 +158,7 @@ Default is `null`. The material of the 3D object. -### .nodes : Array. +### .nodes : Set. A list of all nodes the builder is processing for this 3D object. @@ -180,7 +186,7 @@ The scene the 3D object belongs to. Default is `null`. -### .sequentialNodes : Array. +### .sequentialNodes : Set. A list of all nodes the builder is processing in sequential order. @@ -1438,6 +1444,16 @@ The attribute name. **Returns:** Whether the given attribute name is defined in the geometry. +### .hasWriteUsage( node : Node ) : boolean + +Returns whether the given node has been written to in any shader stage. + +**node** + +The node to check. + +**Returns:** Whether the node has been written to. + ### .includes( node : Node ) : boolean Whether the given node is included in the internal array of nodes or not. @@ -1468,6 +1484,12 @@ The requested feature. **Returns:** Whether the requested feature is supported or not. +### .isContextAssign() : boolean + +Returns whether the builder is currently in an assignment context. + +**Returns:** Whether the builder is in an assignment context. + ### .isDeterministic( node : Node ) : boolean Returns whether a Node or its flow is deterministic, useful for use in `const`. diff --git a/docs/pages/NodeMaterial.html b/docs/pages/NodeMaterial.html index 5f6c546933aabd..1703c52797c539 100644 --- a/docs/pages/NodeMaterial.html +++ b/docs/pages/NodeMaterial.html @@ -169,15 +169,6 @@

    .geome

    Default is null.

    -
    -

    .hardwareClipping : boolean

    -
    -

    Whether this material uses hardware clipping or not. -This property is managed by the engine and should not be -modified by apps.

    -

    Default is false.

    -
    -

    .isNodeMaterial : boolean (readonly)

    @@ -334,10 +325,10 @@

    .build

    -

    .copy( source : NodeMaterial ) : NodeMaterial

    +

    .copy( source : Material ) : NodeMaterial

    -

    Copies the properties of the given node material to this instance.

    +

    Copies the common properties of the given material to this instance.

    @@ -409,6 +400,27 @@

    .setup

    +

    .setupAmbientOcclusion( builder : NodeBuilder ) : Node

    +
    +
    +

    Setups the ambient occlusion node from the material.

    +
    + + + + + + + +
    + builder + +

    The current node builder.

    +
    +
    +
    Returns: The ambient occlusion node.
    +
    +

    .setupClipping( builder : NodeBuilder ) : ClippingNode

    @@ -606,7 +618,7 @@

    .Returns: The lighting model.

    -

    .setupLights( builder : NodeBuilder ) : LightsNode

    +

    .setupMaterialLightings( builder : NodeBuilder ) : LightingNode.<Array>

    Setups the lights node based on the scene, environment and material.

    @@ -691,6 +703,22 @@

    .

    Setups the output node.

    +

    This method can be implemented by derived materials to extend the functionality +of the material's output or replace it altogether.

    +
    class ColoredShadowMaterial extends MeshPhongNodeMaterial {
    +  constructor( parameters ) {
    +    super( parameters );
    +    this._shadeColor = uniform( new Color( parameters.shadeColor ?? 0xff0000 ) );
    +  }
    +  setupOutput( builder, outputNode ) {
    +	   // Modify the native output of the MeshPhongNodeMaterial fragment shader
    +    const brightness = min( outputNode.r, 1.0 );
    +    const mixedColor = mix( this._shadeColor, diffuseColor.rgb, brightness );
    +	   // Return new output back into NodeMaterial flow
    +    return super.setupOutput( builder, vec4( mixedColor, outputNode.a ) );
    +  }
    +}
    +
    diff --git a/docs/pages/NodeMaterial.html.md b/docs/pages/NodeMaterial.html.md index 5d97cd673f9c1e..ba88ccca2e1757 100644 --- a/docs/pages/NodeMaterial.html.md +++ b/docs/pages/NodeMaterial.html.md @@ -132,12 +132,6 @@ The idea is to assign a `Fn` definition that holds the geometry modification log Default is `null`. -### .hardwareClipping : boolean - -Whether this material uses hardware clipping or not. This property is managed by the engine and should not be modified by apps. - -Default is `false`. - ### .isNodeMaterial : boolean (readonly) This flag can be used for type testing. @@ -258,9 +252,9 @@ Builds this material with the given node builder. The current node builder. -### .copy( source : NodeMaterial ) : NodeMaterial +### .copy( source : Material ) : NodeMaterial -Copies the properties of the given node material to this instance. +Copies the common properties of the given material to this instance. **source** @@ -294,6 +288,16 @@ Setups the vertex and fragment stage of this node material. The current node builder. +### .setupAmbientOcclusion( builder : NodeBuilder ) : Node + +Setups the ambient occlusion node from the material. + +**builder** + +The current node builder. + +**Returns:** The ambient occlusion node. + ### .setupClipping( builder : NodeBuilder ) : ClippingNode Setups the clipping node. @@ -386,7 +390,7 @@ The current node builder. **Returns:** The lighting model. -### .setupLights( builder : NodeBuilder ) : LightsNode +### .setupMaterialLightings( builder : NodeBuilder ) : LightingNode. Setups the lights node based on the scene, environment and material. @@ -432,6 +436,24 @@ Setups the outgoing light node variable Setups the output node. +This method can be implemented by derived materials to extend the functionality of the material's output or replace it altogether. + +```js +class ColoredShadowMaterial extends MeshPhongNodeMaterial { + constructor( parameters ) { + super( parameters ); + this._shadeColor = uniform( new Color( parameters.shadeColor ?? 0xff0000 ) ); + } + setupOutput( builder, outputNode ) { + // Modify the native output of the MeshPhongNodeMaterial fragment shader + const brightness = min( outputNode.r, 1.0 ); + const mixedColor = mix( this._shadeColor, diffuseColor.rgb, brightness ); + // Return new output back into NodeMaterial flow + return super.setupOutput( builder, vec4( mixedColor, outputNode.a ) ); + } +} +``` + **builder** The current node builder. diff --git a/docs/pages/NodeMaterialObserver.html b/docs/pages/NodeMaterialObserver.html index 561c6aeae7086f..73ae05a142ca2a 100644 --- a/docs/pages/NodeMaterialObserver.html +++ b/docs/pages/NodeMaterialObserver.html @@ -128,7 +128,7 @@

    .equal

    -
    Returns: Whether the given render object has changed its state or not.
    +
    Returns: Whether the given render object is equal to its cached state or not.

    .firstInitialization( renderObject : RenderObject ) : boolean

    diff --git a/docs/pages/NodeMaterialObserver.html.md b/docs/pages/NodeMaterialObserver.html.md index 0f5f29b54aee09..d68f3101d2f806 100644 --- a/docs/pages/NodeMaterialObserver.html.md +++ b/docs/pages/NodeMaterialObserver.html.md @@ -64,7 +64,7 @@ The current material lights. The current render ID. -**Returns:** Whether the given render object has changed its state or not. +**Returns:** Whether the given render object is equal to its cached state or not. ### .firstInitialization( renderObject : RenderObject ) : boolean diff --git a/docs/pages/Object3D.html b/docs/pages/Object3D.html index 06ab8fad204826..12e805763305e6 100644 --- a/docs/pages/Object3D.html +++ b/docs/pages/Object3D.html @@ -1426,7 +1426,7 @@

    ..updateWorldMatrix( updateParents : boolean, updateChildren : boolean )

    +

    .updateWorldMatrix( updateParents : boolean, updateChildren : boolean, force : boolean )

    An alternative version of Object3D#updateMatrixWorld with more control over the @@ -1452,6 +1452,16 @@

    . + force + + +

    When set to true, a recomputation of world matrices is forced even +when Object3D#matrixWorldNeedsUpdate is false.

    +

    Default is false.

    + +

    diff --git a/docs/pages/Object3D.html.md b/docs/pages/Object3D.html.md index 5cc83f57afc076..7e2ef08790d18a 100644 --- a/docs/pages/Object3D.html.md +++ b/docs/pages/Object3D.html.md @@ -765,7 +765,7 @@ When set to `true`, a recomputation of world matrices is forced even when [Objec Default is `false`. -### .updateWorldMatrix( updateParents : boolean, updateChildren : boolean ) +### .updateWorldMatrix( updateParents : boolean, updateChildren : boolean, force : boolean ) An alternative version of [Object3D#updateMatrixWorld](Object3D.html#updateMatrixWorld) with more control over the update of ancestor and descendant nodes. @@ -781,6 +781,12 @@ Whether descendant nodes should be updated or not. Default is `false`. +**force** + +When set to `true`, a recomputation of world matrices is forced even when [Object3D#matrixWorldNeedsUpdate](Object3D.html#matrixWorldNeedsUpdate) is `false`. + +Default is `false`. + ### .worldToLocal( vector : Vector3 ) : Vector3 Converts the given vector from this 3D object's world space to local space. diff --git a/docs/pages/OverrideContextNode.html b/docs/pages/OverrideContextNode.html new file mode 100644 index 00000000000000..b3a0828c2238c3 --- /dev/null +++ b/docs/pages/OverrideContextNode.html @@ -0,0 +1,95 @@ + + + + + OverrideContextNode - Three.js Docs + + + + + + +

    EventDispatcherNodeContextNode

    +

    OverrideContextNode

    +
    +
    +

    A specialized context node designed to override specific target nodes within a +node sub-graph or flow. This allows replacing specific inputs (e.g., normal +and position vectors) dynamically during compilation for a specific flow node, +without having to reconstruct or duplicate the source nodes.

    +

    Code Example

    +
    // Method chaining example:
    +node.overrideNode( positionLocal, () => positionLocal.add( vec3( 1, 0, 0 ) ) );
    +// Context assignment example:
    +material.contextNode = overrideNode( positionLocal, () => positionLocal.add( vec3( 1, 0, 0 ) ) );
    +
    +
    +
    +
    +

    Constructor

    +

    new OverrideContextNode( overrideNodes : Map.<Node, function()>, flowNode : Node | null )

    +
    +
    +

    Constructs a new override context node.

    +
    + + + + + + + + + + + +
    + overrideNodes + +

    A map mapping target nodes to their respective override callback functions.

    +
    + flowNode + +

    The node whose context should be modified.

    +

    Default is null.

    +
    +
    +
    +

    Properties

    +
    +

    .isOverrideContextNode : boolean (readonly)

    +
    +

    This flag can be used for type testing.

    +

    Default is true.

    +
    +
    +
    +

    .type : string (readonly)

    +
    +

    Returns the type of the node.

    +
    +
    +

    Methods

    +

    .getFlowContextData() : Object

    +
    +
    +

    Gathers the context data from all parent context nodes by traversing the hierarchy, +merging the overrideNodes maps from all encountered OverrideContextNode instances.

    +
    +
    +
    Overrides: ContextNode#getFlowContextData
    +
    +
    +
    Returns: The gathered context data, containing the merged overrideNodes map.
    +
    +
    +

    Source

    +

    + src/nodes/core/OverrideContextNode.js +

    +
    +
    + + + + \ No newline at end of file diff --git a/docs/pages/OverrideContextNode.html.md b/docs/pages/OverrideContextNode.html.md new file mode 100644 index 00000000000000..12fa08bed9d9e9 --- /dev/null +++ b/docs/pages/OverrideContextNode.html.md @@ -0,0 +1,56 @@ +*Inheritance: EventDispatcher → Node → ContextNode →* + +# OverrideContextNode + +A specialized context node designed to override specific target nodes within a node sub-graph or flow. This allows replacing specific inputs (e.g., normal and position vectors) dynamically during compilation for a specific flow node, without having to reconstruct or duplicate the source nodes. + +## Code Example + +```js +// Method chaining example: +node.overrideNode( positionLocal, () => positionLocal.add( vec3( 1, 0, 0 ) ) ); +// Context assignment example: +material.contextNode = overrideNode( positionLocal, () => positionLocal.add( vec3( 1, 0, 0 ) ) ); +``` + +## Constructor + +### new OverrideContextNode( overrideNodes : Map., flowNode : Node | null ) + +Constructs a new override context node. + +**overrideNodes** + +A map mapping target nodes to their respective override callback functions. + +**flowNode** + +The node whose context should be modified. + +Default is `null`. + +## Properties + +### .isOverrideContextNode : boolean (readonly) + +This flag can be used for type testing. + +Default is `true`. + +### .type : string (readonly) + +Returns the type of the node. + +## Methods + +### .getFlowContextData() : Object + +Gathers the context data from all parent context nodes by traversing the hierarchy, merging the `overrideNodes` maps from all encountered `OverrideContextNode` instances. + +**Overrides:** [ContextNode#getFlowContextData](ContextNode.html#getFlowContextData) + +**Returns:** The gathered context data, containing the merged `overrideNodes` map. + +## Source + +[src/nodes/core/OverrideContextNode.js](https://github.com/mrdoob/three.js/blob/master/src/nodes/core/OverrideContextNode.js) \ No newline at end of file diff --git a/docs/pages/PLYExporter.html b/docs/pages/PLYExporter.html index e9926c9df90b1b..7ba338ebf59e1d 100644 --- a/docs/pages/PLYExporter.html +++ b/docs/pages/PLYExporter.html @@ -131,6 +131,19 @@

    .Options <

    Default is false.

    + + + customPropertyMapping +
    +Object.<string, Array.<string>> + + +

    A mapping that allows +exporting custom buffer attributes as PLY vertex properties. Each entry maps a buffer attribute +name to an array of PLY property names. The number of property names must match the item size +of the buffer attribute. This is the inverse of PLYLoader.setCustomPropertyNameMapping().

    + +

    diff --git a/docs/pages/PLYExporter.html.md b/docs/pages/PLYExporter.html.md index a8ea7379a088cd..eb7d79a0cbb97e 100644 --- a/docs/pages/PLYExporter.html.md +++ b/docs/pages/PLYExporter.html.md @@ -78,6 +78,11 @@ Whether the binary export uses little or big endian. Default is `false`. +**customPropertyMapping** +Object.> + +A mapping that allows exporting custom buffer attributes as PLY vertex properties. Each entry maps a buffer attribute name to an array of PLY property names. The number of property names must match the item size of the buffer attribute. This is the inverse of `PLYLoader.setCustomPropertyNameMapping()`. + ## Source [examples/jsm/exporters/PLYExporter.js](https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/PLYExporter.js) \ No newline at end of file diff --git a/docs/pages/PassNode.html b/docs/pages/PassNode.html index a4da033fd68e0f..e91e4f70aaf533 100644 --- a/docs/pages/PassNode.html +++ b/docs/pages/PassNode.html @@ -411,24 +411,6 @@

    .setMR
    Returns: A reference to this pass.

    -

    .setPixelRatio( pixelRatio : number )

    -
    -
    -

    Sets the pixel ratio the pass's render target and updates the size.

    -
    - - - - - - - -
    - pixelRatio - -

    The pixel ratio to set.

    -
    -

    .setResolution( resolution : number ) : PassNode

    diff --git a/docs/pages/PassNode.html.md b/docs/pages/PassNode.html.md index ce002c79b301ee..0f8e373f41cb68 100644 --- a/docs/pages/PassNode.html.md +++ b/docs/pages/PassNode.html.md @@ -240,14 +240,6 @@ The MRT object. **Returns:** A reference to this pass. -### .setPixelRatio( pixelRatio : number ) - -Sets the pixel ratio the pass's render target and updates the size. - -**pixelRatio** - -The pixel ratio to set. - ### .setResolution( resolution : number ) : PassNode Sets the resolution for the pass. The resolution is a factor that is multiplied with the renderer's width and height. diff --git a/docs/pages/PointsMaterial.html b/docs/pages/PointsMaterial.html index fb93d250cb4ecc..8dd3f54e1bf457 100644 --- a/docs/pages/PointsMaterial.html +++ b/docs/pages/PointsMaterial.html @@ -67,6 +67,8 @@

    .alphaMap< when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.

    +

    alphaMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

    Default is null.

    @@ -97,6 +99,9 @@

    .mapMaterial#transparent or Material#alphaTest. The texture map color is modulated by the diffuse color.

    +

    map represents color data, and the texture must be assigned a +Texture#colorSpace. Most map textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    diff --git a/docs/pages/PointsMaterial.html.md b/docs/pages/PointsMaterial.html.md index 55106792ba300b..4a47aa750a4f3b 100644 --- a/docs/pages/PointsMaterial.html.md +++ b/docs/pages/PointsMaterial.html.md @@ -41,6 +41,8 @@ The alpha map is a grayscale texture that controls the opacity across the surfac Only the color of the texture is used, ignoring the alpha channel if one exists. For RGB and RGBA textures, the renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected. +`alphaMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .color : Color @@ -65,6 +67,8 @@ Default is `true`. The color map. May optionally include an alpha channel, typically combined with [Material#transparent](Material.html#transparent) or [Material#alphaTest](Material.html#alphaTest). The texture map color is modulated by the diffuse `color`. +`map` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `map` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .size : number diff --git a/docs/pages/PropertyNode.html b/docs/pages/PropertyNode.html index 48ce2fa2422604..6bbb1e7be6673e 100644 --- a/docs/pages/PropertyNode.html +++ b/docs/pages/PropertyNode.html @@ -24,7 +24,7 @@

    Code Example

    Constructor

    -

    new PropertyNode( nodeType : string, name : string, varying : boolean )

    +

    new PropertyNode( nodeType : string, name : string, varying : boolean, placeholderNode : Node )

    +
    +

    .placeholderNode : Node

    +
    +

    The placeholder node of the property if it is not assigned.

    +

    Default is null.

    +
    +

    .varying : boolean

    diff --git a/docs/pages/PropertyNode.html.md b/docs/pages/PropertyNode.html.md index 86e5257de9a8db..b55b5b1f04ff25 100644 --- a/docs/pages/PropertyNode.html.md +++ b/docs/pages/PropertyNode.html.md @@ -14,7 +14,7 @@ const threshold = property( 'float', 'threshold' ).assign( THRESHOLD ); ## Constructor -### new PropertyNode( nodeType : string, name : string, varying : boolean ) +### new PropertyNode( nodeType : string, name : string, varying : boolean, placeholderNode : Node ) Constructs a new property node. @@ -34,6 +34,12 @@ Whether this property is a varying or not. Default is `false`. +**placeholderNode** + +The placeholder node if not assigned. + +Default is `null`. + ## Properties ### .global : boolean @@ -58,6 +64,12 @@ Default is `null`. **Overrides:** [Node#name](Node.html#name) +### .placeholderNode : Node + +The placeholder node of the property if it is not assigned. + +Default is `null`. + ### .varying : boolean Whether this property is a varying or not. diff --git a/docs/pages/RTTNode.html b/docs/pages/RTTNode.html index e8b95cc6ccf788..b5cb55f01e2dbf 100644 --- a/docs/pages/RTTNode.html +++ b/docs/pages/RTTNode.html @@ -102,13 +102,6 @@

    .node -

    .pixelRatio : number

    -
    -

    The pixel ratio

    -

    Default is 1.

    -
    -

    .renderTarget : RenderTarget

    @@ -142,23 +135,36 @@

    .width

    Methods

    -

    .setPixelRatio( pixelRatio : number )

    +

    .getResolutionScale() : number

    +
    +
    +

    Gets the resolution scale.

    +
    +
    +
    Returns: The resolution scale.
    +
    +
    +

    .setResolutionScale( resolutionScale : number ) : RTTNode

    -

    Sets the pixel ratio. This will also resize the render target.

    +

    Sets the resolution scale. +The resolution scale is a factor that is multiplied with the renderer's width and height.

    - pixelRatio + resolutionScale -

    The pixel ratio to set.

    +

    The resolution scale to set. A value of 1 means full resolution.

    +
    +
    Returns: A reference to this node.
    +

    .setSize( width : number, height : number )

    diff --git a/docs/pages/RTTNode.html.md b/docs/pages/RTTNode.html.md index f7a21451625b95..c25d9945e5cc2e 100644 --- a/docs/pages/RTTNode.html.md +++ b/docs/pages/RTTNode.html.md @@ -62,12 +62,6 @@ Default is `true`. The node to render a texture with. -### .pixelRatio : number - -The pixel ratio - -Default is `1`. - ### .renderTarget : RenderTarget The render target @@ -94,13 +88,21 @@ Default is `null`. ## Methods -### .setPixelRatio( pixelRatio : number ) +### .getResolutionScale() : number + +Gets the resolution scale. + +**Returns:** The resolution scale. + +### .setResolutionScale( resolutionScale : number ) : RTTNode + +Sets the resolution scale. The resolution scale is a factor that is multiplied with the renderer's width and height. -Sets the pixel ratio. This will also resize the render target. +**resolutionScale** -**pixelRatio** +The resolution scale to set. A value of `1` means full resolution. -The pixel ratio to set. +**Returns:** A reference to this node. ### .setSize( width : number, height : number ) diff --git a/docs/pages/Rhino3dmLoader.html b/docs/pages/Rhino3dmLoader.html index 0b02c478c2b023..68a81e57f70c72 100644 --- a/docs/pages/Rhino3dmLoader.html +++ b/docs/pages/Rhino3dmLoader.html @@ -21,7 +21,7 @@

    Rhino3dmLoader

    rhino3dm.js 8.4.0.

    Code Example

    const loader = new Rhino3dmLoader();
    -loader.setLibraryPath( 'https://cdn.jsdelivr.net/npm/rhino3dm@8.0.1' );
    +loader.setLibraryPath( 'https://cdn.jsdelivr.net/npm/rhino3dm@8.17.0/' );
     const object = await loader.loadAsync( 'models/3dm/Rhino_Logo.3dm' );
     scene.add( object );
     
    diff --git a/docs/pages/Rhino3dmLoader.html.md b/docs/pages/Rhino3dmLoader.html.md index 15b2ced30dbc64..5426a880caabeb 100644 --- a/docs/pages/Rhino3dmLoader.html.md +++ b/docs/pages/Rhino3dmLoader.html.md @@ -10,7 +10,7 @@ Rhinoceros is a 3D modeler used to create, edit, analyze, document, render, anim ```js const loader = new Rhino3dmLoader(); -loader.setLibraryPath( 'https://cdn.jsdelivr.net/npm/rhino3dm@8.0.1' ); +loader.setLibraryPath( 'https://cdn.jsdelivr.net/npm/rhino3dm@8.17.0/' ); const object = await loader.loadAsync( 'models/3dm/Rhino_Logo.3dm' ); scene.add( object ); ``` diff --git a/docs/pages/SSGINode.html b/docs/pages/SSGINode.html index 6584676d0858d9..4e3e84dea20a06 100644 --- a/docs/pages/SSGINode.html +++ b/docs/pages/SSGINode.html @@ -192,7 +192,7 @@

    ..useScreenSpaceSampling : UniformNode.<bool>

    Makes the sample distance in screen space instead of world-space (helps having more detail up close).

    -

    Default is false.

    +

    Default is true.

    @@ -218,13 +218,22 @@

    .dis
    Overrides: TempNode#dispose

    -

    .getTextureNode() : PassTextureNode

    +

    .getAONode() : PassTextureNode

    +
    +
    +

    Returns the AO result of the effect as a texture node.

    +
    +
    +
    Returns: A texture node that represents the AO result of the effect.
    +
    +
    +

    .getGINode() : PassTextureNode

    -

    Returns the result of the effect as a texture node.

    +

    Returns the GI result of the effect as a texture node.

    -
    Returns: A texture node that represents the result of the effect.
    +
    Returns: A texture node that represents the GI result of the effect.

    .setSize( width : number, height : number )

    diff --git a/docs/pages/SSGINode.html.md b/docs/pages/SSGINode.html.md index f1aa6d4d43c440..c1e4332da2855b 100644 --- a/docs/pages/SSGINode.html.md +++ b/docs/pages/SSGINode.html.md @@ -136,7 +136,7 @@ Default is `false`. Makes the sample distance in screen space instead of world-space (helps having more detail up close). -Default is `false`. +Default is `true`. ### .useTemporalFiltering : boolean @@ -154,11 +154,17 @@ Frees internal resources. This method should be called when the effect is no lon **Overrides:** [TempNode#dispose](TempNode.html#dispose) -### .getTextureNode() : PassTextureNode +### .getAONode() : PassTextureNode + +Returns the AO result of the effect as a texture node. + +**Returns:** A texture node that represents the AO result of the effect. + +### .getGINode() : PassTextureNode -Returns the result of the effect as a texture node. +Returns the GI result of the effect as a texture node. -**Returns:** A texture node that represents the result of the effect. +**Returns:** A texture node that represents the GI result of the effect. ### .setSize( width : number, height : number ) diff --git a/docs/pages/SSSNode.html b/docs/pages/SSSNode.html index 6cee2485624a64..7b907cb52355f8 100644 --- a/docs/pages/SSSNode.html +++ b/docs/pages/SSSNode.html @@ -25,7 +25,7 @@

    SSSNode

    • Ideally the maximum shadow length should not exceed 1 meter. Otherwise the effect gets computationally very expensive since more samples during the ray marching process are evaluated. -You can mitigate this issue by reducing the quality paramter.
    • +You can mitigate this issue by reducing the quality parameter.
    • The effect can only be used with a single directional light, the main light of your scene. This main light usually represents the sun or daylight.
    • Like other Screen-Space techniques SSS can only honor objects in the shadowing computation that @@ -148,7 +148,7 @@

      ..useTemporalFiltering : boolean

      Whether to use temporal filtering or not. Setting this property to -true requires the usage of TRAANode. This will help to reduce noice +true requires the usage of TRAANode. This will help to reduce noise although it introduces typical TAA artifacts like ghosting and temporal instabilities.

      Default is false.

      diff --git a/docs/pages/SSSNode.html.md b/docs/pages/SSSNode.html.md index 243b22f78fb804..918054b1fd40c3 100644 --- a/docs/pages/SSSNode.html.md +++ b/docs/pages/SSSNode.html.md @@ -10,7 +10,7 @@ The shadows produced by this implementation might have too hard edges for certai Limitations: -* Ideally the maximum shadow length should not exceed `1` meter. Otherwise the effect gets computationally very expensive since more samples during the ray marching process are evaluated. You can mitigate this issue by reducing the `quality` paramter. +* Ideally the maximum shadow length should not exceed `1` meter. Otherwise the effect gets computationally very expensive since more samples during the ray marching process are evaluated. You can mitigate this issue by reducing the `quality` parameter. * The effect can only be used with a single directional light, the main light of your scene. This main light usually represents the sun or daylight. * Like other Screen-Space techniques SSS can only honor objects in the shadowing computation that are currently visible within the camera's view. @@ -100,7 +100,7 @@ Default is `'frame'`. ### .useTemporalFiltering : boolean -Whether to use temporal filtering or not. Setting this property to `true` requires the usage of `TRAANode`. This will help to reduce noice although it introduces typical TAA artifacts like ghosting and temporal instabilities. +Whether to use temporal filtering or not. Setting this property to `true` requires the usage of `TRAANode`. This will help to reduce noise although it introduces typical TAA artifacts like ghosting and temporal instabilities. Default is `false`. diff --git a/docs/pages/ShaderMaterial.html b/docs/pages/ShaderMaterial.html index 56d1e4999849e0..5157efc37d07a1 100644 --- a/docs/pages/ShaderMaterial.html +++ b/docs/pages/ShaderMaterial.html @@ -249,6 +249,39 @@

      .Methods

      +

      .fromJSON( json : Object, textures : Object.<string, Texture> ) : ShaderMaterial

      +
      +
      +

      Deserializes the material from the given JSON.

      +
      + + + + + + + + + + + +
      + json + +

      The JSON holding the serialized material.

      +
      + textures + +

      A dictionary holding textures referenced by the material.

      +
      +
      +
      Overrides: Material#fromJSON
      +
      +
      +
      Returns: A reference to this material.
      +
      +

      Type Definitions

      .Shader

      diff --git a/docs/pages/ShaderMaterial.html.md b/docs/pages/ShaderMaterial.html.md index 24efb18d49aa3c..f5a1a8b9570f41 100644 --- a/docs/pages/ShaderMaterial.html.md +++ b/docs/pages/ShaderMaterial.html.md @@ -187,6 +187,24 @@ WebGL and WebGPU ignore this property and always render 1 pixel wide lines. Default is `1`. +## Methods + +### .fromJSON( json : Object, textures : Object. ) : ShaderMaterial + +Deserializes the material from the given JSON. + +**json** + +The JSON holding the serialized material. + +**textures** + +A dictionary holding textures referenced by the material. + +**Overrides:** [Material#fromJSON](Material.html#fromJSON) + +**Returns:** A reference to this material. + ## Type Definitions ### .Shader diff --git a/docs/pages/SidewalkGenerator.html b/docs/pages/SidewalkGenerator.html new file mode 100644 index 00000000000000..0db6ad224b3441 --- /dev/null +++ b/docs/pages/SidewalkGenerator.html @@ -0,0 +1,43 @@ + + + + + SidewalkGenerator - Three.js Docs + + + + + + +

      SidewalkGenerator

      +
      +
      +

      Generates the raised sidewalk for a city's blocks: per block, a rounded-corner concrete +slab rimmed by a distinct granite kerbstone that stands proud of the walking surface and +drops to the road. Instanced across a list of placements and dressed with its own +procedural material ( poured concrete flags, scored expansion joints, granite curb ). +Returns a THREE.Group of two instanced meshes — the walking slab and the curb.

      +

      Unlike the building generator, this one owns its materials: the slab and curb +geometry and the TSL that shades them live together here.

      +

      Code Example

      +
      const sidewalk = new SidewalkGenerator( { width: 90, depth: 60, height: 0.5 } );
      +scene.add( sidewalk.build( placements ) ); // placements: Matrix4[]
      +
      +
      + +
      + + + + \ No newline at end of file diff --git a/docs/pages/SidewalkGenerator.html.md b/docs/pages/SidewalkGenerator.html.md new file mode 100644 index 00000000000000..fd0eb91296fa9e --- /dev/null +++ b/docs/pages/SidewalkGenerator.html.md @@ -0,0 +1,20 @@ +# SidewalkGenerator + +Generates the raised sidewalk for a city's blocks: per block, a rounded-corner concrete slab rimmed by a distinct granite kerbstone that stands proud of the walking surface and drops to the road. Instanced across a list of placements and dressed with its own procedural material ( poured concrete flags, scored expansion joints, granite curb ). Returns a `THREE.Group` of two instanced meshes — the walking slab and the curb. + +Unlike the building generator, this one owns its materials: the slab and curb geometry and the TSL that shades them live together here. + +## Code Example + +```js +const sidewalk = new SidewalkGenerator( { width: 90, depth: 60, height: 0.5 } ); +scene.add( sidewalk.build( placements ) ); // placements: Matrix4[] +``` + +## Constructor + +### new SidewalkGenerator() + +## Source + +[examples/jsm/generators/city/SidewalkGenerator.js](https://github.com/mrdoob/three.js/blob/master/examples/jsm/generators/city/SidewalkGenerator.js) \ No newline at end of file diff --git a/docs/pages/Skeleton.html b/docs/pages/Skeleton.html index 9d8f8258c4f9f5..38f9ace8ca606b 100644 --- a/docs/pages/Skeleton.html +++ b/docs/pages/Skeleton.html @@ -88,14 +88,6 @@

      .bonesAn array of bones defining the skeleton.

      -
      -

      .previousBoneMatrices : Float32Array

      -
      -

      An array buffer holding the bone data of the previous frame. -Required for computing velocity. Maintained in SkinningNode.

      -

      Default is null.

      -
      -

      Methods

      .calculateInverses()

      diff --git a/docs/pages/Skeleton.html.md b/docs/pages/Skeleton.html.md index e973b2ee7a431b..52d0a3e6955c51 100644 --- a/docs/pages/Skeleton.html.md +++ b/docs/pages/Skeleton.html.md @@ -54,12 +54,6 @@ Default is `null`. An array of bones defining the skeleton. -### .previousBoneMatrices : Float32Array - -An array buffer holding the bone data of the previous frame. Required for computing velocity. Maintained in [SkinningNode](SkinningNode.html). - -Default is `null`. - ## Methods ### .calculateInverses() diff --git a/docs/pages/SkinningNode.html b/docs/pages/SkinningNode.html deleted file mode 100644 index 181bfea48af593..00000000000000 --- a/docs/pages/SkinningNode.html +++ /dev/null @@ -1,286 +0,0 @@ - - - - - SkinningNode - Three.js Docs - - - - - - -

      EventDispatcherNode

      -

      SkinningNode

      -
      -
      -

      This node implements the vertex transformation shader logic which is required -for skinning/skeletal animation.

      -
      -
      -
      -

      Constructor

      -

      new SkinningNode( skinnedMesh : SkinnedMesh )

      -
      -
      -

      Constructs a new skinning node.

      -
      - - - - - - - -
      - skinnedMesh - -

      The skinned mesh.

      -
      -
      -
      -

      Properties

      -
      -

      .bindMatrixInverseNode : Node.<mat4>

      -
      -

      The bind matrix inverse node.

      -
      -
      -
      -

      .bindMatrixNode : Node.<mat4>

      -
      -

      The bind matrix node.

      -
      -
      -
      -

      .boneMatricesNode : Node

      -
      -

      The bind matrices as a uniform buffer node.

      -
      -
      -
      -

      .positionNode : Node.<vec3>

      -
      -

      The current vertex position in local space.

      -
      -
      -
      -

      .previousBoneMatricesNode : Node

      -
      -

      The previous bind matrices as a uniform buffer node. -Required for computing motion vectors.

      -

      Default is null.

      -
      -
      -
      -

      .skinIndexNode : AttributeNode

      -
      -

      The skin index attribute.

      -
      -
      -
      -

      .skinWeightNode : AttributeNode

      -
      -

      The skin weight attribute.

      -
      -
      -
      -

      .skinnedMesh : SkinnedMesh

      -
      -

      The skinned mesh.

      -
      -
      -
      -

      .toPositionNode : Node.<vec3>

      -
      -

      The result of vertex position in local space.

      -
      -
      -
      -

      .updateType : string

      -
      -

      The update type overwritten since skinning nodes are updated per object.

      -
      -
      -
      Overrides: Node#updateType
      -
      -
      -

      Methods

      -

      .generate( builder : NodeBuilder, output : string ) : string

      -
      -
      -

      Generates the code snippet of the skinning node.

      -
      - - - - - - - - - - - -
      - builder - -

      The current node builder.

      -
      - output - -

      The current output.

      -
      -
      -
      Overrides: Node#generate
      -
      -
      -
      Returns: The generated code snippet.
      -
      -
      -

      .getPreviousSkinnedPosition( builder : NodeBuilder ) : Node.<vec3>

      -
      -
      -

      Computes the transformed/skinned vertex position of the previous frame.

      -
      - - - - - - - -
      - builder - -

      The current node builder.

      -
      -
      -
      Returns: The skinned position from the previous frame.
      -
      -
      -

      .getSkinnedNormalAndTangent( boneMatrices : Node, normal : Node.<vec3>, tangent : Node.<vec3> ) : Object

      -
      -
      -

      Transforms the given vertex normal and tangent via skinning.

      -
      - - - - - - - - - - - - - - - -
      - boneMatrices - -

      The bone matrices

      -

      Default is this.boneMatricesNode.

      -
      - normal - -

      The vertex normal in local space.

      -

      Default is normalLocal.

      -
      - tangent - -

      The vertex tangent in local space.

      -

      Default is tangentLocal.

      -
      -
      -
      Returns: The transformed vertex normal and tangent.
      -
      -
      -

      .getSkinnedPosition( boneMatrices : Node, position : Node.<vec3> ) : Node.<vec3>

      -
      -
      -

      Transforms the given vertex position via skinning.

      -
      - - - - - - - - - - - -
      - boneMatrices - -

      The bone matrices

      -

      Default is this.boneMatricesNode.

      -
      - position - -

      The vertex position in local space.

      -

      Default is this.positionNode.

      -
      -
      -
      Returns: The transformed vertex position.
      -
      -
      -

      .setup( builder : NodeBuilder ) : Node.<vec3>

      -
      -
      -

      Setups the skinning node by assigning the transformed vertex data to predefined node variables.

      -
      - - - - - - - -
      - builder - -

      The current node builder.

      -
      -
      -
      Overrides: Node#setup
      -
      -
      -
      Returns: The transformed vertex position.
      -
      -
      -

      .update( frame : NodeFrame )

      -
      -
      -

      Updates the state of the skinned mesh by updating the skeleton once per frame.

      -
      - - - - - - - -
      - frame - -

      The current node frame.

      -
      -
      -
      Overrides: Node#update
      -
      -
      -

      Source

      -

      - src/nodes/accessors/SkinningNode.js -

      -
      -
      - - - - \ No newline at end of file diff --git a/docs/pages/SkinningNode.html.md b/docs/pages/SkinningNode.html.md deleted file mode 100644 index f2696bf21c672c..00000000000000 --- a/docs/pages/SkinningNode.html.md +++ /dev/null @@ -1,157 +0,0 @@ -*Inheritance: EventDispatcher → Node →* - -# SkinningNode - -This node implements the vertex transformation shader logic which is required for skinning/skeletal animation. - -## Constructor - -### new SkinningNode( skinnedMesh : SkinnedMesh ) - -Constructs a new skinning node. - -**skinnedMesh** - -The skinned mesh. - -## Properties - -### .bindMatrixInverseNode : Node. - -The bind matrix inverse node. - -### .bindMatrixNode : Node. - -The bind matrix node. - -### .boneMatricesNode : Node - -The bind matrices as a uniform buffer node. - -### .positionNode : Node. - -The current vertex position in local space. - -### .previousBoneMatricesNode : Node - -The previous bind matrices as a uniform buffer node. Required for computing motion vectors. - -Default is `null`. - -### .skinIndexNode : AttributeNode - -The skin index attribute. - -### .skinWeightNode : AttributeNode - -The skin weight attribute. - -### .skinnedMesh : SkinnedMesh - -The skinned mesh. - -### .toPositionNode : Node. - -The result of vertex position in local space. - -### .updateType : string - -The update type overwritten since skinning nodes are updated per object. - -**Overrides:** [Node#updateType](Node.html#updateType) - -## Methods - -### .generate( builder : NodeBuilder, output : string ) : string - -Generates the code snippet of the skinning node. - -**builder** - -The current node builder. - -**output** - -The current output. - -**Overrides:** [Node#generate](Node.html#generate) - -**Returns:** The generated code snippet. - -### .getPreviousSkinnedPosition( builder : NodeBuilder ) : Node. - -Computes the transformed/skinned vertex position of the previous frame. - -**builder** - -The current node builder. - -**Returns:** The skinned position from the previous frame. - -### .getSkinnedNormalAndTangent( boneMatrices : Node, normal : Node., tangent : Node. ) : Object - -Transforms the given vertex normal and tangent via skinning. - -**boneMatrices** - -The bone matrices - -Default is `this.boneMatricesNode`. - -**normal** - -The vertex normal in local space. - -Default is `normalLocal`. - -**tangent** - -The vertex tangent in local space. - -Default is `tangentLocal`. - -**Returns:** The transformed vertex normal and tangent. - -### .getSkinnedPosition( boneMatrices : Node, position : Node. ) : Node. - -Transforms the given vertex position via skinning. - -**boneMatrices** - -The bone matrices - -Default is `this.boneMatricesNode`. - -**position** - -The vertex position in local space. - -Default is `this.positionNode`. - -**Returns:** The transformed vertex position. - -### .setup( builder : NodeBuilder ) : Node. - -Setups the skinning node by assigning the transformed vertex data to predefined node variables. - -**builder** - -The current node builder. - -**Overrides:** [Node#setup](Node.html#setup) - -**Returns:** The transformed vertex position. - -### .update( frame : NodeFrame ) - -Updates the state of the skinned mesh by updating the skeleton once per frame. - -**frame** - -The current node frame. - -**Overrides:** [Node#update](Node.html#update) - -## Source - -[src/nodes/accessors/SkinningNode.js](https://github.com/mrdoob/three.js/blob/master/src/nodes/accessors/SkinningNode.js) \ No newline at end of file diff --git a/docs/pages/SkyscraperGenerator.html b/docs/pages/SkyscraperGenerator.html new file mode 100644 index 00000000000000..40959fb38996af --- /dev/null +++ b/docs/pages/SkyscraperGenerator.html @@ -0,0 +1,47 @@ + + + + + SkyscraperGenerator - Three.js Docs + + + + + + +

      SkyscraperGenerator

      +
      +
      +

      Generates intricate, tripartite "Beaux-Arts / Neo-Gothic" terracotta +skyscrapers from a small set of parameters.

      +

      The mass is read as a footprint polygon (a rectangle with one chamfered +corner) split into vertical faces, each split into three tiers — a tall +arcaded base, a repeating shaft and an ornate crown — then into floors and +bays. A handful of authored pieces (a pier, a window, a cornice profile, a +gothic arch) are instanced across the whole tower, then baked — together with +the bespoke base arcade — into a single non-indexed BufferGeometry tagged with +a per-vertex partId (PartId) so one material can shade every zone.

      +

      The generator is material agnostic — it only produces geometry. Pass a single +material (e.g. a TSL node material that branches on partId) to dress it.

      +

      Code Example

      +
      const generator = new SkyscraperGenerator( { seed: 35, totalHeight: 140 }, material );
      +scene.add( generator.build() ); // a single Mesh
      +
      +
      + +
      + + + + \ No newline at end of file diff --git a/docs/pages/SkyscraperGenerator.html.md b/docs/pages/SkyscraperGenerator.html.md new file mode 100644 index 00000000000000..8247d9bb11dbaa --- /dev/null +++ b/docs/pages/SkyscraperGenerator.html.md @@ -0,0 +1,22 @@ +# SkyscraperGenerator + +Generates intricate, tripartite "Beaux-Arts / Neo-Gothic" terracotta skyscrapers from a small set of parameters. + +The mass is read as a footprint polygon (a rectangle with one chamfered corner) split into vertical faces, each split into three tiers — a tall arcaded base, a repeating shaft and an ornate crown — then into floors and bays. A handful of authored pieces (a pier, a window, a cornice profile, a gothic arch) are instanced across the whole tower, then baked — together with the bespoke base arcade — into a single non-indexed BufferGeometry tagged with a per-vertex `partId` (PartId) so one material can shade every zone. + +The generator is material agnostic — it only produces geometry. Pass a single material (e.g. a TSL node material that branches on `partId`) to dress it. + +## Code Example + +```js +const generator = new SkyscraperGenerator( { seed: 35, totalHeight: 140 }, material ); +scene.add( generator.build() ); // a single Mesh +``` + +## Constructor + +### new SkyscraperGenerator() + +## Source + +[examples/jsm/generators/city/SkyscraperGenerator.js](https://github.com/mrdoob/three.js/blob/master/examples/jsm/generators/city/SkyscraperGenerator.js) \ No newline at end of file diff --git a/docs/pages/SpriteMaterial.html b/docs/pages/SpriteMaterial.html index 6636fca6212954..29a856ad6c5038 100644 --- a/docs/pages/SpriteMaterial.html +++ b/docs/pages/SpriteMaterial.html @@ -59,6 +59,8 @@

      .alphaMap< when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.

      +

      alphaMap represents non-color data. Any texture assigned must have +texture.colorSpace = NoColorSpace (default).

      Default is null.

    @@ -89,6 +91,9 @@

    .mapMaterial#transparent or Material#alphaTest. The texture map color is modulated by the diffuse color.

    +

    map represents color data, and the texture must be assigned a +Texture#colorSpace. Most map textures set +texture.colorSpace = SRGBColorSpace.

    Default is null.

    diff --git a/docs/pages/SpriteMaterial.html.md b/docs/pages/SpriteMaterial.html.md index 3f8cbae842014c..4921c4f0d6b820 100644 --- a/docs/pages/SpriteMaterial.html.md +++ b/docs/pages/SpriteMaterial.html.md @@ -32,6 +32,8 @@ The alpha map is a grayscale texture that controls the opacity across the surfac Only the color of the texture is used, ignoring the alpha channel if one exists. For RGB and RGBA textures, the renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected. +`alphaMap` represents non-color data. Any texture assigned must have `texture.colorSpace = NoColorSpace` (default). + Default is `null`. ### .color : Color @@ -56,6 +58,8 @@ Default is `true`. The color map. May optionally include an alpha channel, typically combined with [Material#transparent](Material.html#transparent) or [Material#alphaTest](Material.html#alphaTest). The texture map color is modulated by the diffuse `color`. +`map` represents color data, and the texture must be assigned a [Texture#colorSpace](Texture.html#colorSpace). Most `map` textures set `texture.colorSpace = SRGBColorSpace`. + Default is `null`. ### .rotation : number diff --git a/docs/pages/StandardNodeLibrary.html b/docs/pages/StandardNodeLibrary.html new file mode 100644 index 00000000000000..eb7555baae3aa0 --- /dev/null +++ b/docs/pages/StandardNodeLibrary.html @@ -0,0 +1,39 @@ + + + + + StandardNodeLibrary - Three.js Docs + + + + + + +

    NodeLibrary

    +

    StandardNodeLibrary

    +
    +
    +

    This version of a node library represents the standard version +used in WebGPURenderer. It maps lights, tone mapping +techniques and materials to node-based implementations.

    +
    + +
    + + + + \ No newline at end of file diff --git a/docs/pages/StandardNodeLibrary.html.md b/docs/pages/StandardNodeLibrary.html.md new file mode 100644 index 00000000000000..9735742be2d7a9 --- /dev/null +++ b/docs/pages/StandardNodeLibrary.html.md @@ -0,0 +1,15 @@ +*Inheritance: NodeLibrary →* + +# StandardNodeLibrary + +This version of a node library represents the standard version used in [WebGPURenderer](WebGPURenderer.html). It maps lights, tone mapping techniques and materials to node-based implementations. + +## Constructor + +### new StandardNodeLibrary() + +Constructs a new standard node library. + +## Source + +[src/renderers/webgpu/nodes/StandardNodeLibrary.js](https://github.com/mrdoob/three.js/blob/master/src/renderers/webgpu/nodes/StandardNodeLibrary.js) \ No newline at end of file diff --git a/docs/pages/TSL.html b/docs/pages/TSL.html index 6a5347f2914ed6..063f96b5cd7002 100644 --- a/docs/pages/TSL.html +++ b/docs/pages/TSL.html @@ -62,12 +62,26 @@

    .TWO_PIRepresents PI * 2.

    +
    +

    .alphaLine : Node.<float> (constant)

    +
    +

    TSL fragment node that computes the shape/coverage (alpha) of the fat line segment. +Handles dash/gap generation, alpha-to-coverage rendering, and round endcaps.

    +
    +

    .alphaT : PropertyNode.<float> (constant)

    TSL object that represents the shader variable AlphaT.

    +
    +

    .ambientOcclusion : PropertyNode.<float> (constant)

    +
    +

    TSL object that represents the shader variable AmbientOcclusion. +If no value is assigned to this property, it defaults to a placeholder value of 1.0.

    +
    +

    .anisotropy : PropertyNode.<float> (constant)

    @@ -262,14 +276,6 @@

    . -

    .directionToFaceDirection (constant)

    -
    -

    Converts a direction vector to a face direction vector based on the material's side.

    -

    If the material is set to BackSide, the direction is inverted. -If the material is set to DoubleSide, the direction is multiplied by faceDirection.

    -
    -

    .dispersion : PropertyNode.<float> (constant)

    @@ -726,6 +732,13 @@

    . +

    .mvpLine : Node.<vec4> (constant)

    +
    +

    TSL node acting as a custom Model-View-Projection (MVP) for fat lines, +expanding 3D segments into screen/world-facing ribbons of a specified width.

    +
    +

    .normalFlat : Node.<vec3> (constant)

    @@ -824,7 +837,10 @@

    .

    .positionLocal : AttributeNode.<vec3> (constant)

    -

    TSL object that represents the vertex position in local space of the current rendered object.

    +

    TSL object that represents the transformed vertex position in local space of the current rendered object.

    +

    The term "transformed" indicates that an object or material's properties, such as skinning, batch, +instancing, or displacement mapping, will change the vertex position of the node when present. +To use the pre-transformed local space position of the object, use positionGeometry.

    @@ -1522,51 +1538,6 @@

    ..anamorphic( node : TextureNode, threshold : Node.<float> | number, scale : Node.<float> | number, samples : number ) : AnamorphicNode

    -
    -
    -

    TSL function for creating an anamorphic flare effect.

    -
    - - - - - - - - - - - - - - - - - - - -
    - node - -

    The node that represents the input of the effect.

    -
    - threshold - -

    The threshold is one option to control the intensity and size of the effect.

    -

    Default is 0.9.

    -
    - scale - -

    Defines the vertical scale of the flares.

    -

    Default is 3.

    -
    - samples - -

    More samples result in larger flares and a more expensive runtime behavior.

    -

    Default is 32.

    -
    -

    .and( …nodes : Node ) : OperatorNode

    @@ -2209,10 +2180,12 @@

    .bar

    -

    .batch( batchMesh : BatchedMesh ) : BatchNode

    +

    .batch( batchMesh : BatchedMesh )

    -

    TSL function for creating a batch node.

    +

    TSL function representing the vertex shader batching setup. +Applies the batch transformation matrix to positionLocal, normalLocal, and tangentLocal. +Also assigns the batch color if a color texture is present.

    @@ -2221,7 +2194,7 @@

    .batchbatchMesh

    @@ -3251,51 +3224,6 @@

    .circl
    Returns: 1.0 at center, 0.0 at edges.
    -

    .circleIntersectsAABB( circleCenter : Node.<vec2>, radius : Node.<float>, minBounds : Node.<vec2>, maxBounds : Node.<vec2> ) : Node.<bool>

    -
    -
    -

    TSL function that checks if a circle intersects with an axis-aligned bounding box (AABB).

    -
    -

    -

    A reference to batched mesh.

    +

    The batched mesh.

    - - - - - - - - - - - - - - - - - - -
    - circleCenter - -

    The center of the circle.

    -
    - radius - -

    The radius of the circle.

    -
    - minBounds - -

    The minimum bounds of the AABB.

    -
    - maxBounds - -

    The maximum bounds of the AABB.

    -
    -
    -
    Returns: True if the circle intersects the AABB.
    -
    -

    .clamp( value : Node | number, low : Node | number, high : Node | number ) : Node

    @@ -3487,11 +3415,8 @@

    ..unpackRGBToNormal( node : Node.<vec3> ) : Node.<vec3>

    +

    .colorToDirection( node : Node.<vec3> ) : Node.<vec3>

    -
    -

    Unpacks a color value into a direction vector.

    -
    @@ -3505,7 +3430,7 @@

    . -
    Returns: The direction.
    +
    Deprecated: since r185. Use unpackRGBToNormal instead.

    .compute( node : Node, count : number | Array.<number>, workgroupSize : Array.<number> ) : ComputeNode

    @@ -3599,10 +3524,10 @@

    ..computeSkinning( skinnedMesh : SkinnedMesh, toPosition : Node.<vec3> ) : SkinningNode

    +

    .computeSkinning( skinnedMesh : SkinnedMesh, toPosition : Node.<vec3> ) : Node.<vec3>

    -

    TSL function for computing skinning.

    +

    TSL function that computes skeletal animation for custom compute passes.

    @@ -3619,12 +3544,15 @@

    .toPosition

    -

    The target position.

    +

    The target position node to assign.

    Default is null.

    +
    +
    Returns: The computed skinned position node.
    +

    .context( nodeOrValue : Node | Object, value : Object ) : ContextNode

    @@ -3976,6 +3904,27 @@

    ..curlNoise( p : Node.<vec3> ) : Node.<vec3>

    +
    +
    +

    3D Curl noise in TSL. Generates a divergence-free vector field from simplex noise.

    +
    + + + + + + + +
    + p + +

    Input coordinate vector.

    +
    +
    +
    Returns: Curl noise vector.
    +
    +

    .dFdx( x : Node | number ) : Node

    @@ -4251,11 +4200,8 @@

    ..packNormalToRGB( node : Node.<vec3> ) : Node.<vec3>

    +

    .directionToColor( node : Node.<vec3> ) : Node.<vec3>

    -
    -

    Packs a direction vector into a color value.

    -
    @@ -4269,7 +4215,38 @@

    . -
    Returns: The color.
    +
    Deprecated: since r185. Use packNormalToRGB instead.
    + + +

    .directionToFaceDirection( vector : Node.<vec3> ) : Node.<vec3>

    +
    +
    +

    Negates a vector if the rendering occurs on the back side of a face, +based on the material's side configuration.

    +
      +
    • If the material's side is BackSide, the vector is inverted (negated).
    • +
    • If the material's side is DoubleSide, the vector is multiplied by faceDirection +(negated only for back-facing fragments).
    • +
    • If the material's side is FrontSide (default), the vector remains unchanged.
    • +
    +
    +
    + + + + + + +
    + vector + +

    The vector to convert.

    +
    +
    +
    Deprecated: since r185. Use negateOnBackSide instead.
    +
    +
    +
    Returns: The converted vector.

    .distance( x : Node.<(vec2|vec3|vec4)>, y : Node.<(vec2|vec3|vec4)> ) : Node.<float>

    @@ -4538,7 +4515,31 @@

    .equal

    -

    .equirectUV( dirNode : Node.<vec3> ) : Node.<vec2>

    +

    .equirectDirection( uv : Node.<vec2> ) : Node.<vec3>

    +
    +
    +

    TSL function for creating an equirect direction node.

    +

    Can be used to compute a direction vector from the given equirectangular +UV coordinates.

    +
    + + + + + + + +
    + uv + +

    The equirectangular UV coordinates.

    +

    Default is UV().

    +
    +
    +
    Returns: The computed direction vector.
    +
    +
    +

    .equirectUV( direction : Node.<vec3> ) : Node.<vec2>

    -

    .instance( count : number, instanceMatrix : InstancedBufferAttribute | StorageInstancedBufferAttribute, instanceColor : InstancedBufferAttribute | StorageInstancedBufferAttribute ) : InstanceNode

    +

    .instance( count : number, matrices : InstancedBufferAttribute | StorageInstancedBufferAttribute, colors : InstancedBufferAttribute | StorageInstancedBufferAttribute )

    -

    TSL function for creating an instance node.

    +

    TSL function representing the standard instancing vertex shader setup. +Transforms positionLocal and normalLocal, and assigns varying color in-place.

    @@ -5551,23 +5553,24 @@

    .i count

    @@ -5690,10 +5693,10 @@

    -

    The number of instances.

    +

    The instance count.

    - instanceMatrix + matrices -

    Instanced buffer attribute representing the instance transformations.

    +

    The instanced transformation matrices.

    - instanceColor + colors -

    Instanced buffer attribute representing the instance colors.

    +

    The optional instanced colors.

    +

    Default is null.

    -

    .instancedMesh( instancedMesh : InstancedMesh ) : InstancedMeshNode

    +

    .instancedMesh( instancedMesh : InstancedMesh )

    -

    TSL function for creating an instanced mesh node.

    +

    TSL wrapper for applying instanced mesh rendering setup.

    @@ -5702,7 +5705,7 @@

    .instancedMesh

    @@ -6577,10 +6580,11 @@

    .mod

    -

    The instancedMesh.

    +

    The instanced mesh.

    -

    .morphReference( mesh : Mesh ) : MorphNode

    +

    .morphReference( mesh : Mesh )

    -

    TSL function for creating a morph node.

    +

    TSL function representing the vertex shader morph targets blend setup. +Dynamically computes morph targets weights and updates positionLocal and normalLocal in-place.

    @@ -6589,7 +6593,7 @@

    .mesh

    @@ -6703,6 +6707,34 @@

    .negat

    -

    The mesh holding the morph targets.

    +

    The mesh.

    +

    .negateOnBackSide( vector : Node.<vec3> ) : Node.<vec3>

    +
    +
    +

    Negates a vector if the rendering occurs on the back side of a face, +based on the material's side configuration.

    +
      +
    • If the material's side is BackSide, the vector is inverted (negated).
    • +
    • If the material's side is DoubleSide, the vector is multiplied by faceDirection +(negated only for back-facing fragments).
    • +
    • If the material's side is FrontSide (default), the vector remains unchanged.
    • +
    +
    + + + + + + + +
    + vector + +

    The vector to process.

    +
    +
    +
    Returns: The processed vector.
    +
    +

    .neutralToneMapping( color : Node.<vec3>, exposure : Node.<float> ) : Node.<vec3>

    @@ -7193,6 +7225,82 @@

    ..overrideNode( targetNode : Node, callback : function | Node | null, flowNode : Node | null ) : OverrideContextNode

    +
    +
    +

    TSL function for creating an OverrideContextNode to override a single target node.

    +
    material.contextNode = overrideNode( positionLocal, ( builder ) => positionLocal.add( vec3( 1, 0, 0 ) ) );
    +
    +
    + + + + + + + + + + + + + + + +
    + targetNode + +

    The target node that should be overridden.

    +
    + callback + +

    A callback function returning the overriding node (which receives the builder as its argument), or the overriding node itself.

    +

    Default is null.

    +
    + flowNode + +

    The node whose context should be modified.

    +

    Default is null.

    +
    +
    +
    Returns: The created override context node.
    +
    +
    +

    .overrideNodes( overrides : Map.<Node, (function()|Node)> | Array.<Array.<(Node|function()|Node)>>, flowNode : Node | null ) : OverrideContextNode

    +
    +
    +

    TSL function for creating an OverrideContextNode to override multiple target nodes.

    +
    material.contextNode = overrideNodes( [
    +	[ positionView, customPositionView ],
    +	[ positionViewDirection, ( builder ) => customPositionViewDirection ]
    +] );
    +
    +
    + + + + + + + + + + + +
    + overrides + +

    The overrides mapping target nodes to callback functions or overriding nodes.

    +
    + flowNode + +

    The node whose context should be modified.

    +

    Default is null.

    +
    +
    +
    Returns: The created override context node.
    +
    +

    .packHalf2x16( value : Node.<vec2> ) : Node

    @@ -7211,6 +7319,27 @@

    ..packNormalToRGB( node : Node.<vec3> ) : Node.<vec3>

    +
    +
    +

    Packs a normal vector into a color value.

    +
    + + + + + + + +
    + node + +

    The direction to pack.

    +
    +
    +
    Returns: The color.
    +
    +

    .packSnorm2x16( value : Node.<vec2> ) : Node

    @@ -7460,6 +7589,27 @@

    .pcurv
    Returns: The remapped value.

    +

    .permute( x : Node.<vec4> ) : Node.<vec4>

    +
    +
    +

    Permutation polynomial for noise generation.

    +
    + + + + + + + +
    + x + +

    Input vector.

    +
    +
    +
    Returns: Permuted vector.
    +
    +

    .perspectiveDepthToViewZ( depth : Node.<float>, near : Node.<float>, far : Node.<float> ) : Node.<float>

    -

    .property( type : string, name : string ) : PropertyNode

    +

    .property( type : string, name : string, placeholderNode : Node ) : PropertyNode

    -

    .skinning( skinnedMesh : SkinnedMesh ) : SkinningNode

    +

    .skinning( skinnedMesh : SkinnedMesh )

    -

    TSL function for creating a skinning node.

    +

    TSL function representing the standard skeletal animation vertex shader setup. +Transforms positionLocal, normalLocal, and tangentLocal in-place.

    @@ -9480,6 +9640,48 @@

    ..snoise( v : Node.<vec3> ) : Node.<float>

    +
    +
    +

    3D Simplex noise implementation in TSL.

    +
    +
    + + + + + + +
    + v + +

    Input coordinate vector.

    +
    +
    +
    Returns: Simplex noise value.
    +
    +
    +

    .snoiseVec3( x : Node.<vec3> ) : Node.<vec3>

    +
    +
    +

    3D Simplex noise vector. Returns a vec3 containing three independent noise samples.

    +
    + + + + + + + +
    + x + +

    Input coordinate vector.

    +
    +
    +
    Returns: Vector of three noise values.
    +
    +

    .sobel( node : Node.<vec4> ) : SobelOperatorNode

    @@ -11013,37 +11215,6 @@

    ..tiledLights( maxLights : number, tileSize : number ) : TiledLightsNode

    -
    -
    -

    TSL function that creates a tiled lights node.

    -
    - - - - - - - - - - - -
    - maxLights - -

    The maximum number of lights.

    -

    Default is 1024.

    -
    - tileSize - -

    The tile size.

    -

    Default is 32.

    -
    -
    -
    Returns: The tiled lights node.
    -
    -

    .toneMapping( mapping : number, exposure : Node.<float> | number, color : Node.<vec3> | Color ) : ToneMappingNode.<vec3>

    @@ -11198,10 +11369,10 @@

    ..transformNormal( normal : Node.<vec3>, matrix : Node.<mat3> ) : Node.<vec3>

    +

    .transformNormal( normal : Node.<vec3>, matrix : Node.<(mat3|mat4)> ) : Node.<vec3>

    -

    Transforms the normal with the given matrix.

    +

    Transforms the normal by the normal matrix of the given matrix and then normalizes the result.

    @@ -11228,6 +11399,68 @@

    .Returns: The transformed normal. +

    .transformNormalByInverseViewMatrix( normal : Node.<vec3>, viewMatrix : Node.<(mat3|mat4)> ) : Node.<vec3>

    +
    +
    +

    Transforms a normal vector by the inverse of the view matrix and then normalizes the result.

    +

    The upper-left 3x3 of the view matrix is assumed to be orthonormal, so post-multiplying +by the view matrix is equivalent to pre-multiplying by its inverse.

    +
    +

    + + + + + + + + + + +
    + normal + +

    The normal vector, given in view space.

    +
    + viewMatrix + +

    The view matrix.

    +
    +
    +
    Returns: The normal vector in world space.
    +
    +
    +

    .transformNormalByViewMatrix( normal : Node.<vec3>, viewMatrix : Node.<(mat3|mat4)> ) : Node.<vec3>

    +
    +
    +

    Transforms a normal vector by the view matrix and then normalizes the result.

    +

    The upper-left 3x3 of the view matrix is assumed to be orthonormal, so the +normal can be transformed directly without involving the normal matrix.

    +
    + + + + + + + + + + + +
    + normal + +

    The normal vector, given in world space.

    +
    + viewMatrix + +

    The view matrix.

    +
    +
    +
    Returns: The normal vector in view space.
    +
    +

    .transformNormalToView( normal : Node.<vec3>, builder : NodeBuilder ) : Node.<vec3>

    @@ -11700,6 +11933,27 @@

    .Returns: The resulting normal.

    +

    .unpackRGBToNormal( node : Node.<vec3> ) : Node.<vec3>

    +
    +
    +

    Unpacks a color value into a normal vector.

    +
    + + + + + + + +
    + node + +

    The color to unpack.

    +
    +
    +
    Returns: The direction.
    +
    +

    .unpackSnorm2x16( value : Node.<uint> ) : Node

    @@ -11843,7 +12097,7 @@

    .var

    -

    .varyingProperty( type : string, name : string ) : PropertyNode

    +

    .varyingProperty( type : string, name : string, placeholderNode : Node ) : PropertyNode

    TSL function for creating a varying property node.

    @@ -11867,6 +12121,15 @@

    . + placeholderNode + + +

    The placeholder node if not assigned.

    +

    Default is null.

    + +

    @@ -11930,7 +12193,7 @@

    .v

    Controls the intensity of the vibrance effect.

    -

    Default is 1.

    +

    Default is 0.

    diff --git a/docs/pages/TSL.html.md b/docs/pages/TSL.html.md index c9266efa3a28e5..162d5693527064 100644 --- a/docs/pages/TSL.html.md +++ b/docs/pages/TSL.html.md @@ -32,10 +32,18 @@ TSL object that represents the TBN matrix in view space. Represents PI \* 2. +### .alphaLine : Node. (constant) + +TSL fragment node that computes the shape/coverage (alpha) of the fat line segment. Handles dash/gap generation, alpha-to-coverage rendering, and round endcaps. + ### .alphaT : PropertyNode. (constant) TSL object that represents the shader variable `AlphaT`. +### .ambientOcclusion : PropertyNode. (constant) + +TSL object that represents the shader variable `AmbientOcclusion`. If no value is assigned to this property, it defaults to a placeholder value of `1.0`. + ### .anisotropy : PropertyNode. (constant) TSL object that represents the shader variable `Anisotropy`. @@ -166,12 +174,6 @@ TSL object that represents the shader variable `DiffuseColor`. TSL object that represents the shader variable `DiffuseContribution`. -### .directionToFaceDirection (constant) - -Converts a direction vector to a face direction vector based on the material's side. - -If the material is set to `BackSide`, the direction is inverted. If the material is set to `DoubleSide`, the direction is multiplied by `faceDirection`. - ### .dispersion : PropertyNode. (constant) TSL object that represents the shader variable `Dispersion`. @@ -460,6 +462,10 @@ TSL object that represents the object's world matrix. TSL object that represents the object's inverse world matrix. +### .mvpLine : Node. (constant) + +TSL node acting as a custom Model-View-Projection (MVP) for fat lines, expanding 3D segments into screen/world-facing ribbons of a specified width. + ### .normalFlat : Node. (constant) TSL object that represents the flat vertex normal of the current rendered object in view space. @@ -531,7 +537,9 @@ TSL object that represents the position attribute of the current rendered object ### .positionLocal : AttributeNode. (constant) -TSL object that represents the vertex position in local space of the current rendered object. +TSL object that represents the transformed vertex position in local space of the current rendered object. + +The term "transformed" indicates that an object or material's properties, such as skinning, batch, instancing, or displacement mapping, will change the vertex position of the node when present. To use the pre-transformed local space position of the object, use [positionGeometry](TSL.html#positionGeometry). ### .positionPrevious : AttributeNode. (constant) @@ -937,32 +945,6 @@ The scene to render. The camera to render the scene with. -### .anamorphic( node : TextureNode, threshold : Node. | number, scale : Node. | number, samples : number ) : AnamorphicNode - -TSL function for creating an anamorphic flare effect. - -**node** - -The node that represents the input of the effect. - -**threshold** - -The threshold is one option to control the intensity and size of the effect. - -Default is `0.9`. - -**scale** - -Defines the vertical scale of the flares. - -Default is `3`. - -**samples** - -More samples result in larger flares and a more expensive runtime behavior. - -Default is `32`. - ### .and( …nodes : Node ) : OperatorNode Performs a logical AND operation on multiple nodes. @@ -1263,13 +1245,13 @@ TSL function for creating a barrier node. The scope defines the behavior of the node.. -### .batch( batchMesh : BatchedMesh ) : BatchNode +### .batch( batchMesh : BatchedMesh ) -TSL function for creating a batch node. +TSL function representing the vertex shader batching setup. Applies the batch transformation matrix to positionLocal, normalLocal, and tangentLocal. Also assigns the batch color if a color texture is present. **batchMesh** -A reference to batched mesh. +The batched mesh. ### .bentNormalView() : Node. @@ -1809,28 +1791,6 @@ Default is `uv()`. **Returns:** 1.0 at center, 0.0 at edges. -### .circleIntersectsAABB( circleCenter : Node., radius : Node., minBounds : Node., maxBounds : Node. ) : Node. - -TSL function that checks if a circle intersects with an axis-aligned bounding box (AABB). - -**circleCenter** - -The center of the circle. - -**radius** - -The radius of the circle. - -**minBounds** - -The minimum bounds of the AABB. - -**maxBounds** - -The maximum bounds of the AABB. - -**Returns:** True if the circle intersects the AABB. - ### .clamp( value : Node | number, low : Node | number, high : Node | number ) : Node Constrains a value to lie between two further values. @@ -1939,13 +1899,11 @@ The source color space. ### .colorToDirection( node : Node. ) : Node. -Unpacks a color value into a direction vector. - **node** The color to unpack. -**Returns:** The direction. +**Deprecated:** since r185. Use [unpackRGBToNormal](TSL.html#unpackRGBToNormal) instead. ### .compute( node : Node, count : number | Array., workgroupSize : Array. ) : ComputeNode @@ -1993,9 +1951,9 @@ The workgroup size. Default is `[64]`. -### .computeSkinning( skinnedMesh : SkinnedMesh, toPosition : Node. ) : SkinningNode +### .computeSkinning( skinnedMesh : SkinnedMesh, toPosition : Node. ) : Node. -TSL function for computing skinning. +TSL function that computes skeletal animation for custom compute passes. **skinnedMesh** @@ -2003,10 +1961,12 @@ The skinned mesh. **toPosition** -The target position. +The target position node to assign. Default is `null`. +**Returns:** The computed skinned position node. + ### .context( nodeOrValue : Node | Object, value : Object ) : ContextNode TSL function for creating a context node. @@ -2193,6 +2153,16 @@ The bias node. Default is `null`. +### .curlNoise( p : Node. ) : Node. + +3D Curl noise in TSL. Generates a divergence-free vector field from simplex noise. + +**p** + +Input coordinate vector. + +**Returns:** Curl noise vector. + ### .dFdx( x : Node | number ) : Node Returns the partial derivative of the parameter with respect to x. @@ -2321,13 +2291,27 @@ The second parameter. ### .directionToColor( node : Node. ) : Node. -Packs a direction vector into a color value. - **node** The direction to pack. -**Returns:** The color. +**Deprecated:** since r185. Use [packNormalToRGB](TSL.html#packNormalToRGB) instead. + +### .directionToFaceDirection( vector : Node. ) : Node. + +Negates a vector if the rendering occurs on the back side of a face, based on the material's side configuration. + +* If the material's side is `BackSide`, the vector is inverted (negated). +* If the material's side is `DoubleSide`, the vector is multiplied by `faceDirection` (negated only for back-facing fragments). +* If the material's side is `FrontSide` (default), the vector remains unchanged. + +**vector** + +The vector to convert. + +**Deprecated:** since r185. Use [negateOnBackSide](TSL.html#negateOnBackSide) instead. + +**Returns:** The converted vector. ### .distance( x : Node.<(vec2|vec3|vec4)>, y : Node.<(vec2|vec3|vec4)> ) : Node. @@ -2463,7 +2447,21 @@ The first input. The second input. -### .equirectUV( dirNode : Node. ) : Node. +### .equirectDirection( uv : Node. ) : Node. + +TSL function for creating an equirect direction node. + +Can be used to compute a direction vector from the given equirectangular UV coordinates. + +**uv** + +The equirectangular UV coordinates. + +Default is `UV()`. + +**Returns:** The computed direction vector. + +### .equirectUV( direction : Node. ) : Node. TSL function for creating an equirect uv node. @@ -2473,7 +2471,7 @@ Can be used to compute texture coordinates for projecting an equirectangular tex scene.backgroundNode = texture( equirectTexture, equirectUV() ); ``` -**dirNode** +**direction** A direction vector for sampling which is by default `positionWorldDirection`. @@ -2962,21 +2960,23 @@ Default is `null`. **Returns:** The inspector node. -### .instance( count : number, instanceMatrix : InstancedBufferAttribute | StorageInstancedBufferAttribute, instanceColor : InstancedBufferAttribute | StorageInstancedBufferAttribute ) : InstanceNode +### .instance( count : number, matrices : InstancedBufferAttribute | StorageInstancedBufferAttribute, colors : InstancedBufferAttribute | StorageInstancedBufferAttribute ) -TSL function for creating an instance node. +TSL function representing the standard instancing vertex shader setup. Transforms positionLocal and normalLocal, and assigns varying color in-place. **count** -The number of instances. +The instance count. -**instanceMatrix** +**matrices** -Instanced buffer attribute representing the instance transformations. +The instanced transformation matrices. -**instanceColor** +**colors** -Instanced buffer attribute representing the instance colors. +The optional instanced colors. + +Default is `null`. ### .instancedArray( count : number | TypedArray, type : string | Struct ) : StorageBufferNode @@ -3044,13 +3044,13 @@ The buffer offset. Default is `0`. -### .instancedMesh( instancedMesh : InstancedMesh ) : InstancedMeshNode +### .instancedMesh( instancedMesh : InstancedMesh ) -TSL function for creating an instanced mesh node. +TSL wrapper for applying instanced mesh rendering setup. **instancedMesh** -The instancedMesh. +The instanced mesh. ### .intBitsToFloat( value : Node. ) : BitcastNode @@ -3475,13 +3475,13 @@ The first input. The second input. -### .morphReference( mesh : Mesh ) : MorphNode +### .morphReference( mesh : Mesh ) -TSL function for creating a morph node. +TSL function representing the vertex shader morph targets blend setup. Dynamically computes morph targets weights and updates positionLocal and normalLocal in-place. **mesh** -The mesh holding the morph targets. +The mesh. ### .motionBlur( inputNode : Node., velocity : Node., numSamples : Node. ) : Node. @@ -3535,6 +3535,20 @@ Negates the value of the parameter (-x). The parameter. +### .negateOnBackSide( vector : Node. ) : Node. + +Negates a vector if the rendering occurs on the back side of a face, based on the material's side configuration. + +* If the material's side is `BackSide`, the vector is inverted (negated). +* If the material's side is `DoubleSide`, the vector is multiplied by `faceDirection` (negated only for back-facing fragments). +* If the material's side is `FrontSide` (default), the vector remains unchanged. + +**vector** + +The vector to process. + +**Returns:** The processed vector. + ### .neutralToneMapping( color : Node., exposure : Node. ) : Node. Neutral tone mapping. @@ -3767,6 +3781,55 @@ TSL function for creating a function overloading node. Array of `Fn` function definitions. +### .overrideNode( targetNode : Node, callback : function | Node | null, flowNode : Node | null ) : OverrideContextNode + +TSL function for creating an `OverrideContextNode` to override a single target node. + +```js +material.contextNode = overrideNode( positionLocal, ( builder ) => positionLocal.add( vec3( 1, 0, 0 ) ) ); +``` + +**targetNode** + +The target node that should be overridden. + +**callback** + +A callback function returning the overriding node (which receives the builder as its argument), or the overriding node itself. + +Default is `null`. + +**flowNode** + +The node whose context should be modified. + +Default is `null`. + +**Returns:** The created override context node. + +### .overrideNodes( overrides : Map. | Array.>, flowNode : Node | null ) : OverrideContextNode + +TSL function for creating an `OverrideContextNode` to override multiple target nodes. + +```js +material.contextNode = overrideNodes( [ + [ positionView, customPositionView ], + [ positionViewDirection, ( builder ) => customPositionViewDirection ] +] ); +``` + +**overrides** + +The overrides mapping target nodes to callback functions or overriding nodes. + +**flowNode** + +The node whose context should be modified. + +Default is `null`. + +**Returns:** The created override context node. + ### .packHalf2x16( value : Node. ) : Node Converts each component of the vec2 to 16-bit floating-point values. The results are packed into a single unsigned integer. @@ -3775,6 +3838,16 @@ Converts each component of the vec2 to 16-bit floating-point values. The results The 2-component vector to be packed +### .packNormalToRGB( node : Node. ) : Node. + +Packs a normal vector into a color value. + +**node** + +The direction to pack. + +**Returns:** The color. + ### .packSnorm2x16( value : Node. ) : Node Converts each component of the normalized float to 16-bit integer values. The results are packed into a single unsigned integer. round(clamp(c, -1, +1) \* 32767.0) @@ -3889,6 +3962,16 @@ Second control parameter. **Returns:** The remapped value. +### .permute( x : Node. ) : Node. + +Permutation polynomial for noise generation. + +**x** + +Input vector. + +**Returns:** Permuted vector. + ### .perspectiveDepthToViewZ( depth : Node., near : Node., far : Node. ) : Node. TSL function for converting a perspective depth value to a viewZ value. @@ -4051,7 +4134,7 @@ The input color with non-premultiplied alpha. **Returns:** The color with premultiplied alpha. -### .property( type : string, name : string ) : PropertyNode +### .property( type : string, name : string, placeholderNode : Node ) : PropertyNode TSL function for creating a property node. @@ -4065,6 +4148,12 @@ The name of the property in the shader. Default is `null`. +**placeholderNode** + +The placeholder node if not assigned. + +Default is `null`. + ### .quadBroadcast( e : number ) : number Broadcasts e from the quad invocation with id equal to id. @@ -4864,9 +4953,9 @@ Returns the hyperbolic sine of the parameter. The parameter. -### .skinning( skinnedMesh : SkinnedMesh ) : SkinningNode +### .skinning( skinnedMesh : SkinnedMesh ) -TSL function for creating a skinning node. +TSL function representing the standard skeletal animation vertex shader setup. Transforms positionLocal, normalLocal, and tangentLocal in-place. **skinnedMesh** @@ -4912,6 +5001,26 @@ The value of the lower edge of the Hermite function. The value of the upper edge of the Hermite function. +### .snoise( v : Node. ) : Node. + +3D Simplex noise implementation in TSL. + +**v** + +Input coordinate vector. + +**Returns:** Simplex noise value. + +### .snoiseVec3( x : Node. ) : Node. + +3D Simplex noise vector. Returns a vec3 containing three independent noise samples. + +**x** + +Input coordinate vector. + +**Returns:** Vector of three noise values. + ### .sobel( node : Node. ) : SobelOperatorNode TSL function for creating a sobel operator node which performs edge detection with a sobel filter. @@ -5699,24 +5808,6 @@ The value node that should be stored in the texture. Default is `null`. -### .tiledLights( maxLights : number, tileSize : number ) : TiledLightsNode - -TSL function that creates a tiled lights node. - -**maxLights** - -The maximum number of lights. - -Default is `1024`. - -**tileSize** - -The tile size. - -Default is `32`. - -**Returns:** The tiled lights node. - ### .toneMapping( mapping : number, exposure : Node. | number, color : Node. | Color ) : ToneMappingNode. TSL function for creating a tone mapping node. @@ -5793,9 +5884,9 @@ The direction vector. The transformation matrix. -### .transformNormal( normal : Node., matrix : Node. ) : Node. +### .transformNormal( normal : Node., matrix : Node.<(mat3|mat4)> ) : Node. -Transforms the normal with the given matrix. +Transforms the normal by the normal matrix of the given matrix and then normalizes the result. **normal** @@ -5809,6 +5900,38 @@ Default is `modelWorldMatrix`. **Returns:** The transformed normal. +### .transformNormalByInverseViewMatrix( normal : Node., viewMatrix : Node.<(mat3|mat4)> ) : Node. + +Transforms a normal vector by the inverse of the view matrix and then normalizes the result. + +The upper-left 3x3 of the view matrix is assumed to be orthonormal, so post-multiplying by the view matrix is equivalent to pre-multiplying by its inverse. + +**normal** + +The normal vector, given in view space. + +**viewMatrix** + +The view matrix. + +**Returns:** The normal vector in world space. + +### .transformNormalByViewMatrix( normal : Node., viewMatrix : Node.<(mat3|mat4)> ) : Node. + +Transforms a normal vector by the view matrix and then normalizes the result. + +The upper-left 3x3 of the view matrix is assumed to be orthonormal, so the normal can be transformed directly without involving the normal matrix. + +**normal** + +The normal vector, given in world space. + +**viewMatrix** + +The view matrix. + +**Returns:** The normal vector in view space. + ### .transformNormalToView( normal : Node., builder : NodeBuilder ) : Node. Transforms the given normal from local to view space. @@ -6051,6 +6174,16 @@ The X,Y coordinates of the normal. **Returns:** The resulting normal. +### .unpackRGBToNormal( node : Node. ) : Node. + +Unpacks a color value into a normal vector. + +**node** + +The color to unpack. + +**Returns:** The direction. + ### .unpackSnorm2x16( value : Node. ) : Node Unpacks a 32-bit unsigned integer into two 16-bit values, interpreted as normalized signed integers. Returns a vec2 with both values. @@ -6119,7 +6252,7 @@ The node for which a varying should be created. The name of the varying in the shader. -### .varyingProperty( type : string, name : string ) : PropertyNode +### .varyingProperty( type : string, name : string, placeholderNode : Node ) : PropertyNode TSL function for creating a varying property node. @@ -6133,6 +6266,12 @@ The name of the varying in the shader. Default is `null`. +**placeholderNode** + +The placeholder node if not assigned. + +Default is `null`. + ### .vertexColor( index : number ) : VertexColorNode TSL function for creating a reference node. @@ -6163,7 +6302,7 @@ The input color. Controls the intensity of the vibrance effect. -Default is `1`. +Default is `0`. **Returns:** The updated color. diff --git a/docs/pages/TerrainGenerator.html b/docs/pages/TerrainGenerator.html new file mode 100644 index 00000000000000..a0c20f0e3db7a9 --- /dev/null +++ b/docs/pages/TerrainGenerator.html @@ -0,0 +1,49 @@ + + + + + TerrainGenerator - Three.js Docs + + + + + + +

    TerrainGenerator

    +
    +
    +

    Bakes a procedural mountain range into a single THREE.BufferGeometry and +returns a THREE.Group ready to add to a scene.

    +

    The heightfield is a derivative-damped fractal sum ( Quilez's fake erosion ): each +octave is suppressed where the running slope is already steep, concentrating detail +into weathered ridgelines, and a low-frequency domain warp makes those ridges +meander. A few passes of thermal ( talus ) erosion then relax any slope past the +angle of repose, settling the fractal's needle-spikes into real crests.

    +

    The grid is triangulated with alternating quad diagonals ( a diamond pattern ), so a +coarse mesh holds its silhouette without a one-way grain. The surface shades itself +from altitude and slope in TSL — grass, forest, rock, scree and snow, with detail +normals and aerial perspective — so no material or textures are needed.

    +

    The baked height grid is exposed through TerrainGenerator#sampleHeight so a +scattered forest ( or anything else ) can sit exactly on the surface.

    +

    Code Example

    +
    const terrain = new TerrainGenerator( { seed: 1 } );
    +scene.add( terrain.build() );
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/pages/TerrainGenerator.html.md b/docs/pages/TerrainGenerator.html.md new file mode 100644 index 00000000000000..ddd27a180b03f5 --- /dev/null +++ b/docs/pages/TerrainGenerator.html.md @@ -0,0 +1,24 @@ +# TerrainGenerator + +Bakes a procedural mountain range into a single THREE.BufferGeometry and returns a `THREE.Group` ready to add to a scene. + +The heightfield is a derivative-damped fractal sum ( Quilez's fake erosion ): each octave is suppressed where the running slope is already steep, concentrating detail into weathered ridgelines, and a low-frequency domain warp makes those ridges meander. A few passes of thermal ( talus ) erosion then relax any slope past the angle of repose, settling the fractal's needle-spikes into real crests. + +The grid is triangulated with alternating quad diagonals ( a diamond pattern ), so a coarse mesh holds its silhouette without a one-way grain. The surface shades itself from altitude and slope in TSL — grass, forest, rock, scree and snow, with detail normals and aerial perspective — so no material or textures are needed. + +The baked height grid is exposed through TerrainGenerator#sampleHeight so a scattered forest ( or anything else ) can sit exactly on the surface. + +## Code Example + +```js +const terrain = new TerrainGenerator( { seed: 1 } ); +scene.add( terrain.build() ); +``` + +## Constructor + +### new TerrainGenerator() + +## Source + +[examples/jsm/generators/TerrainGenerator.js](https://github.com/mrdoob/three.js/blob/master/examples/jsm/generators/TerrainGenerator.js) \ No newline at end of file diff --git a/docs/pages/TileCreasedNormalsPlugin.html b/docs/pages/TileCreasedNormalsPlugin.html new file mode 100644 index 00000000000000..10f782272d0eba --- /dev/null +++ b/docs/pages/TileCreasedNormalsPlugin.html @@ -0,0 +1,109 @@ + + + + + TileCreasedNormalsPlugin - Three.js Docs + + + + + + +

    TileCreasedNormalsPlugin

    +
    +
    +

    A plugin for 3d-tiles-renderer that computes creased vertex normals for the +geometry of each loaded tile: smooth normals everywhere except where faces meet +at an angle greater than the crease angle. Useful for photogrammetry tile sets +like Google Photorealistic 3D Tiles which come without vertex normals.

    +

    The normals are computed in a Web Worker so tile processing doesn't block the +main thread. Tiles are displayed once their normals are ready.

    +

    Code Example

    +
    tiles.registerPlugin( new TileCreasedNormalsPlugin( { creaseAngle: Math.PI / 6 } ) );
    +
    +
    +
    +

    Import

    +

    TileCreasedNormalsPlugin is an addon, and must be imported explicitly, see Installation#Addons.

    +
    import { TileCreasedNormalsPlugin } from 'three/addons/misc/TileCreasedNormalsPlugin.js';
    +
    +

    Constructor

    +

    new TileCreasedNormalsPlugin( options : Object )

    +
    +
    +

    Constructs a new plugin.

    +
    + + + + + + + +
    + options + +

    The configuration options.

    + + + + + + + +
    + creaseAngle + +

    The crease angle in radians.

    +

    Default is Math.PI/3.

    +
    +
    +
    +
    +

    Properties

    +
    +

    .creaseAngle : number

    +
    +

    The crease angle in radians.

    +
    +
    +

    Methods

    +

    .dispose()

    +
    +
    +

    Called by the tiles renderer when the plugin is unregistered or the +tiles renderer is disposed.

    +
    +
    +

    .processTileModel( scene : Object3D ) : Promise

    +
    +
    +

    Called by the tiles renderer for each loaded tile model. The tile is +displayed once the returned promise resolves.

    +
    + + + + + + + +
    + scene + +

    The tile model.

    +
    +
    +
    Returns: A promise that resolves when all geometries have creased normals.
    +
    +
    +

    Source

    +

    + examples/jsm/misc/TileCreasedNormalsPlugin.js +

    +
    +
    + + + + \ No newline at end of file diff --git a/docs/pages/TileCreasedNormalsPlugin.html.md b/docs/pages/TileCreasedNormalsPlugin.html.md new file mode 100644 index 00000000000000..69ee454a811cd5 --- /dev/null +++ b/docs/pages/TileCreasedNormalsPlugin.html.md @@ -0,0 +1,61 @@ +# TileCreasedNormalsPlugin + +A plugin for `3d-tiles-renderer` that computes creased vertex normals for the geometry of each loaded tile: smooth normals everywhere except where faces meet at an angle greater than the crease angle. Useful for photogrammetry tile sets like Google Photorealistic 3D Tiles which come without vertex normals. + +The normals are computed in a Web Worker so tile processing doesn't block the main thread. Tiles are displayed once their normals are ready. + +## Code Example + +```js +tiles.registerPlugin( new TileCreasedNormalsPlugin( { creaseAngle: Math.PI / 6 } ) ); +``` + +## Import + +TileCreasedNormalsPlugin is an addon, and must be imported explicitly, see [Installation#Addons](https://threejs.org/manual/#en/installation). + +```js +import { TileCreasedNormalsPlugin } from 'three/addons/misc/TileCreasedNormalsPlugin.js'; +``` + +## Constructor + +### new TileCreasedNormalsPlugin( options : Object ) + +Constructs a new plugin. + +**options** + +The configuration options. + +**creaseAngle** + +The crease angle in radians. + +Default is `Math.PI/3`. + +## Properties + +### .creaseAngle : number + +The crease angle in radians. + +## Methods + +### .dispose() + +Called by the tiles renderer when the plugin is unregistered or the tiles renderer is disposed. + +### .processTileModel( scene : Object3D ) : Promise + +Called by the tiles renderer for each loaded tile model. The tile is displayed once the returned promise resolves. + +**scene** + +The tile model. + +**Returns:** A promise that resolves when all geometries have creased normals. + +## Source + +[examples/jsm/misc/TileCreasedNormalsPlugin.js](https://github.com/mrdoob/three.js/blob/master/examples/jsm/misc/TileCreasedNormalsPlugin.js) \ No newline at end of file diff --git a/docs/pages/TiledLighting.html b/docs/pages/TiledLighting.html deleted file mode 100644 index 81e87906dd3e81..00000000000000 --- a/docs/pages/TiledLighting.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - TiledLighting - Three.js Docs - - - - - - -

    Lighting

    -

    TiledLighting

    -
    -
    -

    A custom lighting implementation based on Tiled-Lighting that overwrites the default -implementation in WebGPURenderer.

    -

    Code Example

    -
    const lighting = new TiledLighting();
    -renderer.lighting = lighting; // set lighting system
    -
    -
    -
    -

    Import

    -

    TiledLighting is an addon, and must be imported explicitly, see Installation#Addons.

    -
    import { TiledLighting } from 'three/addons/lighting/TiledLighting.js';
    -
    -

    Constructor

    -

    new TiledLighting()

    -
    -
    -

    Constructs a new lighting system.

    -
    -
    -
    -

    Classes

    -
    -
    TiledLighting
    -
    -
    -

    Methods

    -

    .createNode( lights : Array.<Light> ) : TiledLightsNode

    -
    -
    -

    Creates a new tiled lights node for the given array of lights.

    -

    This method is called internally by the renderer and must be overwritten by -all custom lighting implementations.

    -
    - - - - - - - -
    - lights - -

    The render object.

    -
    -
    -
    Overrides: Lighting#createNode
    -
    -
    -
    Returns: The tiled lights node.
    -
    -
    -

    Source

    -

    - examples/jsm/lighting/TiledLighting.js -

    -
    -
    - - - - \ No newline at end of file diff --git a/docs/pages/TiledLighting.html.md b/docs/pages/TiledLighting.html.md deleted file mode 100644 index eba8dd1f218625..00000000000000 --- a/docs/pages/TiledLighting.html.md +++ /dev/null @@ -1,50 +0,0 @@ -*Inheritance: Lighting →* - -# TiledLighting - -A custom lighting implementation based on Tiled-Lighting that overwrites the default implementation in [WebGPURenderer](WebGPURenderer.html). - -## Code Example - -```js -const lighting = new TiledLighting(); -renderer.lighting = lighting; // set lighting system -``` - -## Import - -TiledLighting is an addon, and must be imported explicitly, see [Installation#Addons](https://threejs.org/manual/#en/installation). - -```js -import { TiledLighting } from 'three/addons/lighting/TiledLighting.js'; -``` - -## Constructor - -### new TiledLighting() - -Constructs a new lighting system. - -## Classes - -[TiledLighting](TiledLighting.html) - -## Methods - -### .createNode( lights : Array. ) : TiledLightsNode - -Creates a new tiled lights node for the given array of lights. - -This method is called internally by the renderer and must be overwritten by all custom lighting implementations. - -**lights** - -The render object. - -**Overrides:** [Lighting#createNode](Lighting.html#createNode) - -**Returns:** The tiled lights node. - -## Source - -[examples/jsm/lighting/TiledLighting.js](https://github.com/mrdoob/three.js/blob/master/examples/jsm/lighting/TiledLighting.js) \ No newline at end of file diff --git a/docs/pages/TiledLightsNode.html b/docs/pages/TiledLightsNode.html deleted file mode 100644 index b0017012322141..00000000000000 --- a/docs/pages/TiledLightsNode.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - TiledLightsNode - Three.js Docs - - - - - - -

    EventDispatcherNodeLightsNode

    -

    TiledLightsNode

    -
    -
    -

    A custom version of LightsNode implementing tiled lighting. This node is used in -TiledLighting to overwrite the renderer's default lighting with -a custom implementation.

    -
    -
    -

    Import

    -

    TiledLightsNode is an addon, and must be imported explicitly, see Installation#Addons.

    -
    import { tiledLights } from 'three/addons/tsl/lighting/TiledLightsNode.js';
    -
    -

    Constructor

    -

    new TiledLightsNode( maxLights : number, tileSize : number )

    -
    -
    -

    Constructs a new tiled lights node.

    -
    - - - - - - - - - - - -
    - maxLights - -

    The maximum number of lights.

    -

    Default is 1024.

    -
    - tileSize - -

    The tile size.

    -

    Default is 32.

    -
    -
    -
    -

    Properties

    -
    -

    .maxLights : number

    -
    -

    The maximum number of lights.

    -

    Default is 1024.

    -
    -
    -
    -

    .tileSize : number

    -
    -

    The tile size.

    -

    Default is 32.

    -
    -
    -

    Source

    -

    - examples/jsm/tsl/lighting/TiledLightsNode.js -

    -
    -
    - - - - \ No newline at end of file diff --git a/docs/pages/TiledLightsNode.html.md b/docs/pages/TiledLightsNode.html.md deleted file mode 100644 index 67dcba61b34f12..00000000000000 --- a/docs/pages/TiledLightsNode.html.md +++ /dev/null @@ -1,49 +0,0 @@ -*Inheritance: EventDispatcher → Node → LightsNode →* - -# TiledLightsNode - -A custom version of `LightsNode` implementing tiled lighting. This node is used in [TiledLighting](TiledLighting.html) to overwrite the renderer's default lighting with a custom implementation. - -## Import - -TiledLightsNode is an addon, and must be imported explicitly, see [Installation#Addons](https://threejs.org/manual/#en/installation). - -```js -import { tiledLights } from 'three/addons/tsl/lighting/TiledLightsNode.js'; -``` - -## Constructor - -### new TiledLightsNode( maxLights : number, tileSize : number ) - -Constructs a new tiled lights node. - -**maxLights** - -The maximum number of lights. - -Default is `1024`. - -**tileSize** - -The tile size. - -Default is `32`. - -## Properties - -### .maxLights : number - -The maximum number of lights. - -Default is `1024`. - -### .tileSize : number - -The tile size. - -Default is `32`. - -## Source - -[examples/jsm/tsl/lighting/TiledLightsNode.js](https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/lighting/TiledLightsNode.js) \ No newline at end of file diff --git a/docs/pages/TimestampQueryPool.html b/docs/pages/TimestampQueryPool.html index 1128a3cbbdeb3e..edd77fce7b029f 100644 --- a/docs/pages/TimestampQueryPool.html +++ b/docs/pages/TimestampQueryPool.html @@ -163,7 +163,7 @@

    .Returns: The timestamp frames.

    -

    .hasTimestamp( uid : string ) : boolean

    +

    .hasTimestampQuery( uid : string ) : boolean

    Returns whether a timestamp is available for a given render context.

    diff --git a/docs/pages/TimestampQueryPool.html.md b/docs/pages/TimestampQueryPool.html.md index c39c4e88b9bbf9..d6af296bb36b97 100644 --- a/docs/pages/TimestampQueryPool.html.md +++ b/docs/pages/TimestampQueryPool.html.md @@ -98,7 +98,7 @@ Returns all timestamp frames. **Returns:** The timestamp frames. -### .hasTimestamp( uid : string ) : boolean +### .hasTimestampQuery( uid : string ) : boolean Returns whether a timestamp is available for a given render context. diff --git a/docs/pages/TreeGenerator.html b/docs/pages/TreeGenerator.html new file mode 100644 index 00000000000000..19f68ba9bb852b --- /dev/null +++ b/docs/pages/TreeGenerator.html @@ -0,0 +1,50 @@ + + + + + TreeGenerator - Three.js Docs + + + + + + +

    TreeGenerator

    +
    +
    +

    Grows a procedural tree skeleton — trunk, branches and twigs, each swept as a tapered +tube — and bakes it into one non-indexed BufferGeometry (position and normal +only), ready to instance into a forest. It produces branches only; add foliage as a +separate layer.

    +

    The branching is deterministic for a given seed: a recursive sweep lays down gently +curved tubes with a parallel-transport frame (so they never twist), forking by the +pipe model (each child much thinner than its parent), spreading children along the +upper part of each branch with a golden-angle roll, and pulling them back up toward +the light. A flared root, non-linear taper and gravity droop fill in the character.

    +

    Parameters are set with a fluent builder: a set<Param>() exists for every default +( setSeed, setLevels, setChildren, … ), each returning this for chaining.

    +

    Each build() returns a fresh, independent mesh that the caller owns, so one +generator can be re-parametrized and built repeatedly to grow a varied stand:

    +

    Code Example

    +
    const generator = new TreeGenerator( material );
    +const oak = generator.setSeed( 1 ).setLevels( 4 ).build();
    +const pine = generator.setSeed( 2 ).setLevels( 5 ).build();
    +
    +
    + +
    + + + + \ No newline at end of file diff --git a/docs/pages/TreeGenerator.html.md b/docs/pages/TreeGenerator.html.md new file mode 100644 index 00000000000000..a16c03378d1226 --- /dev/null +++ b/docs/pages/TreeGenerator.html.md @@ -0,0 +1,25 @@ +# TreeGenerator + +Grows a procedural tree skeleton — trunk, branches and twigs, each swept as a tapered tube — and bakes it into one non-indexed [BufferGeometry](BufferGeometry.html) (position and normal only), ready to instance into a forest. It produces _branches only_; add foliage as a separate layer. + +The branching is deterministic for a given `seed`: a recursive sweep lays down gently curved tubes with a parallel-transport frame (so they never twist), forking by the pipe model (each child much thinner than its parent), spreading children along the upper part of each branch with a golden-angle roll, and pulling them back up toward the light. A flared root, non-linear taper and gravity droop fill in the character. + +Parameters are set with a fluent builder: a `set()` exists for every default ( `setSeed`, `setLevels`, `setChildren`, … ), each returning `this` for chaining. + +Each `build()` returns a fresh, independent mesh that the caller owns, so one generator can be re-parametrized and built repeatedly to grow a varied stand: + +## Code Example + +```js +const generator = new TreeGenerator( material ); +const oak = generator.setSeed( 1 ).setLevels( 4 ).build(); +const pine = generator.setSeed( 2 ).setLevels( 5 ).build(); +``` + +## Constructor + +### new TreeGenerator() + +## Source + +[examples/jsm/generators/TreeGenerator.js](https://github.com/mrdoob/three.js/blob/master/examples/jsm/generators/TreeGenerator.js) \ No newline at end of file diff --git a/docs/pages/USDLoader.html b/docs/pages/USDLoader.html index f25c5c0ea90ae1..95f871eb31803e 100644 --- a/docs/pages/USDLoader.html +++ b/docs/pages/USDLoader.html @@ -94,7 +94,7 @@

    .load<
    Overrides: Loader#load

    -

    .parse( buffer : ArrayBuffer | string, onLoad : function, onError : onErrorCallback ) : Group

    +

    .parse( buffer : ArrayBuffer | string, path : string, onLoad : function, onError : onErrorCallback ) : Group

    Parses the given USDZ data and returns the resulting group.

    @@ -112,6 +112,15 @@

    .parseThe raw USDZ data as an array buffer.

    + + + path + + +

    The URL base path.

    +

    Default is ''.

    + + onLoad diff --git a/docs/pages/USDLoader.html.md b/docs/pages/USDLoader.html.md index fb97cd1de52a91..d88fa768d5c5a3 100644 --- a/docs/pages/USDLoader.html.md +++ b/docs/pages/USDLoader.html.md @@ -56,7 +56,7 @@ Executed when errors occur. **Overrides:** [Loader#load](Loader.html#load) -### .parse( buffer : ArrayBuffer | string, onLoad : function, onError : onErrorCallback ) : Group +### .parse( buffer : ArrayBuffer | string, path : string, onLoad : function, onError : onErrorCallback ) : Group Parses the given USDZ data and returns the resulting group. @@ -66,6 +66,12 @@ The returned group is created synchronously, but any referenced textures are loa The raw USDZ data as an array buffer. +**path** + +The URL base path. + +Default is `''`. + **onLoad** Executed once the group and all of its textures are ready. diff --git a/docs/pages/USDZExporter.html b/docs/pages/USDZExporter.html index b5424af2ddc0d3..1073c8977eff99 100644 --- a/docs/pages/USDZExporter.html +++ b/docs/pages/USDZExporter.html @@ -231,6 +231,29 @@

    .Options <

    Default is false.

    + + + animations +
    +Array.<AnimationClip> + + +

    Animation clips to bake into xformOp time samples on the +targeted objects. Only position, quaternion, and scale tracks are exported.

    +

    Default is [].

    + + + + + animationFrameRate +
    +number + + +

    Time codes per second used when writing animation samples.

    +

    Default is 60.

    + +

    diff --git a/docs/pages/USDZExporter.html.md b/docs/pages/USDZExporter.html.md index b958036c89eb23..fecf993ec27866 100644 --- a/docs/pages/USDZExporter.html.md +++ b/docs/pages/USDZExporter.html.md @@ -132,6 +132,20 @@ Whether to make the exported USDZ compatible to QuickLook which means the asset Default is `false`. +**animations** +Array.<[AnimationClip](AnimationClip.html)\> + +Animation clips to bake into `xformOp` time samples on the targeted objects. Only `position`, `quaternion`, and `scale` tracks are exported. + +Default is `[]`. + +**animationFrameRate** +number + +Time codes per second used when writing animation samples. + +Default is `60`. + ## Source [examples/jsm/exporters/USDZExporter.js](https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/USDZExporter.js) \ No newline at end of file diff --git a/docs/pages/ViewHelper.html b/docs/pages/ViewHelper.html index 083c441460bc70..402eeb64cb94ca 100644 --- a/docs/pages/ViewHelper.html +++ b/docs/pages/ViewHelper.html @@ -60,6 +60,13 @@

    .animatingDefault is false.

    +
    +

    .camera : Camera

    +
    +

    The camera whose transformation is visualized. It can be reassigned at +any time to rebind the helper to a different camera.

    +
    +

    .center : Vector3

    diff --git a/docs/pages/ViewHelper.html.md b/docs/pages/ViewHelper.html.md index 22ec283f03bc47..0395334f0912c9 100644 --- a/docs/pages/ViewHelper.html.md +++ b/docs/pages/ViewHelper.html.md @@ -36,6 +36,10 @@ Whether the helper is currently animating or not. Default is `false`. +### .camera : Camera + +The camera whose transformation is visualized. It can be reassigned at any time to rebind the helper to a different camera. + ### .center : Vector3 The helper's center point. diff --git a/docs/pages/global.html b/docs/pages/global.html index 02a071c33aeadd..1c92e39d77d90a 100644 --- a/docs/pages/global.html +++ b/docs/pages/global.html @@ -1720,6 +1720,27 @@

    .Zer

    Sets the stencil buffer value to 0.

    +
    +

    .batchColor : VaryingNode.<vec4> (constant)

    +
    +

    TSL object representing a varying property for the batching color vector.

    +
    +
    +
    +

    .buildingPalette (constant)

    +
    +

    The NYC masonry palette every tower is dressed from ( hex colours ): limestone-dominant +with terracotta accents. Shared by the single-tower example and CityGenerator's +building material so both stay in sync.

    +
    +
    +
    +

    .closestLineToLine (constant)

    +
    +

    Calculates the closest points on two 3D lines. +Used for perspective-correct line rendering and coordinates interpolation.

    +
    +

    .depthAwareBlend (constant)

    @@ -1735,12 +1756,89 @@

    . +

    .getBatchingColor (constant)

    +
    +

    TSL function that retrieves the batching color for a given instance ID from a colors texture.

    +
    +

    +
    +

    .getIndirectIndex (constant)

    +
    +

    TSL function that retrieves the indirect index for a given batch ID.

    +
    +
    +
    +

    .getMorph (constant)

    +
    +

    TSL function that retrieves and scales the morphed attribute (position or normal) texel value.

    +
    +
    +
    +

    .instanceColor : VaryingNode.<vec3> (constant)

    +
    +

    TSL object representing a varying property for the instanced color vector.

    +
    +
    +
    +

    .lineDistance : VaryingNode.<float> (constant)

    +
    +

    Varying node representing the accumulated distance along the line. +Crucial for correctly computing dashed line intervals in fragment stage.

    +
    +
    +
    +

    .outgoingLight : Node.<vec3> (constant)

    +
    +

    A node representing the outgoing light.

    +
    +
    +
    +

    .totalDiffuse : Node.<vec3> (constant)

    +
    +

    A node representing the total diffuse light.

    +
    +
    +
    +

    .totalSpecular : Node.<vec3> (constant)

    +
    +

    A node representing the total specular light.

    +
    +
    +
    +

    .trimSegmentAlpha (constant)

    +
    +

    Trims the line segment to avoid rendering behind the camera near plane. +Computes an interpolation factor (alpha) to clamp the segment's coordinate.

    +
    +

    .viewportResolution (constant)

    Deprecated: since r169. Use screenSize instead.
    +
    +

    .worldEnd : VaryingNode.<vec3> (constant)

    +
    +

    Varying node representing the world position of the segment end in view space. +Used for distance and coordinate calculations across the fragment shader.

    +
    +
    +
    +

    .worldPos : VaryingNode.<vec4> (constant)

    +
    +

    Varying node representing the interpolated world/view position of the current fragment. +Used for line/ray distance checks under perspective projection.

    +
    +
    +
    +

    .worldStart : VaryingNode.<vec3> (constant)

    +
    +

    Varying node representing the world position of the segment start in view space. +Used for distance and coordinate calculations across the fragment shader.

    +
    +

    Methods

    .BasicShadowFilter( inputs : Object ) : Node.<float>

    @@ -2006,6 +2104,43 @@

    .Returns: The filtering result.

    +

    .addArcade()

    +
    +
    +

    The base storey: a wall pierced by tall pointed-arch openings, extruded with +thickness so the openings read as deep recesses.

    +
    +
    +

    .addCornice()

    +
    +
    +

    A two-step projecting cornice / string-course band wrapping a face.

    +
    +
    +

    .addParapet()

    +
    +
    +

    A low parapet wall capping the crown.

    +
    +
    +

    .addSpandrelBands()

    +
    +
    +

    Horizontal terracotta bands at every floor line. Together with the projecting +piers they form the facade grid; the gaps between them are the window +openings, with glass set behind.

    +
    +
    +

    .bakeGroups()

    +
    +
    +

    Bakes a list of instance groups into one non-indexed BufferGeometry. Each group is a +base geometry ( position + normal + uv ), an array of Matrix4 placements and a partId +written to a per-vertex attribute. Transforming straight into preallocated typed arrays +avoids mergeGeometries' per-instance allocations; the result is one geometry, ready for +a single draw call and the compute rasterizer.

    +
    +

    .buildData3DTexture( chunk : Object ) : Data3DTexture

    @@ -2027,6 +2162,25 @@

    .Returns: The generated 3D texture.

    +

    .buildFaces()

    +
    +
    +

    Builds a face frame per footprint edge. Each frame is an orthonormal basis +( u along the edge, v up, n outward ) plus an origin and length, so all +facade layout can happen in flat ( u, v ) space and bake to world with one +matrix — the same authored piece then instances onto every face, including +the diagonal chamfer.

    +
    +
    +

    .buildFootprint()

    +
    +
    +

    A rectangle (centred at the origin in the XZ plane) with one corner cut at +45 degrees, returned as an ordered list of Vector2( x, z ). cornerX / +cornerZ ( each ±1 ) pick which corner is cut, so the chamfer can be aimed +outward to a block corner.

    +
    +

    .buildMesh( chunk : Object ) : Mesh

    @@ -2197,6 +2351,13 @@

    .coverReturns: The updated texture.

    +

    .createBuildingMaterial()

    +
    +
    +

    The shared material every tower in a CityGenerator is dressed with: one flat +masonry colour per lot, picked from a palette by hashing the lot's grid cell.

    +
    +

    .createCanvasElement() : HTMLCanvasElement

    @@ -2235,6 +2396,116 @@

    ..createForestMaterial( from : Node, to : Node ) : MeshStandardNodeMaterial

    +
    +
    +

    The single material shared by every tree in a ForestGenerator. A plain +MeshStandardNodeMaterial lit by the scene — only the surface is authored: deep +shadowed green in the recesses rising to a bright, yellow-green sunlit crown, +mottled into needle clumps by 3D noise, with a matching bump so the clumps catch +the light. Half a million instanced blobs makes this mesh vertex-bound, so the +regional colour drift is baked to a per-instance attribute ( no shader noise for it ), +and the costly clump noise + bump are gated by distance — full detail on the near +trees ( where it reads ), skipped on the far canopy ( where it is sub-pixel ).

    +
    + + + + + + + + + + + +
    + from + +

    distance within which every tree is drawn.

    +
    + to + +

    distance past which no tree is drawn.

    +
    +
    +

    .createInstanceMatrixNode( builder : NodeBuilder, instanceMatrix : InstancedBufferAttribute | StorageInstancedBufferAttribute, count : number ) : Node

    +
    +
    +

    Creates the appropriate node for instanced matrix transformations. +Depending on buffer limits and storage capability, returns either a storage, buffer, or instanced interleaved attribute node.

    +
    + + + + + + + + + + + + + + + +
    + builder + +

    The current node builder.

    +
    + instanceMatrix + +

    The matrix buffer attribute.

    +
    + count + +

    The instance count.

    +
    +
    +
    Returns: The matrix node.
    +
    +
    +

    .createRoadMaterial()

    +
    +
    +

    The road surface: wet asphalt with lane lines and crosswalks aligned to a +CityGenerator layout. Apply it to a ground plane sized to the city.

    +
    +
    +

    .createSkyscraperMaterial()

    +
    +
    +

    The facade material: a single MeshStandardNodeMaterial that reads the baked +per-vertex partId and reproduces every zone — procedural terracotta brickwork +on the walls and piers, smooth dressed stone on the window frames and ornament, +dark glazing, and grey AC units — all dressed with world-space +weathering. One material covers the whole building ( and a whole city ), which is +what makes it compute-rasterizer friendly. buildingBase is the tower's flat +masonry colour as a TSL node: pass a uniform( Color ) for a single tower, or a +per-fragment palette pick for a city, so the same material dresses both.

    +
    +
    +

    .createTreeMaterial( parameters : Object ) : MeshStandardNodeMaterial

    +
    +
    +

    A simple bark material for a TreeGenerator mesh: a low-saturation brown with a +faint, vertically-stretched grain, so trunks read near-black against bright fog.

    +
    + + + + + + + +
    + parameters + +

    barkColor ( a hex, THREE.Color or TSL node ).

    +
    +

    .damp( x : number, y : number, lambda : number, dt : number ) : number

    @@ -2697,6 +2968,27 @@

    ..getEntry( geometry : BufferGeometry ) : Object

    +
    +
    +

    Resolves or creates a compiled DataArrayTexture containing encoded vertex morph targets data for WebGL2/WebGPU.

    +
    + + + + + + + +
    + geometry + +

    The geometry to parse.

    +
    +
    +
    Returns: The resolved morph targets texture data mapping entry.
    +
    +

    .getFilteredStack()

    @@ -2799,6 +3091,236 @@

    .Returns: An array of member layouts.

    +

    .getPreviousInstance( instancedMesh : InstancedMesh, instanceMatrix : InstancedBufferAttribute | StorageInstancedBufferAttribute, builder : NodeBuilder, count : number ) : Node

    +
    +
    +

    Retrieves or initializes the previous frame instance matrix node for motion vectors. +Uses a WeakMap to cache previous frame instance matrices and their TSL nodes.

    +
    + + + + + + + + + + + + + + + + + + + +
    + instancedMesh + +

    The instanced mesh object.

    +
    + instanceMatrix + +

    The current matrix buffer attribute.

    +
    + builder + +

    The current node builder.

    +
    + count + +

    The instance count.

    +
    +
    +
    Returns: The previous frame instance matrix node.
    +
    +
    +

    .getPreviousSkinnedPosition( skinnedMesh : SkinnedMesh, bindMatrixNode : Node.<mat4>, bindMatrixInverseNode : Node.<mat4>, skinIndexNode : Node.<uvec4>, skinWeightNode : Node.<vec4> ) : Node.<vec3>

    +
    +
    +

    Retrieves or initializes the previous frame skinned position node for motion vectors. +Uses a WeakMap to cache previous frame bone matrix arrays and their TSL buffer nodes.

    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + skinnedMesh + +

    The skinned mesh.

    +
    + bindMatrixNode + +

    The bind matrix node.

    +
    + bindMatrixInverseNode + +

    The inverse bind matrix node.

    +
    + skinIndexNode + +

    The skin index attribute.

    +
    + skinWeightNode + +

    The skin weight attribute.

    +
    +
    +
    Returns: The skinned position from the previous frame.
    +
    +
    +

    .getSkinnedNormalAndTangent( boneMatrices : Node, normal : Node.<vec3>, tangent : Node.<vec3>, bindMatrix : Node.<mat4>, bindMatrixInverse : Node.<mat4>, skinIndex : Node.<uvec4>, skinWeight : Node.<vec4> ) : Object

    +
    +
    +

    Computes the skinned normal and tangent vectors by applying bone matrices based on weights.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + boneMatrices + +

    The bone matrices buffer or storage node.

    +
    + normal + +

    The normal vector in local space.

    +
    + tangent + +

    The tangent vector in local space.

    +
    + bindMatrix + +

    The bind matrix node.

    +
    + bindMatrixInverse + +

    The inverse bind matrix node.

    +
    + skinIndex + +

    The skin index attribute.

    +
    + skinWeight + +

    The skin weight attribute.

    +
    +
    +
    Returns: The skinned normal and tangent.
    +
    +
    +

    .getSkinnedPosition( boneMatrices : Node, position : Node.<vec3>, bindMatrix : Node.<mat4>, bindMatrixInverse : Node.<mat4>, skinIndex : Node.<uvec4>, skinWeight : Node.<vec4> ) : Node.<vec3>

    +
    +
    +

    Computes the skinned position by applying bone matrices based on weights.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + boneMatrices + +

    The bone matrices buffer or storage node.

    +
    + position + +

    The vertex position to transform.

    +
    + bindMatrix + +

    The bind matrix node.

    +
    + bindMatrixInverse + +

    The inverse bind matrix node.

    +
    + skinIndex + +

    The skin index attribute.

    +
    + skinWeight + +

    The skin weight attribute.

    +
    +
    +
    Returns: The skinned position.
    +
    +

    .getStrideLength( vectorLength : number ) : number

    @@ -3198,6 +3720,12 @@

    .Returns: The normalize value.

    +

    .pickBuildingColor()

    +
    +
    +

    Picks one buildingPalette colour ( a hex number ) for a tower from its seed.

    +
    +

    .pingpong( x : number, length : number ) : number

    @@ -3591,6 +4119,14 @@

    .

    +

    .slab()

    +
    +
    +

    A thin horizontal cap over a footprint's bounding box at height y. Its +sides are pulled in behind the facade plane ( into the backing-wall shell ) +so they never sit coplanar with the walls, spandrels or piers and z-fight.

    +
    +

    .smootherstep( x : number, min : number, max : number ) : number

    diff --git a/docs/pages/global.html.md b/docs/pages/global.html.md index 05d686f3e92b2e..c7e5f4a5feb994 100644 --- a/docs/pages/global.html.md +++ b/docs/pages/global.html.md @@ -1049,6 +1049,18 @@ Zero slope ending for animations. Sets the stencil buffer value to `0`. +### .batchColor : VaryingNode. (constant) + +TSL object representing a varying property for the batching color vector. + +### .buildingPalette (constant) + +The NYC masonry palette every tower is dressed from ( hex colours ): limestone-dominant with terracotta accents. Shared by the single-tower example and [CityGenerator](CityGenerator.html)'s building material so both stay in sync. + +### .closestLineToLine (constant) + +Calculates the closest points on two 3D lines. Used for perspective-correct line rendering and coordinates interpolation. + ### .depthAwareBlend (constant) Performs a depth-aware blend between a base scene and a secondary effect (like godrays). This function uses a Poisson disk sampling pattern to detect depth discontinuities in the neighborhood of the current pixel. If an edge is detected, it shifts the sampling coordinate for the blend node away from the edge to prevent light leaking/haloing. @@ -1057,10 +1069,58 @@ Performs a depth-aware blend between a base scene and a secondary effect (like g Disposes the shadow material for the given light source. +### .getBatchingColor (constant) + +TSL function that retrieves the batching color for a given instance ID from a colors texture. + +### .getIndirectIndex (constant) + +TSL function that retrieves the indirect index for a given batch ID. + +### .getMorph (constant) + +TSL function that retrieves and scales the morphed attribute (position or normal) texel value. + +### .instanceColor : VaryingNode. (constant) + +TSL object representing a varying property for the instanced color vector. + +### .lineDistance : VaryingNode. (constant) + +Varying node representing the accumulated distance along the line. Crucial for correctly computing dashed line intervals in fragment stage. + +### .outgoingLight : Node. (constant) + +A node representing the outgoing light. + +### .totalDiffuse : Node. (constant) + +A node representing the total diffuse light. + +### .totalSpecular : Node. (constant) + +A node representing the total specular light. + +### .trimSegmentAlpha (constant) + +Trims the line segment to avoid rendering behind the camera near plane. Computes an interpolation factor (alpha) to clamp the segment's coordinate. + ### .viewportResolution (constant) **Deprecated:** since r169. Use [screenSize](TSL.html#screenSize) instead. +### .worldEnd : VaryingNode. (constant) + +Varying node representing the world position of the segment end in view space. Used for distance and coordinate calculations across the fragment shader. + +### .worldPos : VaryingNode. (constant) + +Varying node representing the interpolated world/view position of the current fragment. Used for line/ray distance checks under perspective projection. + +### .worldStart : VaryingNode. (constant) + +Varying node representing the world position of the segment start in view space. Used for distance and coordinate calculations across the fragment shader. + ## Methods ### .BasicShadowFilter( inputs : Object ) : Node. @@ -1183,6 +1243,26 @@ The shadow coordinates. **Returns:** The filtering result. +### .addArcade() + +The base storey: a wall pierced by tall pointed-arch openings, extruded with thickness so the openings read as deep recesses. + +### .addCornice() + +A two-step projecting cornice / string-course band wrapping a face. + +### .addParapet() + +A low parapet wall capping the crown. + +### .addSpandrelBands() + +Horizontal terracotta bands at every floor line. Together with the projecting piers they form the facade grid; the gaps between them are the window openings, with glass set behind. + +### .bakeGroups() + +Bakes a list of instance groups into one non-indexed BufferGeometry. Each group is a base geometry ( position + normal + uv ), an array of Matrix4 placements and a `partId` written to a per-vertex attribute. Transforming straight into preallocated typed arrays avoids mergeGeometries' per-instance allocations; the result is one geometry, ready for a single draw call and the compute rasterizer. + ### .buildData3DTexture( chunk : Object ) : Data3DTexture Builds a 3D texture from a VOX chunk. @@ -1193,6 +1273,14 @@ A VOX chunk loaded via [VOXLoader](VOXLoader.html). **Returns:** The generated 3D texture. +### .buildFaces() + +Builds a face frame per footprint edge. Each frame is an orthonormal basis ( u along the edge, v up, n outward ) plus an origin and length, so all facade layout can happen in flat ( u, v ) space and bake to world with one matrix — the same authored piece then instances onto every face, including the diagonal chamfer. + +### .buildFootprint() + +A rectangle (centred at the origin in the XZ plane) with one corner cut at 45 degrees, returned as an ordered list of `Vector2( x, z )`. `cornerX` / `cornerZ` ( each ±1 ) pick which corner is cut, so the chamfer can be aimed outward to a block corner. + ### .buildMesh( chunk : Object ) : Mesh Builds a mesh from a VOX chunk. @@ -1273,6 +1361,10 @@ The texture's aspect ratio. **Returns:** The updated texture. +### .createBuildingMaterial() + +The shared material every tower in a [CityGenerator](CityGenerator.html) is dressed with: one flat masonry colour per lot, picked from a palette by hashing the lot's grid cell. + ### .createCanvasElement() : HTMLCanvasElement Creates a canvas element configured for block display. @@ -1293,6 +1385,52 @@ The event type. The callback function. +### .createForestMaterial( from : Node, to : Node ) : MeshStandardNodeMaterial + +The single material shared by every tree in a [ForestGenerator](ForestGenerator.html). A plain MeshStandardNodeMaterial lit by the scene — only the surface is authored: deep shadowed green in the recesses rising to a bright, yellow-green sunlit crown, mottled into needle clumps by 3D noise, with a matching bump so the clumps catch the light. Half a million instanced blobs makes this mesh vertex-bound, so the regional colour drift is baked to a per-instance attribute ( no shader noise for it ), and the costly clump noise + bump are **gated by distance** — full detail on the near trees ( where it reads ), skipped on the far canopy ( where it is sub-pixel ). + +**from** + +distance within which every tree is drawn. + +**to** + +distance past which no tree is drawn. + +### .createInstanceMatrixNode( builder : NodeBuilder, instanceMatrix : InstancedBufferAttribute | StorageInstancedBufferAttribute, count : number ) : Node + +Creates the appropriate node for instanced matrix transformations. Depending on buffer limits and storage capability, returns either a storage, buffer, or instanced interleaved attribute node. + +**builder** + +The current node builder. + +**instanceMatrix** + +The matrix buffer attribute. + +**count** + +The instance count. + +**Returns:** The matrix node. + +### .createRoadMaterial() + +The road surface: wet asphalt with lane lines and crosswalks aligned to a [CityGenerator](CityGenerator.html) layout. Apply it to a ground plane sized to the city. + +### .createSkyscraperMaterial() + +The facade material: a single MeshStandardNodeMaterial that reads the baked per-vertex `partId` and reproduces every zone — procedural terracotta brickwork on the walls and piers, smooth dressed stone on the window frames and ornament, dark glazing, and grey AC units — all dressed with world-space weathering. One material covers the whole building ( and a whole city ), which is what makes it compute-rasterizer friendly. `buildingBase` is the tower's flat masonry colour as a TSL node: pass a `uniform( Color )` for a single tower, or a per-fragment palette pick for a city, so the same material dresses both. + +### .createTreeMaterial( parameters : Object ) : MeshStandardNodeMaterial + +A simple bark material for a [TreeGenerator](TreeGenerator.html) mesh: a low-saturation brown with a faint, vertically-stretched grain, so trunks read near-black against bright fog. + +**parameters** + +`barkColor` ( a hex, THREE.Color or TSL node ). + ### .damp( x : number, y : number, lambda : number, dt : number ) : number Smoothly interpolate a number from `x` to `y` in a spring-like manner using a delta time to maintain frame rate independent movement. For details, see [Frame rate independent damping using lerp](http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/). @@ -1515,6 +1653,16 @@ The light's decay exponent. Utility functions for parsing +### .getEntry( geometry : BufferGeometry ) : Object + +Resolves or creates a compiled DataArrayTexture containing encoded vertex morph targets data for WebGL2/WebGPU. + +**geometry** + +The geometry to parse. + +**Returns:** The resolved morph targets texture data mapping entry. + ### .getFilteredStack() Parses the stack trace and filters out ignored files. Returns an array with function name, file, line, and column. @@ -1563,6 +1711,118 @@ An object where keys are member names and values are either types (as strings) o **Returns:** An array of member layouts. +### .getPreviousInstance( instancedMesh : InstancedMesh, instanceMatrix : InstancedBufferAttribute | StorageInstancedBufferAttribute, builder : NodeBuilder, count : number ) : Node + +Retrieves or initializes the previous frame instance matrix node for motion vectors. Uses a WeakMap to cache previous frame instance matrices and their TSL nodes. + +**instancedMesh** + +The instanced mesh object. + +**instanceMatrix** + +The current matrix buffer attribute. + +**builder** + +The current node builder. + +**count** + +The instance count. + +**Returns:** The previous frame instance matrix node. + +### .getPreviousSkinnedPosition( skinnedMesh : SkinnedMesh, bindMatrixNode : Node., bindMatrixInverseNode : Node., skinIndexNode : Node., skinWeightNode : Node. ) : Node. + +Retrieves or initializes the previous frame skinned position node for motion vectors. Uses a WeakMap to cache previous frame bone matrix arrays and their TSL buffer nodes. + +**skinnedMesh** + +The skinned mesh. + +**bindMatrixNode** + +The bind matrix node. + +**bindMatrixInverseNode** + +The inverse bind matrix node. + +**skinIndexNode** + +The skin index attribute. + +**skinWeightNode** + +The skin weight attribute. + +**Returns:** The skinned position from the previous frame. + +### .getSkinnedNormalAndTangent( boneMatrices : Node, normal : Node., tangent : Node., bindMatrix : Node., bindMatrixInverse : Node., skinIndex : Node., skinWeight : Node. ) : Object + +Computes the skinned normal and tangent vectors by applying bone matrices based on weights. + +**boneMatrices** + +The bone matrices buffer or storage node. + +**normal** + +The normal vector in local space. + +**tangent** + +The tangent vector in local space. + +**bindMatrix** + +The bind matrix node. + +**bindMatrixInverse** + +The inverse bind matrix node. + +**skinIndex** + +The skin index attribute. + +**skinWeight** + +The skin weight attribute. + +**Returns:** The skinned normal and tangent. + +### .getSkinnedPosition( boneMatrices : Node, position : Node., bindMatrix : Node., bindMatrixInverse : Node., skinIndex : Node., skinWeight : Node. ) : Node. + +Computes the skinned position by applying bone matrices based on weights. + +**boneMatrices** + +The bone matrices buffer or storage node. + +**position** + +The vertex position to transform. + +**bindMatrix** + +The bind matrix node. + +**bindMatrixInverse** + +The inverse bind matrix node. + +**skinIndex** + +The skin index attribute. + +**skinWeight** + +The skin weight attribute. + +**Returns:** The skinned position. + ### .getStrideLength( vectorLength : number ) : number This function is called with a vector length and ensure the computed length matches a predefined stride (in this case `4`). @@ -1759,6 +2019,10 @@ The typed array that defines the data type of the value. **Returns:** The normalize value. +### .pickBuildingColor() + +Picks one [buildingPalette](global.html#buildingPalette) colour ( a hex number ) for a tower from its seed. + ### .pingpong( x : number, length : number ) : number Returns a value that alternates between `0` and the given `length` parameter. @@ -1949,6 +2213,10 @@ The group the object belongs to. Additional parameters for rendering. +### .slab() + +A thin horizontal cap over a footprint's bounding box at height `y`. Its sides are pulled in behind the facade plane ( into the backing-wall shell ) so they never sit coplanar with the walls, spandrels or piers and z-fight. + ### .smootherstep( x : number, min : number, max : number ) : number A [variation on smoothstep](https://en.wikipedia.org/wiki/Smoothstep#Variations) that has zero 1st and 2nd order derivatives at `x=0` and `x=1`. diff --git a/docs/pages/module-GroundedSkybox.html b/docs/pages/module-GroundedSkybox.html new file mode 100644 index 00000000000000..dc15af70c6c0ae --- /dev/null +++ b/docs/pages/module-GroundedSkybox.html @@ -0,0 +1,62 @@ + + + + + GroundedSkybox - Three.js Docs + + + + + + +

    GroundedSkybox

    +
    +
    +
    +
    +

    Import

    +

    GroundedSkybox is an addon, and must be imported explicitly, see Installation#Addons.

    +
    import { getGroundProjectedNormal } from 'three/addons/tsl/utils/GroundedSkybox.js';
    +
    +
    +

    Static Methods

    +

    .getGroundProjectedNormal( radiusNode : Node.<float>, heightNode : Node.<float> ) : Node.<vec3>

    +
    +
    +

    Projects the world position onto a sphere whose bottom is clipped by a ground disk, +then returns a vector usable for sampling an environment cube map.

    +
    + + + + + + + + + + + +
    + radiusNode + +

    The radius of the projection sphere. Must be large enough to ensure the scene's camera stays inside.

    +
    + heightNode + +

    The height is how far the camera that took the photo was above the ground. A larger value will magnify the downward part of the image.

    +
    +
    +
    Returns: A direction vector for sampling the environment cube map.
    +
    +
    +

    Source

    +

    + examples/jsm/tsl/utils/GroundedSkybox.js +

    +
    +
    + + + + \ No newline at end of file diff --git a/docs/pages/module-GroundedSkybox.html.md b/docs/pages/module-GroundedSkybox.html.md new file mode 100644 index 00000000000000..3668e4c9ee8288 --- /dev/null +++ b/docs/pages/module-GroundedSkybox.html.md @@ -0,0 +1,29 @@ +# GroundedSkybox + +## Import + +GroundedSkybox is an addon, and must be imported explicitly, see [Installation#Addons](https://threejs.org/manual/#en/installation). + +```js +import { getGroundProjectedNormal } from 'three/addons/tsl/utils/GroundedSkybox.js'; +``` + +## Static Methods + +### .getGroundProjectedNormal( radiusNode : Node., heightNode : Node. ) : Node. + +Projects the world position onto a sphere whose bottom is clipped by a ground disk, then returns a vector usable for sampling an environment cube map. + +**radiusNode** + +The radius of the projection sphere. Must be large enough to ensure the scene's camera stays inside. + +**heightNode** + +The height is how far the camera that took the photo was above the ground. A larger value will magnify the downward part of the image. + +**Returns:** A direction vector for sampling the environment cube map. + +## Source + +[examples/jsm/tsl/utils/GroundedSkybox.js](https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/utils/GroundedSkybox.js) \ No newline at end of file diff --git a/docs/scripts/page.js b/docs/scripts/page.js index b828f04ccf682e..04b7e24304e6e3 100644 --- a/docs/scripts/page.js +++ b/docs/scripts/page.js @@ -30,9 +30,15 @@ if ( typeof hljs !== 'undefined' ) { if ( hash ) { - const element = document.getElementById( hash ); + window.history.scrollRestoration = 'manual'; - if ( element ) element.scrollIntoView(); + window.addEventListener( 'pageshow', function () { + + const element = document.getElementById( hash ); + + if ( element ) element.scrollIntoView(); + + }, { once: true } ); } diff --git a/docs/search.json b/docs/search.json index ebc3261ece2a9e..38916feea1e1c6 100644 --- a/docs/search.json +++ b/docs/search.json @@ -777,51 +777,315 @@ "kind": "function" }, { - "title": "BarrierNode", + "title": "Backend", "kind": "class" }, { - "title": "BasicEnvironmentNode", - "kind": "class" + "title": "Backend#_getQueryPool", + "kind": "function" }, { - "title": "BasicEnvironmentNode#envNode", + "title": "Backend#beginCompute", + "kind": "function" + }, + { + "title": "Backend#beginRender", + "kind": "function" + }, + { + "title": "Backend#compute", + "kind": "function" + }, + { + "title": "Backend#coordinateSystem", "kind": "member" }, { - "title": "BasicLightMapNode", - "kind": "class" + "title": "Backend#copyFramebufferToTexture", + "kind": "function" }, { - "title": "BasicLightMapNode#lightMapNode", + "title": "Backend#copyTextureToBuffer", + "kind": "function" + }, + { + "title": "Backend#copyTextureToTexture", + "kind": "function" + }, + { + "title": "Backend#createAttribute", + "kind": "function" + }, + { + "title": "Backend#createBindings", + "kind": "function" + }, + { + "title": "Backend#createComputePipeline", + "kind": "function" + }, + { + "title": "Backend#createDefaultTexture", + "kind": "function" + }, + { + "title": "Backend#createIndexAttribute", + "kind": "function" + }, + { + "title": "Backend#createNodeBuilder", + "kind": "function" + }, + { + "title": "Backend#createProgram", + "kind": "function" + }, + { + "title": "Backend#createRenderPipeline", + "kind": "function" + }, + { + "title": "Backend#createStorageAttribute", + "kind": "function" + }, + { + "title": "Backend#createTexture", + "kind": "function" + }, + { + "title": "Backend#createUniformBuffer", + "kind": "function" + }, + { + "title": "Backend#data", "kind": "member" }, { - "title": "BasicLightingModel", - "kind": "class" + "title": "Backend#delete", + "kind": "function" }, { - "title": "BasicLightingModel#finish", + "title": "Backend#deleteBindGroupData", "kind": "function" }, { - "title": "BasicLightingModel#indirect", + "title": "Backend#destroyAttribute", + "kind": "function" + }, + { + "title": "Backend#destroyProgram", + "kind": "function" + }, + { + "title": "Backend#destroySampler", + "kind": "function" + }, + { + "title": "Backend#destroyTexture", + "kind": "function" + }, + { + "title": "Backend#destroyUniformBuffer", + "kind": "function" + }, + { + "title": "Backend#dispose", + "kind": "function" + }, + { + "title": "Backend#domElement", + "kind": "member" + }, + { + "title": "Backend#draw", + "kind": "function" + }, + { + "title": "Backend#finishCompute", "kind": "function" }, { - "title": "BatchNode", + "title": "Backend#finishRender", + "kind": "function" + }, + { + "title": "Backend#generateMipmaps", + "kind": "function" + }, + { + "title": "Backend#get", + "kind": "function" + }, + { + "title": "Backend#getArrayBufferAsync", + "kind": "function" + }, + { + "title": "Backend#getClearColor", + "kind": "function" + }, + { + "title": "Backend#getContext", + "kind": "function" + }, + { + "title": "Backend#getDomElement", + "kind": "function" + }, + { + "title": "Backend#getDrawingBufferSize", + "kind": "function" + }, + { + "title": "Backend#getRenderCacheKey", + "kind": "function" + }, + { + "title": "Backend#getTimestamp", + "kind": "function" + }, + { + "title": "Backend#getTimestampFrames", + "kind": "function" + }, + { + "title": "Backend#getTimestampUID", + "kind": "function" + }, + { + "title": "Backend#has", + "kind": "function" + }, + { + "title": "Backend#hasCompatibility", + "kind": "function" + }, + { + "title": "Backend#hasFeature", + "kind": "function" + }, + { + "title": "Backend#hasFeatureAsync", + "kind": "function" + }, + { + "title": "Backend#hasTimestamp", + "kind": "member" + }, + { + "title": "Backend#hasTimestampQuery", + "kind": "function" + }, + { + "title": "Backend#init", + "kind": "function" + }, + { + "title": "Backend#initRenderTarget", + "kind": "function" + }, + { + "title": "Backend#isOccluded", + "kind": "function" + }, + { + "title": "Backend#needsRenderUpdate", + "kind": "function" + }, + { + "title": "Backend#parameters", + "kind": "member" + }, + { + "title": "Backend#renderer", + "kind": "member" + }, + { + "title": "Backend#resolveTimestampsAsync", + "kind": "function" + }, + { + "title": "Backend#set", + "kind": "function" + }, + { + "title": "Backend#setScissorTest", + "kind": "function" + }, + { + "title": "Backend#setXRTarget", + "kind": "function" + }, + { + "title": "Backend#timestampQueryPool", + "kind": "member" + }, + { + "title": "Backend#trackTimestamp", + "kind": "member" + }, + { + "title": "Backend#updateAttribute", + "kind": "function" + }, + { + "title": "Backend#updateBinding", + "kind": "function" + }, + { + "title": "Backend#updateBindings", + "kind": "function" + }, + { + "title": "Backend#updateSampler", + "kind": "function" + }, + { + "title": "Backend#updateSize", + "kind": "function" + }, + { + "title": "Backend#updateTexture", + "kind": "function" + }, + { + "title": "Backend#updateTimeStampUID", + "kind": "function" + }, + { + "title": "Backend#updateViewport", + "kind": "function" + }, + { + "title": "BarrierNode", "kind": "class" }, { - "title": "BatchNode#batchMesh", + "title": "BasicEnvironmentNode", + "kind": "class" + }, + { + "title": "BasicEnvironmentNode#envNode", "kind": "member" }, { - "title": "BatchNode#batchingIdNode", + "title": "BasicLightMapNode", + "kind": "class" + }, + { + "title": "BasicLightMapNode#lightMapNode", "kind": "member" }, { - "title": "BatchNode#setup", + "title": "BasicLightingModel", + "kind": "class" + }, + { + "title": "BasicLightingModel#finish", + "kind": "function" + }, + { + "title": "BasicLightingModel#indirect", "kind": "function" }, { @@ -2980,6 +3244,10 @@ "title": "DataTextureLoader", "kind": "class" }, + { + "title": "DataTextureLoader#createDataTexture", + "kind": "function" + }, { "title": "DataTextureLoader#load", "kind": "function" @@ -3416,6 +3684,10 @@ "title": "FrustumArray#coordinateSystem", "kind": "member" }, + { + "title": "FrustumArray#copy", + "kind": "function" + }, { "title": "FrustumArray#intersectsBox", "kind": "function" @@ -3432,6 +3704,10 @@ "title": "FrustumArray#intersectsSprite", "kind": "function" }, + { + "title": "FrustumArray#setFromArrayCamera", + "kind": "function" + }, { "title": "FunctionCallNode", "kind": "class" @@ -4124,58 +4400,6 @@ "title": "InspectorNode#update", "kind": "function" }, - { - "title": "InstanceNode", - "kind": "class" - }, - { - "title": "InstanceNode#buffer", - "kind": "member" - }, - { - "title": "InstanceNode#bufferColor", - "kind": "member" - }, - { - "title": "InstanceNode#count", - "kind": "member" - }, - { - "title": "InstanceNode#getPreviousInstancedPosition", - "kind": "function" - }, - { - "title": "InstanceNode#instanceColor", - "kind": "member" - }, - { - "title": "InstanceNode#instanceColorNode", - "kind": "member" - }, - { - "title": "InstanceNode#instanceMatrix", - "kind": "member" - }, - { - "title": "InstanceNode#instanceMatrixNode", - "kind": "member" - }, - { - "title": "InstanceNode#previousInstanceMatrixNode", - "kind": "member" - }, - { - "title": "InstanceNode#setup", - "kind": "function" - }, - { - "title": "InstanceNode#update", - "kind": "function" - }, - { - "title": "InstanceNode#updateType", - "kind": "member" - }, { "title": "InstancedBufferAttribute", "kind": "class" @@ -4252,10 +4476,6 @@ "title": "InstancedMesh#morphTexture", "kind": "member" }, - { - "title": "InstancedMesh#previousInstanceMatrix", - "kind": "member" - }, { "title": "InstancedMesh#setColorAt", "kind": "function" @@ -4268,14 +4488,6 @@ "title": "InstancedMesh#setMorphAt", "kind": "function" }, - { - "title": "InstancedMeshNode", - "kind": "class" - }, - { - "title": "InstancedMeshNode#instancedMesh", - "kind": "member" - }, { "title": "Int16BufferAttribute", "kind": "class" @@ -4872,6 +5084,10 @@ "title": "LightingContextNode#lightingModel", "kind": "member" }, + { + "title": "LightingContextNode#materialLightings", + "kind": "member" + }, { "title": "LightingModel", "kind": "class" @@ -4908,6 +5124,10 @@ "title": "LightsNode", "kind": "class" }, + { + "title": "LightsNode#analyze", + "kind": "function" + }, { "title": "LightsNode#customCacheKey", "kind": "function" @@ -4944,6 +5164,10 @@ "title": "LightsNode#setupDirectLight", "kind": "function" }, + { + "title": "LightsNode#setupDirectRectAreaLight", + "kind": "function" + }, { "title": "LightsNode#setupLights", "kind": "function" @@ -5004,10 +5228,6 @@ "title": "Line2NodeMaterial#blending", "kind": "member" }, - { - "title": "Line2NodeMaterial#copy", - "kind": "function" - }, { "title": "Line2NodeMaterial#dashOffset", "kind": "member" @@ -5037,7 +5257,11 @@ "kind": "member" }, { - "title": "Line2NodeMaterial#setup", + "title": "Line2NodeMaterial#setupDiffuseColor", + "kind": "function" + }, + { + "title": "Line2NodeMaterial#setupModelViewProjection", "kind": "function" }, { @@ -5516,6 +5740,10 @@ "title": "Material#forceSinglePass", "kind": "member" }, + { + "title": "Material#fromJSON", + "kind": "function" + }, { "title": "Material#id", "kind": "member" @@ -5892,6 +6120,10 @@ "title": "Matrix4#determinant", "kind": "function" }, + { + "title": "Matrix4#determinantAffine", + "kind": "function" + }, { "title": "Matrix4#elements", "kind": "member" @@ -7248,30 +7480,6 @@ "title": "ModelNode#update", "kind": "function" }, - { - "title": "MorphNode", - "kind": "class" - }, - { - "title": "MorphNode#mesh", - "kind": "member" - }, - { - "title": "MorphNode#morphBaseInfluence", - "kind": "member" - }, - { - "title": "MorphNode#setup", - "kind": "function" - }, - { - "title": "MorphNode#update", - "kind": "function" - }, - { - "title": "MorphNode#updateType", - "kind": "member" - }, { "title": "Node", "kind": "class" @@ -7968,10 +8176,18 @@ "title": "NodeBuilder#globalCache", "kind": "member" }, + { + "title": "NodeBuilder#hardwareClipping", + "kind": "member" + }, { "title": "NodeBuilder#hasGeometryAttribute", "kind": "function" }, + { + "title": "NodeBuilder#hasWriteUsage", + "kind": "function" + }, { "title": "NodeBuilder#hashNodes", "kind": "member" @@ -7988,6 +8204,10 @@ "title": "NodeBuilder#isAvailable", "kind": "function" }, + { + "title": "NodeBuilder#isContextAssign", + "kind": "function" + }, { "title": "NodeBuilder#isDeterministic", "kind": "function" @@ -8456,10 +8676,6 @@ "title": "NodeMaterial#geometryNode", "kind": "member" }, - { - "title": "NodeMaterial#hardwareClipping", - "kind": "member" - }, { "title": "NodeMaterial#lights", "kind": "member" @@ -8512,6 +8728,10 @@ "title": "NodeMaterial#setup", "kind": "function" }, + { + "title": "NodeMaterial#setupAmbientOcclusion", + "kind": "function" + }, { "title": "NodeMaterial#setupClipping", "kind": "function" @@ -8549,7 +8769,7 @@ "kind": "function" }, { - "title": "NodeMaterial#setupLights", + "title": "NodeMaterial#setupMaterialLightings", "kind": "function" }, { @@ -9296,6 +9516,14 @@ "title": "OutputStructNode#members", "kind": "member" }, + { + "title": "OverrideContextNode", + "kind": "class" + }, + { + "title": "OverrideContextNode#getFlowContextData", + "kind": "function" + }, { "title": "PMREMGenerator", "kind": "class" @@ -9480,10 +9708,6 @@ "title": "PassNode#setMRT", "kind": "function" }, - { - "title": "PassNode#setPixelRatio", - "kind": "function" - }, { "title": "PassNode#setResolution", "kind": "function" @@ -10204,6 +10428,10 @@ "title": "PropertyNode#name", "kind": "member" }, + { + "title": "PropertyNode#placeholderNode", + "kind": "member" + }, { "title": "PropertyNode#varying", "kind": "member" @@ -10421,15 +10649,15 @@ "kind": "member" }, { - "title": "RTTNode#height", - "kind": "member" + "title": "RTTNode#getResolutionScale", + "kind": "function" }, { - "title": "RTTNode#node", + "title": "RTTNode#height", "kind": "member" }, { - "title": "RTTNode#pixelRatio", + "title": "RTTNode#node", "kind": "member" }, { @@ -10437,7 +10665,7 @@ "kind": "member" }, { - "title": "RTTNode#setPixelRatio", + "title": "RTTNode#setResolutionScale", "kind": "function" }, { @@ -11644,6 +11872,10 @@ "title": "ShaderMaterial#fragmentShader", "kind": "member" }, + { + "title": "ShaderMaterial#fromJSON", + "kind": "function" + }, { "title": "ShaderMaterial#glslVersion", "kind": "member" @@ -11948,10 +12180,6 @@ "title": "Skeleton#pose", "kind": "function" }, - { - "title": "Skeleton#previousBoneMatrices", - "kind": "member" - }, { "title": "Skeleton#toJSON", "kind": "function" @@ -12028,74 +12256,6 @@ "title": "SkinnedMesh#pose", "kind": "function" }, - { - "title": "SkinningNode", - "kind": "class" - }, - { - "title": "SkinningNode#bindMatrixInverseNode", - "kind": "member" - }, - { - "title": "SkinningNode#bindMatrixNode", - "kind": "member" - }, - { - "title": "SkinningNode#boneMatricesNode", - "kind": "member" - }, - { - "title": "SkinningNode#generate", - "kind": "function" - }, - { - "title": "SkinningNode#getPreviousSkinnedPosition", - "kind": "function" - }, - { - "title": "SkinningNode#getSkinnedNormalAndTangent", - "kind": "function" - }, - { - "title": "SkinningNode#getSkinnedPosition", - "kind": "function" - }, - { - "title": "SkinningNode#positionNode", - "kind": "member" - }, - { - "title": "SkinningNode#previousBoneMatricesNode", - "kind": "member" - }, - { - "title": "SkinningNode#setup", - "kind": "function" - }, - { - "title": "SkinningNode#skinIndexNode", - "kind": "member" - }, - { - "title": "SkinningNode#skinWeightNode", - "kind": "member" - }, - { - "title": "SkinningNode#skinnedMesh", - "kind": "member" - }, - { - "title": "SkinningNode#toPositionNode", - "kind": "member" - }, - { - "title": "SkinningNode#update", - "kind": "function" - }, - { - "title": "SkinningNode#updateType", - "kind": "member" - }, { "title": "Source", "kind": "class" @@ -12620,6 +12780,10 @@ "title": "StackTrace#stack", "kind": "member" }, + { + "title": "StandardNodeLibrary", + "kind": "class" + }, { "title": "StereoCamera", "kind": "class" @@ -13453,7 +13617,7 @@ "kind": "function" }, { - "title": "TimestampQueryPool#hasTimestamp", + "title": "TimestampQueryPool#hasTimestampQuery", "kind": "function" }, { @@ -16099,68 +16263,12 @@ "kind": "member" }, { - "title": "AnaglyphPassNode#setup", - "kind": "function" - }, - { - "title": "AnaglyphPassNode#updateStereoCamera", - "kind": "function" - }, - { - "title": "AnamorphicNode", - "kind": "class" - }, - { - "title": "AnamorphicNode#colorNode", - "kind": "member" - }, - { - "title": "AnamorphicNode#dispose", - "kind": "function" - }, - { - "title": "AnamorphicNode#getTextureNode", - "kind": "function" - }, - { - "title": "AnamorphicNode#resolution", - "kind": "member" - }, - { - "title": "AnamorphicNode#resolutionScale", - "kind": "member" - }, - { - "title": "AnamorphicNode#samples", - "kind": "member" - }, - { - "title": "AnamorphicNode#scaleNode", - "kind": "member" - }, - { - "title": "AnamorphicNode#setSize", - "kind": "function" - }, - { - "title": "AnamorphicNode#setup", - "kind": "function" - }, - { - "title": "AnamorphicNode#textureNode", - "kind": "member" - }, - { - "title": "AnamorphicNode#thresholdNode", - "kind": "member" - }, - { - "title": "AnamorphicNode#updateBefore", + "title": "AnaglyphPassNode#setup", "kind": "function" }, { - "title": "AnamorphicNode#updateBeforeType", - "kind": "member" + "title": "AnaglyphPassNode#updateStereoCamera", + "kind": "function" }, { "title": "AnimationClipCreator", @@ -16462,10 +16570,18 @@ "title": "BloomNode#dispose", "kind": "function" }, + { + "title": "BloomNode#getResolutionScale", + "kind": "function" + }, { "title": "BloomNode#getTextureNode", "kind": "function" }, + { + "title": "BloomNode#highPassFn", + "kind": "member" + }, { "title": "BloomNode#inputNode", "kind": "member" @@ -16474,6 +16590,10 @@ "title": "BloomNode#radius", "kind": "member" }, + { + "title": "BloomNode#setResolutionScale", + "kind": "function" + }, { "title": "BloomNode#setSize", "kind": "function" @@ -16998,6 +17118,10 @@ "title": "CinquefoilKnot#scale", "kind": "member" }, + { + "title": "CityGenerator", + "kind": "class" + }, { "title": "ClearMaskPass", "kind": "class" @@ -17166,6 +17290,10 @@ "title": "DRACOExporter#parse", "kind": "function" }, + { + "title": "DRACOExporter#parseAsync", + "kind": "function" + }, { "title": "DRACOLoader", "kind": "class" @@ -17642,6 +17770,18 @@ "title": "FXAAPass#setSize", "kind": "function" }, + { + "title": "FaceFrame", + "kind": "class" + }, + { + "title": "FaceFrame#bays", + "kind": "function" + }, + { + "title": "FaceFrame#matrix", + "kind": "function" + }, { "title": "FigureEightPolynomialKnot", "kind": "class" @@ -17706,6 +17846,10 @@ "title": "FirstPersonControls#constrainVertical", "kind": "member" }, + { + "title": "FirstPersonControls#dampingFactor", + "kind": "member" + }, { "title": "FirstPersonControls#handleResize", "kind": "function" @@ -17818,6 +17962,10 @@ "title": "FontLoader#parse", "kind": "function" }, + { + "title": "ForestGenerator", + "kind": "class" + }, { "title": "FullScreenQuad", "kind": "class" @@ -19022,6 +19170,14 @@ "title": "LineSegmentsGeometry#setPositions", "kind": "function" }, + { + "title": "LoftGeometry", + "kind": "class" + }, + { + "title": "LoftGeometry#parameters", + "kind": "member" + }, { "title": "LottieLoader", "kind": "class" @@ -21255,7 +21411,11 @@ "kind": "member" }, { - "title": "SSGINode#getTextureNode", + "title": "SSGINode#getAONode", + "kind": "function" + }, + { + "title": "SSGINode#getGINode", "kind": "function" }, { @@ -21862,6 +22022,10 @@ "title": "SharpenNode#updateBeforeType", "kind": "member" }, + { + "title": "SidewalkGenerator", + "kind": "class" + }, { "title": "SimplexNoise", "kind": "class" @@ -21946,6 +22110,10 @@ "title": "SkyMesh#upUniform", "kind": "member" }, + { + "title": "SkyscraperGenerator", + "kind": "class" + }, { "title": "SobelOperatorNode", "kind": "class" @@ -22238,6 +22406,10 @@ "title": "TeapotGeometry", "kind": "class" }, + { + "title": "TerrainGenerator", + "kind": "class" + }, { "title": "TessellateModifier", "kind": "class" @@ -22322,6 +22494,22 @@ "title": "ThreeMFLoader#parse", "kind": "function" }, + { + "title": "TileCreasedNormalsPlugin", + "kind": "class" + }, + { + "title": "TileCreasedNormalsPlugin#creaseAngle", + "kind": "member" + }, + { + "title": "TileCreasedNormalsPlugin#dispose", + "kind": "function" + }, + { + "title": "TileCreasedNormalsPlugin#processTileModel", + "kind": "function" + }, { "title": "TileShadowNode", "kind": "class" @@ -22378,26 +22566,6 @@ "title": "TileShadowNodeHelper#update", "kind": "function" }, - { - "title": "TiledLighting", - "kind": "class" - }, - { - "title": "TiledLighting#createNode", - "kind": "function" - }, - { - "title": "TiledLightsNode", - "kind": "class" - }, - { - "title": "TiledLightsNode#maxLights", - "kind": "member" - }, - { - "title": "TiledLightsNode#tileSize", - "kind": "member" - }, { "title": "TorusKnot", "kind": "class" @@ -22718,6 +22886,10 @@ "title": "Transpiler#parse", "kind": "function" }, + { + "title": "TreeGenerator", + "kind": "class" + }, { "title": "TreesGeometry", "kind": "class" @@ -23062,6 +23234,10 @@ "title": "ViewHelper#animating", "kind": "member" }, + { + "title": "ViewHelper#camera", + "kind": "member" + }, { "title": "ViewHelper#center", "kind": "member" @@ -23854,6 +24030,10 @@ "title": "module-GeometryUtils~hilbert3D", "kind": "function" }, + { + "title": "module-GroundedSkybox", + "kind": "module" + }, { "title": "module-HalftoneShader", "kind": "module" @@ -24896,6 +25076,10 @@ "title": "MaterialLoader.createMaterialFromType", "kind": "function" }, + { + "title": "MaterialLoader.registerMaterial", + "kind": "function" + }, { "title": "MathUtils.ceilPowerOfTwo", "kind": "function" @@ -25176,6 +25360,10 @@ "title": "OneMinusSrcColorFactor", "kind": "member" }, + { + "title": "OverrideContextNode.type", + "kind": "member" + }, { "title": "PCFShadowFilter", "kind": "function" @@ -25808,14 +25996,50 @@ "title": "_shaderModuleDescriptor.label", "kind": "member" }, + { + "title": "addArcade", + "kind": "function" + }, + { + "title": "addCornice", + "kind": "function" + }, + { + "title": "addParapet", + "kind": "function" + }, + { + "title": "addSpandrelBands", + "kind": "function" + }, + { + "title": "bakeGroups", + "kind": "function" + }, + { + "title": "batchColor", + "kind": "member" + }, { "title": "buildData3DTexture", "kind": "function" }, + { + "title": "buildFaces", + "kind": "function" + }, + { + "title": "buildFootprint", + "kind": "function" + }, { "title": "buildMesh", "kind": "function" }, + { + "title": "buildingPalette", + "kind": "member" + }, { "title": "ceilPowerOfTwo", "kind": "function" @@ -25824,6 +26048,10 @@ "title": "clamp", "kind": "function" }, + { + "title": "closestLineToLine", + "kind": "member" + }, { "title": "contain", "kind": "function" @@ -25836,6 +26064,10 @@ "title": "cover", "kind": "function" }, + { + "title": "createBuildingMaterial", + "kind": "function" + }, { "title": "createCanvasElement", "kind": "function" @@ -25844,6 +26076,26 @@ "title": "createEvent", "kind": "function" }, + { + "title": "createForestMaterial", + "kind": "function" + }, + { + "title": "createInstanceMatrixNode", + "kind": "function" + }, + { + "title": "createRoadMaterial", + "kind": "function" + }, + { + "title": "createSkyscraperMaterial", + "kind": "function" + }, + { + "title": "createTreeMaterial", + "kind": "function" + }, { "title": "damp", "kind": "function" @@ -25904,6 +26156,10 @@ "title": "generateUUID", "kind": "function" }, + { + "title": "getBatchingColor", + "kind": "member" + }, { "title": "getByteLength", "kind": "function" @@ -25924,6 +26180,10 @@ "title": "getElementsByTagName", "kind": "function" }, + { + "title": "getEntry", + "kind": "function" + }, { "title": "getFilteredStack", "kind": "function" @@ -25936,6 +26196,10 @@ "title": "getFormat", "kind": "function" }, + { + "title": "getIndirectIndex", + "kind": "member" + }, { "title": "getKeyframeOrder", "kind": "function" @@ -25944,6 +26208,26 @@ "title": "getMembersLayout", "kind": "function" }, + { + "title": "getMorph", + "kind": "member" + }, + { + "title": "getPreviousInstance", + "kind": "function" + }, + { + "title": "getPreviousSkinnedPosition", + "kind": "function" + }, + { + "title": "getSkinnedNormalAndTangent", + "kind": "function" + }, + { + "title": "getSkinnedPosition", + "kind": "function" + }, { "title": "getStrideLength", "kind": "function" @@ -25964,6 +26248,10 @@ "title": "getViewZNode", "kind": "function" }, + { + "title": "instanceColor", + "kind": "member" + }, { "title": "inverseLerp", "kind": "function" @@ -25980,6 +26268,10 @@ "title": "lerp", "kind": "function" }, + { + "title": "lineDistance", + "kind": "member" + }, { "title": "log", "kind": "function" @@ -26048,6 +26340,14 @@ "title": "normalize", "kind": "function" }, + { + "title": "outgoingLight", + "kind": "member" + }, + { + "title": "pickBuildingColor", + "kind": "function" + }, { "title": "pingpong", "kind": "function" @@ -26096,6 +26396,10 @@ "title": "shadowRenderObjectFunction", "kind": "function" }, + { + "title": "slab", + "kind": "function" + }, { "title": "smootherstep", "kind": "function" @@ -26116,6 +26420,18 @@ "title": "toHalfFloat", "kind": "function" }, + { + "title": "totalDiffuse", + "kind": "member" + }, + { + "title": "totalSpecular", + "kind": "member" + }, + { + "title": "trimSegmentAlpha", + "kind": "member" + }, { "title": "updateCamera", "kind": "function" @@ -26136,6 +26452,18 @@ "title": "warnOnce", "kind": "function" }, + { + "title": "worldEnd", + "kind": "member" + }, + { + "title": "worldPos", + "kind": "member" + }, + { + "title": "worldStart", + "kind": "member" + }, { "title": "yieldToMain", "kind": "function" @@ -26242,16 +26570,20 @@ "title": "all", "kind": "function" }, + { + "title": "alphaLine", + "kind": "member" + }, { "title": "alphaT", "kind": "member" }, { - "title": "anaglyphPass", - "kind": "function" + "title": "ambientOcclusion", + "kind": "member" }, { - "title": "anamorphic", + "title": "anaglyphPass", "kind": "function" }, { @@ -26578,10 +26910,6 @@ "title": "circle", "kind": "function" }, - { - "title": "circleIntersectsAABB", - "kind": "function" - }, { "title": "clamp", "kind": "function" @@ -26698,6 +27026,10 @@ "title": "cubeTextureBase", "kind": "function" }, + { + "title": "curlNoise", + "kind": "function" + }, { "title": "dFdx", "kind": "function" @@ -26772,7 +27104,7 @@ }, { "title": "directionToFaceDirection", - "kind": "member" + "kind": "function" }, { "title": "dispersion", @@ -26818,6 +27150,10 @@ "title": "equal", "kind": "function" }, + { + "title": "equirectDirection", + "kind": "function" + }, { "title": "equirectUV", "kind": "function" @@ -27398,6 +27734,10 @@ "title": "module-Bayer.bayerDither", "kind": "function" }, + { + "title": "module-GroundedSkybox.getGroundProjectedNormal", + "kind": "function" + }, { "title": "module-Raymarching.RaymarchingBox", "kind": "function" @@ -27418,10 +27758,18 @@ "title": "mul", "kind": "function" }, + { + "title": "mvpLine", + "kind": "member" + }, { "title": "negate", "kind": "function" }, + { + "title": "negateOnBackSide", + "kind": "function" + }, { "title": "neutralToneMapping", "kind": "function" @@ -27546,10 +27894,22 @@ "title": "overloadingFn", "kind": "function" }, + { + "title": "overrideNode", + "kind": "function" + }, + { + "title": "overrideNodes", + "kind": "function" + }, { "title": "packHalf2x16", "kind": "function" }, + { + "title": "packNormalToRGB", + "kind": "function" + }, { "title": "packSnorm2x16", "kind": "function" @@ -27590,6 +27950,10 @@ "title": "pcurve", "kind": "function" }, + { + "title": "permute", + "kind": "function" + }, { "title": "perspectiveDepthToViewZ", "kind": "function" @@ -27942,6 +28306,14 @@ "title": "smoothstepElement", "kind": "function" }, + { + "title": "snoise", + "kind": "function" + }, + { + "title": "snoiseVec3", + "kind": "function" + }, { "title": "sobel", "kind": "function" @@ -28206,10 +28578,6 @@ "title": "thickness", "kind": "member" }, - { - "title": "tiledLights", - "kind": "function" - }, { "title": "time", "kind": "member" @@ -28238,6 +28606,14 @@ "title": "transformNormal", "kind": "function" }, + { + "title": "transformNormalByInverseViewMatrix", + "kind": "function" + }, + { + "title": "transformNormalByViewMatrix", + "kind": "function" + }, { "title": "transformNormalToView", "kind": "function" @@ -28318,6 +28694,10 @@ "title": "unpackNormal", "kind": "function" }, + { + "title": "unpackRGBToNormal", + "kind": "function" + }, { "title": "unpackSnorm2x16", "kind": "function" From c1889da3c4fe9f3828fa90786d6a8772252ba966 Mon Sep 17 00:00:00 2001 From: sunag Date: Wed, 24 Jun 2026 11:58:46 -0300 Subject: [PATCH 10/10] Inspector: Fix Timeline resize --- examples/jsm/inspector/tabs/Timeline.js | 15 +++++++++++++-- examples/jsm/inspector/ui/Profiler.js | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/examples/jsm/inspector/tabs/Timeline.js b/examples/jsm/inspector/tabs/Timeline.js index e110f5491c7134..b2a3ee93aab18b 100644 --- a/examples/jsm/inspector/tabs/Timeline.js +++ b/examples/jsm/inspector/tabs/Timeline.js @@ -63,7 +63,7 @@ class Timeline extends Tab { // Bind window resize to update graph bounds window.addEventListener( 'resize', () => { - if ( ! this.isRecording && this.frames.length > 0 ) { + if ( this.isActive && ! this.isRecording && this.frames.length > 0 ) { this.renderSlider(); @@ -79,7 +79,7 @@ class Timeline extends Tab { this.profiler.addEventListener( 'resize', () => { - if ( ! this.isRecording && this.frames.length > 0 ) { + if ( this.isActive && ! this.isRecording && this.frames.length > 0 ) { this.renderSlider(); @@ -89,6 +89,17 @@ class Timeline extends Tab { } + setActive( isActive ) { + + super.setActive( isActive ); + + if ( isActive && ! this.isRecording && this.frames.length > 0 ) { + + this.renderSlider(); + + } + + } buildHeader() { diff --git a/examples/jsm/inspector/ui/Profiler.js b/examples/jsm/inspector/ui/Profiler.js index bbc58f11c4ab50..5843ff6362ae8a 100644 --- a/examples/jsm/inspector/ui/Profiler.js +++ b/examples/jsm/inspector/ui/Profiler.js @@ -1530,6 +1530,8 @@ export class Profiler extends EventDispatcher { } + this.dispatchEvent( { type: 'resize' } ); + }; const onResizeEnd = () => { @@ -1686,8 +1688,6 @@ export class Profiler extends EventDispatcher { } - - this.dispatchEvent( { type: 'resize' } ); this.saveLayout();