Skip to content

Commit 74b7a6f

Browse files
authored
TSL: More consistent names shadowPositionWorld, materialAO (#30152)
* Rename `materialAOMap` -> `materialAO` * Rename `shadowWorldPosition` -> `shadowPositionWorld` * rename shadowPositionWorld
1 parent fd53a1f commit 74b7a6f

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

src/Three.TSL.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export const mat2 = TSL.mat2;
228228
export const mat3 = TSL.mat3;
229229
export const mat4 = TSL.mat4;
230230
export const matcapUV = TSL.matcapUV;
231-
export const materialAOMap = TSL.materialAOMap;
231+
export const materialAO = TSL.materialAO;
232232
export const materialAlphaTest = TSL.materialAlphaTest;
233233
export const materialAnisotropy = TSL.materialAnisotropy;
234234
export const materialAnisotropyVector = TSL.materialAnisotropyVector;
@@ -410,7 +410,7 @@ export const select = TSL.select;
410410
export const setCurrentStack = TSL.setCurrentStack;
411411
export const shaderStages = TSL.shaderStages;
412412
export const shadow = TSL.shadow;
413-
export const shadowWorldPosition = TSL.shadowWorldPosition;
413+
export const shadowPositionWorld = TSL.shadowPositionWorld;
414414
export const sharedUniformGroup = TSL.sharedUniformGroup;
415415
export const sheen = TSL.sheen;
416416
export const sheenRoughness = TSL.sheenRoughness;

src/materials/nodes/NodeMaterial.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { NormalBlending } from '../../constants.js';
44
import { getNodeChildren, getCacheKey } from '../../nodes/core/NodeUtils.js';
55
import { attribute } from '../../nodes/core/AttributeNode.js';
66
import { output, diffuseColor, emissive, varyingProperty } from '../../nodes/core/PropertyNode.js';
7-
import { materialAlphaTest, materialColor, materialOpacity, materialEmissive, materialNormal, materialLightMap, materialAOMap } from '../../nodes/accessors/MaterialNode.js';
7+
import { materialAlphaTest, materialColor, materialOpacity, materialEmissive, materialNormal, materialLightMap, materialAO } from '../../nodes/accessors/MaterialNode.js';
88
import { modelViewProjection } from '../../nodes/accessors/ModelViewProjectionNode.js';
99
import { normalLocal } from '../../nodes/accessors/Normal.js';
1010
import { instancedMesh } from '../../nodes/accessors/InstancedMeshNode.js';
@@ -912,7 +912,7 @@ class NodeMaterial extends Material {
912912

913913
if ( this.aoNode !== null || builder.material.aoMap ) {
914914

915-
const aoNode = this.aoNode !== null ? this.aoNode : materialAOMap;
915+
const aoNode = this.aoNode !== null ? this.aoNode : materialAO;
916916

917917
materialLightsNode.push( new AONode( aoNode ) );
918918

src/nodes/accessors/MaterialNode.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ class MaterialNode extends Node {
384384

385385
node = this.getTexture( scope ).rgb.mul( this.getFloat( 'lightMapIntensity' ) );
386386

387-
} else if ( scope === MaterialNode.AO_MAP ) {
387+
} else if ( scope === MaterialNode.AO ) {
388388

389389
node = this.getTexture( scope ).r.sub( 1.0 ).mul( this.getFloat( 'aoMapIntensity' ) ).add( 1.0 );
390390

@@ -438,7 +438,7 @@ MaterialNode.LINE_DASH_OFFSET = 'dashOffset';
438438
MaterialNode.POINT_WIDTH = 'pointWidth';
439439
MaterialNode.DISPERSION = 'dispersion';
440440
MaterialNode.LIGHT_MAP = 'light';
441-
MaterialNode.AO_MAP = 'ao';
441+
MaterialNode.AO = 'ao';
442442

443443
export default MaterialNode;
444444

@@ -717,7 +717,7 @@ export const materialLightMap = /*@__PURE__*/ nodeImmutable( MaterialNode, Mater
717717
*
718718
* @type {Node<float>}
719719
*/
720-
export const materialAOMap = /*@__PURE__*/ nodeImmutable( MaterialNode, MaterialNode.AO_MAP );
720+
export const materialAO = /*@__PURE__*/ nodeImmutable( MaterialNode, MaterialNode.AO );
721721

722722
/**
723723
* TSL object that represents the anisotropy vector of the current material.

src/nodes/lighting/ShadowBaseNode.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ class ShadowBaseNode extends Node {
5858
}
5959

6060
/**
61-
* Setups the shadow position node which is by default the predefined TSL node object `shadowWorldPosition`.
61+
* Setups the shadow position node which is by default the predefined TSL node object `shadowPositionWorld`.
6262
*
6363
* @param {(NodeBuilder|{Material})} object - A configuration object that must at least hold a material reference.
6464
*/
6565
setupShadowPosition( { material } ) {
6666

6767
// Use assign inside an Fn()
6868

69-
shadowWorldPosition.assign( material.shadowPositionNode || positionWorld );
69+
shadowPositionWorld.assign( material.shadowPositionNode || positionWorld );
7070

7171
}
7272

@@ -88,6 +88,6 @@ class ShadowBaseNode extends Node {
8888
*
8989
* @type {Node<vec3>}
9090
*/
91-
export const shadowWorldPosition = /*@__PURE__*/ vec3().toVar( 'shadowWorldPosition' );
91+
export const shadowPositionWorld = /*@__PURE__*/ vec3().toVar( 'shadowPositionWorld' );
9292

9393
export default ShadowBaseNode;

src/nodes/lighting/ShadowNode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ShadowBaseNode, { shadowWorldPosition } from './ShadowBaseNode.js';
1+
import ShadowBaseNode, { shadowPositionWorld } from './ShadowBaseNode.js';
22
import { float, vec2, vec3, vec4, If, int, Fn, nodeObject } from '../tsl/TSLBase.js';
33
import { reference } from '../accessors/ReferenceNode.js';
44
import { texture } from '../accessors/TextureNode.js';
@@ -548,7 +548,7 @@ class ShadowNode extends ShadowBaseNode {
548548
const shadowIntensity = reference( 'intensity', 'float', shadow ).setGroup( renderGroup );
549549
const normalBias = reference( 'normalBias', 'float', shadow ).setGroup( renderGroup );
550550

551-
const shadowPosition = lightShadowMatrix( light ).mul( shadowWorldPosition.add( transformedNormalWorld.mul( normalBias ) ) );
551+
const shadowPosition = lightShadowMatrix( light ).mul( shadowPositionWorld.add( transformedNormalWorld.mul( normalBias ) ) );
552552
const shadowCoord = this.setupShadowCoord( builder, shadowPosition );
553553

554554
//

0 commit comments

Comments
 (0)