浏览代码

Core: Clean up. (#28891)

Michael Herzog 1 年之前
父节点
当前提交
dd9f4c1c1e
共有 34 个文件被更改,包括 93 次插入92 次删除
  1. 18 18
      src/nodes/accessors/MorphNode.js
  2. 2 2
      src/nodes/display/AfterImageNode.js
  3. 3 3
      src/nodes/display/AnamorphicNode.js
  4. 3 3
      src/nodes/display/GTAONode.js
  5. 6 6
      src/nodes/display/GaussianBlurNode.js
  6. 1 1
      src/nodes/display/PassNode.js
  7. 1 1
      src/nodes/display/ViewportTextureNode.js
  8. 3 3
      src/nodes/lighting/EnvironmentNode.js
  9. 2 2
      src/nodes/lighting/RectAreaLightNode.js
  10. 2 2
      src/nodes/materials/InstancedPointsNodeMaterial.js
  11. 2 2
      src/nodes/materials/Line2NodeMaterial.js
  12. 2 2
      src/nodes/materials/LineBasicNodeMaterial.js
  13. 2 2
      src/nodes/materials/LineDashedNodeMaterial.js
  14. 2 2
      src/nodes/materials/MeshBasicNodeMaterial.js
  15. 2 2
      src/nodes/materials/MeshLambertNodeMaterial.js
  16. 2 2
      src/nodes/materials/MeshMatcapNodeMaterial.js
  17. 2 2
      src/nodes/materials/MeshNormalNodeMaterial.js
  18. 2 2
      src/nodes/materials/MeshPhongNodeMaterial.js
  19. 2 2
      src/nodes/materials/MeshPhysicalNodeMaterial.js
  20. 2 2
      src/nodes/materials/MeshStandardNodeMaterial.js
  21. 2 2
      src/nodes/materials/MeshToonNodeMaterial.js
  22. 2 2
      src/nodes/materials/PointsNodeMaterial.js
  23. 2 2
      src/nodes/materials/ShadowNodeMaterial.js
  24. 2 2
      src/nodes/materials/SpriteNodeMaterial.js
  25. 1 1
      src/nodes/utils/RTTNode.js
  26. 1 1
      src/renderers/common/Background.js
  27. 1 1
      src/renderers/common/ClippingContext.js
  28. 6 5
      src/renderers/common/PostProcessing.js
  29. 2 2
      src/renderers/common/QuadMesh.js
  30. 2 2
      src/renderers/common/RenderObject.js
  31. 6 6
      src/renderers/common/Renderer.js
  32. 2 2
      src/renderers/common/SampledTexture.js
  33. 1 1
      src/renderers/common/Textures.js
  34. 2 2
      src/renderers/common/nodes/NodeUniformsGroup.js

+ 18 - 18
src/nodes/accessors/MorphNode.js

@@ -15,8 +15,8 @@ import { Vector2 } from '../../math/Vector2.js';
 import { Vector4 } from '../../math/Vector4.js';
 import { Vector4 } from '../../math/Vector4.js';
 import { FloatType } from '../../constants.js';
 import { FloatType } from '../../constants.js';
 
 
-const morphTextures = new WeakMap();
-const morphVec4 = new Vector4();
+const _morphTextures = new WeakMap();
+const _morphVec4 = /*@__PURE__*/ new Vector4();
 
 
 const getMorph = tslFn( ( { bufferMap, influence, stride, width, depth, offset } ) => {
 const getMorph = tslFn( ( { bufferMap, influence, stride, width, depth, offset } ) => {
 
 
@@ -43,7 +43,7 @@ function getEntry( geometry ) {
 	const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;
 	const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;
 	const morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;
 	const morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;
 
 
-	let entry = morphTextures.get( geometry );
+	let entry = _morphTextures.get( geometry );
 
 
 	if ( entry === undefined || entry.count !== morphTargetsCount ) {
 	if ( entry === undefined || entry.count !== morphTargetsCount ) {
 
 
@@ -95,34 +95,34 @@ function getEntry( geometry ) {
 
 
 				if ( hasMorphPosition === true ) {
 				if ( hasMorphPosition === true ) {
 
 
-					morphVec4.fromBufferAttribute( morphTarget, j );
+					_morphVec4.fromBufferAttribute( morphTarget, j );
 
 
-					buffer[ offset + stride + 0 ] = morphVec4.x;
-					buffer[ offset + stride + 1 ] = morphVec4.y;
-					buffer[ offset + stride + 2 ] = morphVec4.z;
+					buffer[ offset + stride + 0 ] = _morphVec4.x;
+					buffer[ offset + stride + 1 ] = _morphVec4.y;
+					buffer[ offset + stride + 2 ] = _morphVec4.z;
 					buffer[ offset + stride + 3 ] = 0;
 					buffer[ offset + stride + 3 ] = 0;
 
 
 				}
 				}
 
 
 				if ( hasMorphNormals === true ) {
 				if ( hasMorphNormals === true ) {
 
 
-					morphVec4.fromBufferAttribute( morphNormal, j );
+					_morphVec4.fromBufferAttribute( morphNormal, j );
 
 
-					buffer[ offset + stride + 4 ] = morphVec4.x;
-					buffer[ offset + stride + 5 ] = morphVec4.y;
-					buffer[ offset + stride + 6 ] = morphVec4.z;
+					buffer[ offset + stride + 4 ] = _morphVec4.x;
+					buffer[ offset + stride + 5 ] = _morphVec4.y;
+					buffer[ offset + stride + 6 ] = _morphVec4.z;
 					buffer[ offset + stride + 7 ] = 0;
 					buffer[ offset + stride + 7 ] = 0;
 
 
 				}
 				}
 
 
 				if ( hasMorphColors === true ) {
 				if ( hasMorphColors === true ) {
 
 
-					morphVec4.fromBufferAttribute( morphColor, j );
+					_morphVec4.fromBufferAttribute( morphColor, j );
 
 
-					buffer[ offset + stride + 8 ] = morphVec4.x;
-					buffer[ offset + stride + 9 ] = morphVec4.y;
-					buffer[ offset + stride + 10 ] = morphVec4.z;
-					buffer[ offset + stride + 11 ] = ( morphColor.itemSize === 4 ) ? morphVec4.w : 1;
+					buffer[ offset + stride + 8 ] = _morphVec4.x;
+					buffer[ offset + stride + 9 ] = _morphVec4.y;
+					buffer[ offset + stride + 10 ] = _morphVec4.z;
+					buffer[ offset + stride + 11 ] = ( morphColor.itemSize === 4 ) ? _morphVec4.w : 1;
 
 
 				}
 				}
 
 
@@ -137,13 +137,13 @@ function getEntry( geometry ) {
 			size: new Vector2( width, height )
 			size: new Vector2( width, height )
 		};
 		};
 
 
-		morphTextures.set( geometry, entry );
+		_morphTextures.set( geometry, entry );
 
 
 		function disposeTexture() {
 		function disposeTexture() {
 
 
 			bufferTexture.dispose();
 			bufferTexture.dispose();
 
 
-			morphTextures.delete( geometry );
+			_morphTextures.delete( geometry );
 
 
 			geometry.removeEventListener( 'dispose', disposeTexture );
 			geometry.removeEventListener( 'dispose', disposeTexture );
 
 

+ 2 - 2
src/nodes/display/AfterImageNode.js

@@ -11,9 +11,9 @@ import QuadMesh from '../../renderers/common/QuadMesh.js';
 import { Vector2 } from '../../math/Vector2.js';
 import { Vector2 } from '../../math/Vector2.js';
 import { RenderTarget } from '../../core/RenderTarget.js';
 import { RenderTarget } from '../../core/RenderTarget.js';
 
 
-const _size = new Vector2();
+const _size = /*@__PURE__*/ new Vector2();
 
 
-const quadMeshComp = new QuadMesh();
+const quadMeshComp = /*@__PURE__*/ new QuadMesh();
 
 
 class AfterImageNode extends TempNode {
 class AfterImageNode extends TempNode {
 
 

+ 3 - 3
src/nodes/display/AnamorphicNode.js

@@ -11,7 +11,7 @@ import QuadMesh from '../../renderers/common/QuadMesh.js';
 import { Vector2 } from '../../math/Vector2.js';
 import { Vector2 } from '../../math/Vector2.js';
 import { RenderTarget } from '../../core/RenderTarget.js';
 import { RenderTarget } from '../../core/RenderTarget.js';
 
 
-const quadMesh = new QuadMesh();
+const _quadMesh = /*@__PURE__*/ new QuadMesh();
 
 
 class AnamorphicNode extends TempNode {
 class AnamorphicNode extends TempNode {
 
 
@@ -66,7 +66,7 @@ class AnamorphicNode extends TempNode {
 		const currentRenderTarget = renderer.getRenderTarget();
 		const currentRenderTarget = renderer.getRenderTarget();
 		const currentTexture = textureNode.value;
 		const currentTexture = textureNode.value;
 
 
-		quadMesh.material = this._material;
+		_quadMesh.material = this._material;
 
 
 		this.setSize( map.image.width, map.image.height );
 		this.setSize( map.image.width, map.image.height );
 
 
@@ -74,7 +74,7 @@ class AnamorphicNode extends TempNode {
 
 
 		renderer.setRenderTarget( this._renderTarget );
 		renderer.setRenderTarget( this._renderTarget );
 
 
-		quadMesh.render( renderer );
+		_quadMesh.render( renderer );
 
 
 		// restore
 		// restore
 
 

+ 3 - 3
src/nodes/display/GTAONode.js

@@ -17,9 +17,9 @@ import QuadMesh from '../../renderers/common/QuadMesh.js';
 import { RenderTarget } from '../../core/RenderTarget.js';
 import { RenderTarget } from '../../core/RenderTarget.js';
 import { Color } from '../../math/Color.js';
 import { Color } from '../../math/Color.js';
 
 
-const _quadMesh = new QuadMesh();
-const _currentClearColor = new Color();
-const _size = new Vector2();
+const _quadMesh = /*@__PURE__*/ new QuadMesh();
+const _currentClearColor = /*@__PURE__*/ new Color();
+const _size = /*@__PURE__*/ new Vector2();
 
 
 class GTAONode extends TempNode {
 class GTAONode extends TempNode {
 
 

+ 6 - 6
src/nodes/display/GaussianBlurNode.js

@@ -13,8 +13,8 @@ import { RenderTarget } from '../../core/RenderTarget.js';
 // WebGPU: The use of a single QuadMesh for both gaussian blur passes results in a single RenderObject with a SampledTexture binding that
 // WebGPU: The use of a single QuadMesh for both gaussian blur passes results in a single RenderObject with a SampledTexture binding that
 // alternates between source textures and triggers creation of new BindGroups and BindGroupLayouts every frame.
 // alternates between source textures and triggers creation of new BindGroups and BindGroupLayouts every frame.
 
 
-const quadMesh1 = new QuadMesh();
-const quadMesh2 = new QuadMesh();
+const _quadMesh1 = /*@__PURE__*/ new QuadMesh();
+const _quadMesh2 = /*@__PURE__*/ new QuadMesh();
 
 
 class GaussianBlurNode extends TempNode {
 class GaussianBlurNode extends TempNode {
 
 
@@ -65,8 +65,8 @@ class GaussianBlurNode extends TempNode {
 
 
 		const currentTexture = textureNode.value;
 		const currentTexture = textureNode.value;
 
 
-		quadMesh1.material = this._material;
-		quadMesh2.material = this._material;
+		_quadMesh1.material = this._material;
+		_quadMesh2.material = this._material;
 
 
 		this.setSize( map.image.width, map.image.height );
 		this.setSize( map.image.width, map.image.height );
 
 
@@ -85,7 +85,7 @@ class GaussianBlurNode extends TempNode {
 
 
 		this._passDirection.value.set( 1, 0 );
 		this._passDirection.value.set( 1, 0 );
 
 
-		quadMesh1.render( renderer );
+		_quadMesh1.render( renderer );
 
 
 		// vertical
 		// vertical
 
 
@@ -94,7 +94,7 @@ class GaussianBlurNode extends TempNode {
 
 
 		this._passDirection.value.set( 0, 1 );
 		this._passDirection.value.set( 0, 1 );
 
 
-		quadMesh2.render( renderer );
+		_quadMesh2.render( renderer );
 
 
 		// restore
 		// restore
 
 

+ 1 - 1
src/nodes/display/PassNode.js

@@ -11,7 +11,7 @@ import { Vector2 } from '../../math/Vector2.js';
 import { DepthTexture } from '../../textures/DepthTexture.js';
 import { DepthTexture } from '../../textures/DepthTexture.js';
 import { RenderTarget } from '../../core/RenderTarget.js';
 import { RenderTarget } from '../../core/RenderTarget.js';
 
 
-const _size = new Vector2();
+const _size = /*@__PURE__*/ new Vector2();
 
 
 class PassTextureNode extends TextureNode {
 class PassTextureNode extends TextureNode {
 
 

+ 1 - 1
src/nodes/display/ViewportTextureNode.js

@@ -8,7 +8,7 @@ import { Vector2 } from '../../math/Vector2.js';
 import { FramebufferTexture } from '../../textures/FramebufferTexture.js';
 import { FramebufferTexture } from '../../textures/FramebufferTexture.js';
 import { LinearMipmapLinearFilter } from '../../constants.js';
 import { LinearMipmapLinearFilter } from '../../constants.js';
 
 
-const _size = new Vector2();
+const _size = /*@__PURE__*/ new Vector2();
 
 
 class ViewportTextureNode extends TextureNode {
 class ViewportTextureNode extends TextureNode {
 
 

+ 3 - 3
src/nodes/lighting/EnvironmentNode.js

@@ -11,7 +11,7 @@ import { reference } from '../accessors/ReferenceNode.js';
 import { transformedBentNormalView } from '../accessors/AccessorsUtils.js';
 import { transformedBentNormalView } from '../accessors/AccessorsUtils.js';
 import { pmremTexture } from '../pmrem/PMREMNode.js';
 import { pmremTexture } from '../pmrem/PMREMNode.js';
 
 
-const envNodeCache = new WeakMap();
+const _envNodeCache = new WeakMap();
 
 
 class EnvironmentNode extends LightingNode {
 class EnvironmentNode extends LightingNode {
 
 
@@ -29,13 +29,13 @@ class EnvironmentNode extends LightingNode {
 
 
 		if ( envNode.isTextureNode ) {
 		if ( envNode.isTextureNode ) {
 
 
-			let cacheEnvNode = envNodeCache.get( envNode.value );
+			let cacheEnvNode = _envNodeCache.get( envNode.value );
 
 
 			if ( cacheEnvNode === undefined ) {
 			if ( cacheEnvNode === undefined ) {
 
 
 				cacheEnvNode = pmremTexture( envNode.value );
 				cacheEnvNode = pmremTexture( envNode.value );
 
 
-				envNodeCache.set( envNode.value, cacheEnvNode );
+				_envNodeCache.set( envNode.value, cacheEnvNode );
 
 
 			}
 			}
 
 

+ 2 - 2
src/nodes/lighting/RectAreaLightNode.js

@@ -9,8 +9,8 @@ import { RectAreaLight } from '../../lights/RectAreaLight.js';
 import { Matrix4 } from '../../math/Matrix4.js';
 import { Matrix4 } from '../../math/Matrix4.js';
 import { Vector3 } from '../../math/Vector3.js';
 import { Vector3 } from '../../math/Vector3.js';
 
 
-const _matrix41 = new Matrix4();
-const _matrix42 = new Matrix4();
+const _matrix41 = /*@__PURE__*/ new Matrix4();
+const _matrix42 = /*@__PURE__*/ new Matrix4();
 
 
 let ltcLib = null;
 let ltcLib = null;
 
 

+ 2 - 2
src/nodes/materials/InstancedPointsNodeMaterial.js

@@ -13,7 +13,7 @@ import { viewport } from '../display/ViewportNode.js';
 
 
 import { PointsMaterial } from '../../materials/PointsMaterial.js';
 import { PointsMaterial } from '../../materials/PointsMaterial.js';
 
 
-const defaultValues = new PointsMaterial();
+const _defaultValues = /*@__PURE__*/ new PointsMaterial();
 
 
 class InstancedPointsNodeMaterial extends NodeMaterial {
 class InstancedPointsNodeMaterial extends NodeMaterial {
 
 
@@ -33,7 +33,7 @@ class InstancedPointsNodeMaterial extends NodeMaterial {
 
 
 		this.pointColorNode = null;
 		this.pointColorNode = null;
 
 
-		this.setDefaultValues( defaultValues );
+		this.setDefaultValues( _defaultValues );
 
 
 		this.setupShaders();
 		this.setupShaders();
 
 

+ 2 - 2
src/nodes/materials/Line2NodeMaterial.js

@@ -15,7 +15,7 @@ import { dashSize, gapSize } from '../core/PropertyNode.js';
 
 
 import { LineDashedMaterial } from '../../materials/LineDashedMaterial.js';
 import { LineDashedMaterial } from '../../materials/LineDashedMaterial.js';
 
 
-const defaultValues = new LineDashedMaterial();
+const _defaultValues = /*@__PURE__*/ new LineDashedMaterial();
 
 
 class Line2NodeMaterial extends NodeMaterial {
 class Line2NodeMaterial extends NodeMaterial {
 
 
@@ -26,7 +26,7 @@ class Line2NodeMaterial extends NodeMaterial {
 		this.normals = false;
 		this.normals = false;
 		this.lights = false;
 		this.lights = false;
 
 
-		this.setDefaultValues( defaultValues );
+		this.setDefaultValues( _defaultValues );
 
 
 		this.useAlphaToCoverage = true;
 		this.useAlphaToCoverage = true;
 		this.useColor = params.vertexColors;
 		this.useColor = params.vertexColors;

+ 2 - 2
src/nodes/materials/LineBasicNodeMaterial.js

@@ -2,7 +2,7 @@ import NodeMaterial, { addNodeMaterial } from './NodeMaterial.js';
 
 
 import { LineBasicMaterial } from '../../materials/LineBasicMaterial.js';
 import { LineBasicMaterial } from '../../materials/LineBasicMaterial.js';
 
 
-const defaultValues = new LineBasicMaterial();
+const _defaultValues = /*@__PURE__*/ new LineBasicMaterial();
 
 
 class LineBasicNodeMaterial extends NodeMaterial {
 class LineBasicNodeMaterial extends NodeMaterial {
 
 
@@ -15,7 +15,7 @@ class LineBasicNodeMaterial extends NodeMaterial {
 		this.lights = false;
 		this.lights = false;
 		this.normals = false;
 		this.normals = false;
 
 
-		this.setDefaultValues( defaultValues );
+		this.setDefaultValues( _defaultValues );
 
 
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 

+ 2 - 2
src/nodes/materials/LineDashedNodeMaterial.js

@@ -7,7 +7,7 @@ import { float } from '../shadernode/ShaderNode.js';
 
 
 import { LineDashedMaterial } from '../../materials/LineDashedMaterial.js';
 import { LineDashedMaterial } from '../../materials/LineDashedMaterial.js';
 
 
-const defaultValues = new LineDashedMaterial();
+const _defaultValues = /*@__PURE__*/ new LineDashedMaterial();
 
 
 class LineDashedNodeMaterial extends NodeMaterial {
 class LineDashedNodeMaterial extends NodeMaterial {
 
 
@@ -20,7 +20,7 @@ class LineDashedNodeMaterial extends NodeMaterial {
 		this.lights = false;
 		this.lights = false;
 		this.normals = false;
 		this.normals = false;
 
 
-		this.setDefaultValues( defaultValues );
+		this.setDefaultValues( _defaultValues );
 
 
 		this.offsetNode = null;
 		this.offsetNode = null;
 		this.dashScaleNode = null;
 		this.dashScaleNode = null;

+ 2 - 2
src/nodes/materials/MeshBasicNodeMaterial.js

@@ -6,7 +6,7 @@ import BasicLightMapNode from '../lighting/BasicLightMapNode.js';
 import BasicLightingModel from '../functions/BasicLightingModel.js';
 import BasicLightingModel from '../functions/BasicLightingModel.js';
 import { transformedNormalView, normalView } from '../accessors/NormalNode.js';
 import { transformedNormalView, normalView } from '../accessors/NormalNode.js';
 
 
-const defaultValues = new MeshBasicMaterial();
+const _defaultValues = /*@__PURE__*/ new MeshBasicMaterial();
 
 
 class MeshBasicNodeMaterial extends NodeMaterial {
 class MeshBasicNodeMaterial extends NodeMaterial {
 
 
@@ -19,7 +19,7 @@ class MeshBasicNodeMaterial extends NodeMaterial {
 		this.lights = true;
 		this.lights = true;
 		//this.normals = false; @TODO: normals usage by context
 		//this.normals = false; @TODO: normals usage by context
 
 
-		this.setDefaultValues( defaultValues );
+		this.setDefaultValues( _defaultValues );
 
 
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 

+ 2 - 2
src/nodes/materials/MeshLambertNodeMaterial.js

@@ -4,7 +4,7 @@ import PhongLightingModel from '../functions/PhongLightingModel.js';
 
 
 import { MeshLambertMaterial } from '../../materials/MeshLambertMaterial.js';
 import { MeshLambertMaterial } from '../../materials/MeshLambertMaterial.js';
 
 
-const defaultValues = new MeshLambertMaterial();
+const _defaultValues = /*@__PURE__*/ new MeshLambertMaterial();
 
 
 class MeshLambertNodeMaterial extends NodeMaterial {
 class MeshLambertNodeMaterial extends NodeMaterial {
 
 
@@ -16,7 +16,7 @@ class MeshLambertNodeMaterial extends NodeMaterial {
 
 
 		this.lights = true;
 		this.lights = true;
 
 
-		this.setDefaultValues( defaultValues );
+		this.setDefaultValues( _defaultValues );
 
 
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 

+ 2 - 2
src/nodes/materials/MeshMatcapNodeMaterial.js

@@ -7,7 +7,7 @@ import { matcapUV } from '../utils/MatcapUVNode.js';
 
 
 import { MeshMatcapMaterial } from '../../materials/MeshMatcapMaterial.js';
 import { MeshMatcapMaterial } from '../../materials/MeshMatcapMaterial.js';
 
 
-const defaultValues = new MeshMatcapMaterial();
+const _defaultValues = /*@__PURE__*/ new MeshMatcapMaterial();
 
 
 class MeshMatcapNodeMaterial extends NodeMaterial {
 class MeshMatcapNodeMaterial extends NodeMaterial {
 
 
@@ -19,7 +19,7 @@ class MeshMatcapNodeMaterial extends NodeMaterial {
 
 
 		this.isMeshMatcapNodeMaterial = true;
 		this.isMeshMatcapNodeMaterial = true;
 
 
-		this.setDefaultValues( defaultValues );
+		this.setDefaultValues( _defaultValues );
 
 
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 

+ 2 - 2
src/nodes/materials/MeshNormalNodeMaterial.js

@@ -7,7 +7,7 @@ import { float, vec4 } from '../shadernode/ShaderNode.js';
 
 
 import { MeshNormalMaterial } from '../../materials/MeshNormalMaterial.js';
 import { MeshNormalMaterial } from '../../materials/MeshNormalMaterial.js';
 
 
-const defaultValues = new MeshNormalMaterial();
+const _defaultValues = /*@__PURE__*/ new MeshNormalMaterial();
 
 
 class MeshNormalNodeMaterial extends NodeMaterial {
 class MeshNormalNodeMaterial extends NodeMaterial {
 
 
@@ -19,7 +19,7 @@ class MeshNormalNodeMaterial extends NodeMaterial {
 
 
 		this.isMeshNormalNodeMaterial = true;
 		this.isMeshNormalNodeMaterial = true;
 
 
-		this.setDefaultValues( defaultValues );
+		this.setDefaultValues( _defaultValues );
 
 
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 

+ 2 - 2
src/nodes/materials/MeshPhongNodeMaterial.js

@@ -7,7 +7,7 @@ import PhongLightingModel from '../functions/PhongLightingModel.js';
 
 
 import { MeshPhongMaterial } from '../../materials/MeshPhongMaterial.js';
 import { MeshPhongMaterial } from '../../materials/MeshPhongMaterial.js';
 
 
-const defaultValues = new MeshPhongMaterial();
+const _defaultValues = /*@__PURE__*/ new MeshPhongMaterial();
 
 
 class MeshPhongNodeMaterial extends NodeMaterial {
 class MeshPhongNodeMaterial extends NodeMaterial {
 
 
@@ -22,7 +22,7 @@ class MeshPhongNodeMaterial extends NodeMaterial {
 		this.shininessNode = null;
 		this.shininessNode = null;
 		this.specularNode = null;
 		this.specularNode = null;
 
 
-		this.setDefaultValues( defaultValues );
+		this.setDefaultValues( _defaultValues );
 
 
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 

+ 2 - 2
src/nodes/materials/MeshPhysicalNodeMaterial.js

@@ -11,7 +11,7 @@ import { mix, pow2, min } from '../math/MathNode.js';
 
 
 import { MeshPhysicalMaterial } from '../../materials/MeshPhysicalMaterial.js';
 import { MeshPhysicalMaterial } from '../../materials/MeshPhysicalMaterial.js';
 
 
-const defaultValues = new MeshPhysicalMaterial();
+const _defaultValues = /*@__PURE__*/ new MeshPhysicalMaterial();
 
 
 class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
 class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
 
 
@@ -44,7 +44,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
 
 
 		this.anisotropyNode = null;
 		this.anisotropyNode = null;
 
 
-		this.setDefaultValues( defaultValues );
+		this.setDefaultValues( _defaultValues );
 
 
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 

+ 2 - 2
src/nodes/materials/MeshStandardNodeMaterial.js

@@ -9,7 +9,7 @@ import { float, vec3, vec4 } from '../shadernode/ShaderNode.js';
 
 
 import { MeshStandardMaterial } from '../../materials/MeshStandardMaterial.js';
 import { MeshStandardMaterial } from '../../materials/MeshStandardMaterial.js';
 
 
-const defaultValues = new MeshStandardMaterial();
+const _defaultValues = /*@__PURE__*/ new MeshStandardMaterial();
 
 
 class MeshStandardNodeMaterial extends NodeMaterial {
 class MeshStandardNodeMaterial extends NodeMaterial {
 
 
@@ -24,7 +24,7 @@ class MeshStandardNodeMaterial extends NodeMaterial {
 		this.metalnessNode = null;
 		this.metalnessNode = null;
 		this.roughnessNode = null;
 		this.roughnessNode = null;
 
 
-		this.setDefaultValues( defaultValues );
+		this.setDefaultValues( _defaultValues );
 
 
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 

+ 2 - 2
src/nodes/materials/MeshToonNodeMaterial.js

@@ -3,7 +3,7 @@ import ToonLightingModel from '../functions/ToonLightingModel.js';
 
 
 import { MeshToonMaterial } from '../../materials/MeshToonMaterial.js';
 import { MeshToonMaterial } from '../../materials/MeshToonMaterial.js';
 
 
-const defaultValues = new MeshToonMaterial();
+const _defaultValues = /*@__PURE__*/ new MeshToonMaterial();
 
 
 class MeshToonNodeMaterial extends NodeMaterial {
 class MeshToonNodeMaterial extends NodeMaterial {
 
 
@@ -15,7 +15,7 @@ class MeshToonNodeMaterial extends NodeMaterial {
 
 
 		this.lights = true;
 		this.lights = true;
 
 
-		this.setDefaultValues( defaultValues );
+		this.setDefaultValues( _defaultValues );
 
 
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 

+ 2 - 2
src/nodes/materials/PointsNodeMaterial.js

@@ -2,7 +2,7 @@ import NodeMaterial, { addNodeMaterial } from './NodeMaterial.js';
 
 
 import { PointsMaterial } from '../../materials/PointsMaterial.js';
 import { PointsMaterial } from '../../materials/PointsMaterial.js';
 
 
-const defaultValues = new PointsMaterial();
+const _defaultValues = /*@__PURE__*/ new PointsMaterial();
 
 
 class PointsNodeMaterial extends NodeMaterial {
 class PointsNodeMaterial extends NodeMaterial {
 
 
@@ -18,7 +18,7 @@ class PointsNodeMaterial extends NodeMaterial {
 
 
 		this.sizeNode = null;
 		this.sizeNode = null;
 
 
-		this.setDefaultValues( defaultValues );
+		this.setDefaultValues( _defaultValues );
 
 
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 

+ 2 - 2
src/nodes/materials/ShadowNodeMaterial.js

@@ -3,7 +3,7 @@ import ShadowMaskModel from '../functions/ShadowMaskModel.js';
 
 
 import { ShadowMaterial } from '../../materials/ShadowMaterial.js';
 import { ShadowMaterial } from '../../materials/ShadowMaterial.js';
 
 
-const defaultValues = new ShadowMaterial();
+const _defaultValues = /*@__PURE__*/ new ShadowMaterial();
 
 
 class ShadowNodeMaterial extends NodeMaterial {
 class ShadowNodeMaterial extends NodeMaterial {
 
 
@@ -15,7 +15,7 @@ class ShadowNodeMaterial extends NodeMaterial {
 
 
 		this.lights = true;
 		this.lights = true;
 
 
-		this.setDefaultValues( defaultValues );
+		this.setDefaultValues( _defaultValues );
 
 
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 

+ 2 - 2
src/nodes/materials/SpriteNodeMaterial.js

@@ -8,7 +8,7 @@ import { float, vec2, vec3, vec4 } from '../shadernode/ShaderNode.js';
 
 
 import { SpriteMaterial } from '../../materials/SpriteMaterial.js';
 import { SpriteMaterial } from '../../materials/SpriteMaterial.js';
 
 
-const defaultValues = new SpriteMaterial();
+const _defaultValues = /*@__PURE__*/ new SpriteMaterial();
 
 
 class SpriteNodeMaterial extends NodeMaterial {
 class SpriteNodeMaterial extends NodeMaterial {
 
 
@@ -25,7 +25,7 @@ class SpriteNodeMaterial extends NodeMaterial {
 		this.rotationNode = null;
 		this.rotationNode = null;
 		this.scaleNode = null;
 		this.scaleNode = null;
 
 
-		this.setDefaultValues( defaultValues );
+		this.setDefaultValues( _defaultValues );
 
 
 		this.setValues( parameters );
 		this.setValues( parameters );
 
 

+ 1 - 1
src/nodes/utils/RTTNode.js

@@ -10,7 +10,7 @@ import { RenderTarget } from '../../core/RenderTarget.js';
 import { Vector2 } from '../../math/Vector2.js';
 import { Vector2 } from '../../math/Vector2.js';
 import { HalfFloatType } from '../../constants.js';
 import { HalfFloatType } from '../../constants.js';
 
 
-const _size = new Vector2();
+const _size = /*@__PURE__*/ new Vector2();
 
 
 class RTTNode extends TextureNode {
 class RTTNode extends TextureNode {
 
 

+ 1 - 1
src/renderers/common/Background.js

@@ -6,7 +6,7 @@ import { Mesh } from '../../objects/Mesh.js';
 import { SphereGeometry } from '../../geometries/SphereGeometry.js';
 import { SphereGeometry } from '../../geometries/SphereGeometry.js';
 import { BackSide, LinearSRGBColorSpace } from '../../constants.js';
 import { BackSide, LinearSRGBColorSpace } from '../../constants.js';
 
 
-const _clearColor = new Color4();
+const _clearColor = /*@__PURE__*/ new Color4();
 
 
 class Background extends DataMap {
 class Background extends DataMap {
 
 

+ 1 - 1
src/renderers/common/ClippingContext.js

@@ -2,7 +2,7 @@ import { Matrix3 } from '../../math/Matrix3.js';
 import { Plane } from '../../math/Plane.js';
 import { Plane } from '../../math/Plane.js';
 import { Vector4 } from '../../math/Vector4.js';
 import { Vector4 } from '../../math/Vector4.js';
 
 
-const _plane = new Plane();
+const _plane = /*@__PURE__*/ new Plane();
 
 
 let _clippingContextVersion = 0;
 let _clippingContextVersion = 0;
 
 

+ 6 - 5
src/renderers/common/PostProcessing.js

@@ -2,7 +2,8 @@ import { vec4, renderOutput, NodeMaterial } from '../../nodes/Nodes.js';
 import { LinearSRGBColorSpace, NoToneMapping } from '../../constants.js';
 import { LinearSRGBColorSpace, NoToneMapping } from '../../constants.js';
 import QuadMesh from '../../renderers/common/QuadMesh.js';
 import QuadMesh from '../../renderers/common/QuadMesh.js';
 
 
-const quadMesh = new QuadMesh( new NodeMaterial() );
+const _material = /*@__PURE__*/ new NodeMaterial();
+const _quadMesh = /*@__PURE__*/ new QuadMesh( _material );
 
 
 class PostProcessing {
 class PostProcessing {
 
 
@@ -31,7 +32,7 @@ class PostProcessing {
 
 
 		//
 		//
 
 
-		quadMesh.render( renderer );
+		_quadMesh.render( renderer );
 
 
 		//
 		//
 
 
@@ -49,8 +50,8 @@ class PostProcessing {
 			const toneMapping = renderer.toneMapping;
 			const toneMapping = renderer.toneMapping;
 			const outputColorSpace = renderer.outputColorSpace;
 			const outputColorSpace = renderer.outputColorSpace;
 
 
-			quadMesh.material.fragmentNode = this.outputColorTransform === true ? renderOutput( this.outputNode, toneMapping, outputColorSpace ) : this.outputNode.context( { toneMapping, outputColorSpace } );
-			quadMesh.material.needsUpdate = true;
+			_quadMesh.material.fragmentNode = this.outputColorTransform === true ? renderOutput( this.outputNode, toneMapping, outputColorSpace ) : this.outputNode.context( { toneMapping, outputColorSpace } );
+			_quadMesh.material.needsUpdate = true;
 
 
 			this.needsUpdate = false;
 			this.needsUpdate = false;
 
 
@@ -72,7 +73,7 @@ class PostProcessing {
 
 
 		//
 		//
 
 
-		await quadMesh.renderAsync( renderer );
+		await _quadMesh.renderAsync( renderer );
 
 
 		//
 		//
 
 

+ 2 - 2
src/renderers/common/QuadMesh.js

@@ -5,7 +5,7 @@ import { OrthographicCamera } from '../../cameras/OrthographicCamera.js';
 
 
 // Helper for passes that need to fill the viewport with a single quad.
 // Helper for passes that need to fill the viewport with a single quad.
 
 
-const _camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
+const _camera = /*@__PURE__*/ new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
 
 
 // https://github.com/mrdoob/three.js/pull/21358
 // https://github.com/mrdoob/three.js/pull/21358
 
 
@@ -24,7 +24,7 @@ class QuadGeometry extends BufferGeometry {
 
 
 }
 }
 
 
-const _geometry = new QuadGeometry();
+const _geometry = /*@__PURE__*/ new QuadGeometry();
 
 
 class QuadMesh extends Mesh {
 class QuadMesh extends Mesh {
 
 

+ 2 - 2
src/renderers/common/RenderObject.js

@@ -1,6 +1,6 @@
 import ClippingContext from './ClippingContext.js';
 import ClippingContext from './ClippingContext.js';
 
 
-let id = 0;
+let _id = 0;
 
 
 function getKeys( obj ) {
 function getKeys( obj ) {
 
 
@@ -43,7 +43,7 @@ export default class RenderObject {
 		this._nodes = nodes;
 		this._nodes = nodes;
 		this._geometries = geometries;
 		this._geometries = geometries;
 
 
-		this.id = id ++;
+		this.id = _id ++;
 
 
 		this.renderer = renderer;
 		this.renderer = renderer;
 		this.object = object;
 		this.object = object;

+ 6 - 6
src/renderers/common/Renderer.js

@@ -26,12 +26,12 @@ import { Vector4 } from '../../math/Vector4.js';
 import { RenderTarget } from '../../core/RenderTarget.js';
 import { RenderTarget } from '../../core/RenderTarget.js';
 import { DoubleSide, BackSide, FrontSide, SRGBColorSpace, NoColorSpace, NoToneMapping, LinearFilter, LinearSRGBColorSpace, HalfFloatType, RGBAFormat } from '../../constants.js';
 import { DoubleSide, BackSide, FrontSide, SRGBColorSpace, NoColorSpace, NoToneMapping, LinearFilter, LinearSRGBColorSpace, HalfFloatType, RGBAFormat } from '../../constants.js';
 
 
-const _scene = new Scene();
-const _drawingBufferSize = new Vector2();
-const _screen = new Vector4();
-const _frustum = new Frustum();
-const _projScreenMatrix = new Matrix4();
-const _vector3 = new Vector3();
+const _scene = /*@__PURE__*/ new Scene();
+const _drawingBufferSize = /*@__PURE__*/ new Vector2();
+const _screen = /*@__PURE__*/ new Vector4();
+const _frustum = /*@__PURE__*/ new Frustum();
+const _projScreenMatrix = /*@__PURE__*/ new Matrix4();
+const _vector3 = /*@__PURE__*/ new Vector3();
 
 
 class Renderer {
 class Renderer {
 
 

+ 2 - 2
src/renderers/common/SampledTexture.js

@@ -1,6 +1,6 @@
 import Binding from './Binding.js';
 import Binding from './Binding.js';
 
 
-let id = 0;
+let _id = 0;
 
 
 class SampledTexture extends Binding {
 class SampledTexture extends Binding {
 
 
@@ -8,7 +8,7 @@ class SampledTexture extends Binding {
 
 
 		super( name );
 		super( name );
 
 
-		this.id = id ++;
+		this.id = _id ++;
 
 
 		this.texture = texture;
 		this.texture = texture;
 		this.version = texture ? texture.version : 0;
 		this.version = texture ? texture.version : 0;

+ 1 - 1
src/renderers/common/Textures.js

@@ -4,7 +4,7 @@ import { Vector3 } from '../../math/Vector3.js';
 import { DepthTexture } from '../../textures/DepthTexture.js';
 import { DepthTexture } from '../../textures/DepthTexture.js';
 import { DepthStencilFormat, DepthFormat, UnsignedIntType, UnsignedInt248Type, LinearFilter, NearestFilter, EquirectangularReflectionMapping, EquirectangularRefractionMapping, CubeReflectionMapping, CubeRefractionMapping, UnsignedByteType } from '../../constants.js';
 import { DepthStencilFormat, DepthFormat, UnsignedIntType, UnsignedInt248Type, LinearFilter, NearestFilter, EquirectangularReflectionMapping, EquirectangularRefractionMapping, CubeReflectionMapping, CubeRefractionMapping, UnsignedByteType } from '../../constants.js';
 
 
-const _size = new Vector3();
+const _size = /*@__PURE__*/ new Vector3();
 
 
 class Textures extends DataMap {
 class Textures extends DataMap {
 
 

+ 2 - 2
src/renderers/common/nodes/NodeUniformsGroup.js

@@ -1,6 +1,6 @@
 import UniformsGroup from '../UniformsGroup.js';
 import UniformsGroup from '../UniformsGroup.js';
 
 
-let id = 0;
+let _id = 0;
 
 
 class NodeUniformsGroup extends UniformsGroup {
 class NodeUniformsGroup extends UniformsGroup {
 
 
@@ -8,7 +8,7 @@ class NodeUniformsGroup extends UniformsGroup {
 
 
 		super( name );
 		super( name );
 
 
-		this.id = id ++;
+		this.id = _id ++;
 		this.groupNode = groupNode;
 		this.groupNode = groupNode;
 
 
 		this.isNodeUniformsGroup = true;
 		this.isNodeUniformsGroup = true;