diff --git a/src/Three.TSL.js b/src/Three.TSL.js index 07fd8ff155a309..6264204b519a59 100644 --- a/src/Three.TSL.js +++ b/src/Three.TSL.js @@ -228,7 +228,7 @@ export const mat2 = TSL.mat2; export const mat3 = TSL.mat3; export const mat4 = TSL.mat4; export const matcapUV = TSL.matcapUV; -export const materialAOMap = TSL.materialAOMap; +export const materialAO = TSL.materialAO; export const materialAlphaTest = TSL.materialAlphaTest; export const materialAnisotropy = TSL.materialAnisotropy; export const materialAnisotropyVector = TSL.materialAnisotropyVector; @@ -410,7 +410,7 @@ export const select = TSL.select; export const setCurrentStack = TSL.setCurrentStack; export const shaderStages = TSL.shaderStages; export const shadow = TSL.shadow; -export const shadowWorldPosition = TSL.shadowWorldPosition; +export const shadowPositionWorld = TSL.shadowPositionWorld; export const sharedUniformGroup = TSL.sharedUniformGroup; export const sheen = TSL.sheen; export const sheenRoughness = TSL.sheenRoughness; diff --git a/src/materials/nodes/NodeMaterial.js b/src/materials/nodes/NodeMaterial.js index cd8ccbd8224bc1..4063f968842dd3 100644 --- a/src/materials/nodes/NodeMaterial.js +++ b/src/materials/nodes/NodeMaterial.js @@ -4,7 +4,7 @@ import { NormalBlending } from '../../constants.js'; import { getNodeChildren, getCacheKey } from '../../nodes/core/NodeUtils.js'; import { attribute } from '../../nodes/core/AttributeNode.js'; import { output, diffuseColor, emissive, varyingProperty } from '../../nodes/core/PropertyNode.js'; -import { materialAlphaTest, materialColor, materialOpacity, materialEmissive, materialNormal, materialLightMap, materialAOMap } from '../../nodes/accessors/MaterialNode.js'; +import { materialAlphaTest, materialColor, materialOpacity, materialEmissive, materialNormal, materialLightMap, materialAO } from '../../nodes/accessors/MaterialNode.js'; import { modelViewProjection } from '../../nodes/accessors/ModelViewProjectionNode.js'; import { normalLocal } from '../../nodes/accessors/Normal.js'; import { instancedMesh } from '../../nodes/accessors/InstancedMeshNode.js'; @@ -912,7 +912,7 @@ class NodeMaterial extends Material { if ( this.aoNode !== null || builder.material.aoMap ) { - const aoNode = this.aoNode !== null ? this.aoNode : materialAOMap; + const aoNode = this.aoNode !== null ? this.aoNode : materialAO; materialLightsNode.push( new AONode( aoNode ) ); diff --git a/src/nodes/accessors/MaterialNode.js b/src/nodes/accessors/MaterialNode.js index d7a4a19813993d..a7a880911f57ec 100644 --- a/src/nodes/accessors/MaterialNode.js +++ b/src/nodes/accessors/MaterialNode.js @@ -384,7 +384,7 @@ class MaterialNode extends Node { node = this.getTexture( scope ).rgb.mul( this.getFloat( 'lightMapIntensity' ) ); - } else if ( scope === MaterialNode.AO_MAP ) { + } else if ( scope === MaterialNode.AO ) { node = this.getTexture( scope ).r.sub( 1.0 ).mul( this.getFloat( 'aoMapIntensity' ) ).add( 1.0 ); @@ -438,7 +438,7 @@ MaterialNode.LINE_DASH_OFFSET = 'dashOffset'; MaterialNode.POINT_WIDTH = 'pointWidth'; MaterialNode.DISPERSION = 'dispersion'; MaterialNode.LIGHT_MAP = 'light'; -MaterialNode.AO_MAP = 'ao'; +MaterialNode.AO = 'ao'; export default MaterialNode; @@ -717,7 +717,7 @@ export const materialLightMap = /*@__PURE__*/ nodeImmutable( MaterialNode, Mater * * @type {Node} */ -export const materialAOMap = /*@__PURE__*/ nodeImmutable( MaterialNode, MaterialNode.AO_MAP ); +export const materialAO = /*@__PURE__*/ nodeImmutable( MaterialNode, MaterialNode.AO ); /** * TSL object that represents the anisotropy vector of the current material. diff --git a/src/nodes/lighting/ShadowBaseNode.js b/src/nodes/lighting/ShadowBaseNode.js index 04f8aaa034c9c1..4b3a5b894ab75f 100644 --- a/src/nodes/lighting/ShadowBaseNode.js +++ b/src/nodes/lighting/ShadowBaseNode.js @@ -58,7 +58,7 @@ class ShadowBaseNode extends Node { } /** - * Setups the shadow position node which is by default the predefined TSL node object `shadowWorldPosition`. + * Setups the shadow position node which is by default the predefined TSL node object `shadowPositionWorld`. * * @param {(NodeBuilder|{Material})} object - A configuration object that must at least hold a material reference. */ @@ -66,7 +66,7 @@ class ShadowBaseNode extends Node { // Use assign inside an Fn() - shadowWorldPosition.assign( material.shadowPositionNode || positionWorld ); + shadowPositionWorld.assign( material.shadowPositionNode || positionWorld ); } @@ -88,6 +88,6 @@ class ShadowBaseNode extends Node { * * @type {Node} */ -export const shadowWorldPosition = /*@__PURE__*/ vec3().toVar( 'shadowWorldPosition' ); +export const shadowPositionWorld = /*@__PURE__*/ vec3().toVar( 'shadowPositionWorld' ); export default ShadowBaseNode; diff --git a/src/nodes/lighting/ShadowNode.js b/src/nodes/lighting/ShadowNode.js index 922c04e289fb86..5d6851dcc46c22 100644 --- a/src/nodes/lighting/ShadowNode.js +++ b/src/nodes/lighting/ShadowNode.js @@ -1,4 +1,4 @@ -import ShadowBaseNode, { shadowWorldPosition } from './ShadowBaseNode.js'; +import ShadowBaseNode, { shadowPositionWorld } from './ShadowBaseNode.js'; import { float, vec2, vec3, vec4, If, int, Fn, nodeObject } from '../tsl/TSLBase.js'; import { reference } from '../accessors/ReferenceNode.js'; import { texture } from '../accessors/TextureNode.js'; @@ -548,7 +548,7 @@ class ShadowNode extends ShadowBaseNode { const shadowIntensity = reference( 'intensity', 'float', shadow ).setGroup( renderGroup ); const normalBias = reference( 'normalBias', 'float', shadow ).setGroup( renderGroup ); - const shadowPosition = lightShadowMatrix( light ).mul( shadowWorldPosition.add( transformedNormalWorld.mul( normalBias ) ) ); + const shadowPosition = lightShadowMatrix( light ).mul( shadowPositionWorld.add( transformedNormalWorld.mul( normalBias ) ) ); const shadowCoord = this.setupShadowCoord( builder, shadowPosition ); //