super-three 0.167.0 → 0.168.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/three.cjs +165 -44
- package/build/three.module.js +165 -45
- package/build/three.module.min.js +1 -1
- package/build/three.webgpu.js +23600 -21931
- package/build/three.webgpu.min.js +1 -1
- package/examples/jsm/Addons.js +3 -1
- package/examples/jsm/animation/AnimationClipCreator.js +1 -1
- package/examples/jsm/capabilities/WebGL.js +27 -21
- package/examples/jsm/controls/ArcballControls.js +174 -158
- package/examples/jsm/controls/DragControls.js +260 -132
- package/examples/jsm/controls/FirstPersonControls.js +175 -163
- package/examples/jsm/controls/FlyControls.js +194 -188
- package/examples/jsm/controls/OrbitControls.js +777 -786
- package/examples/jsm/controls/PointerLockControls.js +24 -15
- package/examples/jsm/controls/TrackballControls.js +453 -452
- package/examples/jsm/effects/AnaglyphEffect.js +6 -13
- package/examples/jsm/effects/ParallaxBarrierEffect.js +17 -11
- package/examples/jsm/effects/StereoEffect.js +6 -1
- package/examples/jsm/environments/RoomEnvironment.js +1 -1
- package/examples/jsm/exporters/GLTFExporter.js +6 -1
- package/examples/jsm/exporters/USDZExporter.js +29 -8
- package/examples/jsm/helpers/LightProbeHelper.js +42 -43
- package/examples/jsm/loaders/KTX2Loader.js +19 -7
- package/examples/jsm/loaders/MaterialXLoader.js +11 -4
- package/examples/jsm/loaders/PCDLoader.js +9 -9
- package/examples/jsm/objects/SkyMesh.js +188 -0
- package/examples/jsm/objects/Water2Mesh.js +159 -0
- package/examples/jsm/objects/WaterMesh.js +102 -0
- package/examples/jsm/physics/RapierPhysics.js +20 -0
- package/examples/jsm/postprocessing/OutlinePass.js +31 -46
- package/examples/jsm/postprocessing/SSAARenderPass.js +3 -1
- package/examples/jsm/shaders/BleachBypassShader.js +1 -2
- package/examples/jsm/shaders/OutputShader.js +1 -1
- package/examples/jsm/transpiler/TSLEncoder.js +8 -8
- package/examples/jsm/utils/TextureUtils.js +1 -1
- package/package.json +2 -1
- package/src/Three.WebGPU.js +6 -0
- package/src/Three.js +1 -0
- package/src/constants.js +1 -1
- package/src/extras/Controls.js +32 -0
- package/src/loaders/ObjectLoader.js +3 -3
- package/src/{nodes/loaders → loaders/nodes}/NodeLoader.js +4 -4
- package/src/{nodes/loaders → loaders/nodes}/NodeMaterialLoader.js +1 -2
- package/src/materials/Material.js +4 -7
- package/src/{nodes/materials → materials/nodes}/InstancedPointsNodeMaterial.js +33 -24
- package/src/{nodes/materials → materials/nodes}/Line2NodeMaterial.js +34 -37
- package/src/{nodes/materials → materials/nodes}/LineBasicNodeMaterial.js +3 -4
- package/src/{nodes/materials → materials/nodes}/LineDashedNodeMaterial.js +7 -9
- package/src/{nodes/materials → materials/nodes}/MeshBasicNodeMaterial.js +11 -11
- package/src/{nodes/materials → materials/nodes}/MeshLambertNodeMaterial.js +5 -5
- package/src/{nodes/materials → materials/nodes}/MeshMatcapNodeMaterial.js +8 -8
- package/src/materials/nodes/MeshNormalNodeMaterial.js +40 -0
- package/src/{nodes/materials → materials/nodes}/MeshPhongNodeMaterial.js +9 -8
- package/src/{nodes/materials → materials/nodes}/MeshPhysicalNodeMaterial.js +18 -17
- package/src/{nodes/materials → materials/nodes}/MeshSSSNodeMaterial.js +6 -6
- package/src/{nodes/materials → materials/nodes}/MeshStandardNodeMaterial.js +17 -11
- package/src/{nodes/materials → materials/nodes}/MeshToonNodeMaterial.js +4 -4
- package/src/{nodes/materials → materials/nodes}/NodeMaterial.js +67 -86
- package/src/{nodes/materials/Materials.js → materials/nodes/NodeMaterials.js} +1 -1
- package/src/{nodes/materials → materials/nodes}/PointsNodeMaterial.js +3 -4
- package/src/{nodes/materials → materials/nodes}/ShadowNodeMaterial.js +4 -4
- package/src/{nodes/materials → materials/nodes}/SpriteNodeMaterial.js +11 -11
- package/src/{nodes/materials → materials/nodes}/VolumeNodeMaterial.js +14 -16
- package/src/nodes/Nodes.js +103 -159
- package/src/nodes/TSL.js +176 -0
- package/src/nodes/accessors/AccessorsUtils.js +8 -8
- package/src/nodes/accessors/BatchNode.js +48 -20
- package/src/nodes/accessors/{BitangentNode.js → Bitangent.js} +9 -9
- package/src/nodes/accessors/BufferAttributeNode.js +5 -5
- package/src/nodes/accessors/BufferNode.js +4 -4
- package/src/nodes/accessors/{CameraNode.js → Camera.js} +10 -10
- package/src/nodes/accessors/ClippingNode.js +16 -14
- package/src/nodes/accessors/CubeTextureNode.js +5 -7
- package/src/nodes/accessors/InstanceNode.js +17 -13
- package/src/nodes/accessors/InstancedPointsMaterialNode.js +4 -4
- package/src/nodes/accessors/MaterialNode.js +52 -55
- package/src/nodes/accessors/MaterialProperties.js +3 -0
- package/src/nodes/accessors/MaterialReferenceNode.js +6 -4
- package/src/nodes/accessors/ModelNode.js +11 -11
- package/src/nodes/accessors/ModelViewProjectionNode.js +6 -7
- package/src/nodes/accessors/MorphNode.js +12 -12
- package/src/nodes/accessors/Normal.js +62 -0
- package/src/nodes/accessors/Object3DNode.js +10 -10
- package/src/nodes/accessors/PointUVNode.js +4 -4
- package/src/nodes/accessors/Position.js +10 -0
- package/src/nodes/accessors/ReferenceBaseNode.js +143 -0
- package/src/nodes/accessors/ReferenceNode.js +13 -7
- package/src/nodes/accessors/ReflectVector.js +10 -0
- package/src/nodes/accessors/RendererReferenceNode.js +6 -6
- package/src/nodes/accessors/SceneNode.js +5 -6
- package/src/nodes/accessors/SkinningNode.js +84 -21
- package/src/nodes/accessors/StorageBufferNode.js +4 -5
- package/src/nodes/accessors/StorageTextureNode.js +5 -5
- package/src/nodes/accessors/Tangent.js +22 -0
- package/src/nodes/accessors/Texture3DNode.js +11 -11
- package/src/nodes/accessors/{TextureBicubicNode.js → TextureBicubic.js} +3 -32
- package/src/nodes/accessors/TextureNode.js +16 -21
- package/src/nodes/accessors/TextureSizeNode.js +4 -6
- package/src/nodes/accessors/{UniformsNode.js → UniformArrayNode.js} +17 -8
- package/src/nodes/accessors/UserDataNode.js +4 -4
- package/src/nodes/accessors/VelocityNode.js +83 -0
- package/src/nodes/accessors/VertexColorNode.js +4 -4
- package/src/nodes/code/CodeNode.js +5 -5
- package/src/nodes/code/ExpressionNode.js +4 -4
- package/src/nodes/code/FunctionCallNode.js +5 -5
- package/src/nodes/code/FunctionNode.js +5 -23
- package/src/nodes/code/ScriptableNode.js +4 -6
- package/src/nodes/code/ScriptableValueNode.js +4 -6
- package/src/nodes/core/AssignNode.js +5 -5
- package/src/nodes/core/AttributeNode.js +7 -20
- package/src/nodes/core/BypassNode.js +5 -5
- package/src/nodes/core/CacheNode.js +5 -5
- package/src/nodes/core/ConstNode.js +2 -2
- package/src/nodes/core/ContextNode.js +17 -11
- package/src/nodes/core/IndexNode.js +12 -7
- package/src/nodes/core/InputNode.js +2 -2
- package/src/nodes/core/MRTNode.js +12 -6
- package/src/nodes/core/Node.js +39 -19
- package/src/nodes/core/NodeBuilder.js +46 -33
- package/src/nodes/core/NodeUtils.js +1 -0
- package/src/nodes/core/OutputStructNode.js +4 -4
- package/src/nodes/core/ParameterNode.js +4 -4
- package/src/nodes/core/PropertyNode.js +32 -32
- package/src/nodes/core/StackNode.js +26 -10
- package/src/nodes/core/StructTypeNode.js +2 -2
- package/src/nodes/core/TempNode.js +2 -2
- package/src/nodes/core/UniformGroupNode.js +8 -9
- package/src/nodes/core/UniformNode.js +4 -4
- package/src/nodes/core/VarNode.js +6 -6
- package/src/nodes/core/VaryingNode.js +5 -5
- package/src/nodes/display/AfterImageNode.js +9 -9
- package/src/nodes/display/AnaglyphPassNode.js +61 -0
- package/src/nodes/display/AnamorphicNode.js +11 -11
- package/src/nodes/display/BleachBypass.js +26 -0
- package/src/nodes/display/BlendMode.js +54 -0
- package/src/nodes/display/BloomNode.js +21 -19
- package/src/nodes/display/BumpMapNode.js +7 -12
- package/src/nodes/display/ColorAdjustment.js +46 -0
- package/src/nodes/display/ColorSpaceFunctions.js +38 -0
- package/src/nodes/display/ColorSpaceNode.js +40 -63
- package/src/nodes/display/DenoiseNode.js +20 -17
- package/src/nodes/display/DepthOfFieldNode.js +8 -6
- package/src/nodes/display/DotScreenNode.js +10 -22
- package/src/nodes/display/FXAANode.js +17 -15
- package/src/nodes/display/FilmNode.js +7 -6
- package/src/nodes/display/FrontFacingNode.js +5 -5
- package/src/nodes/display/GTAONode.js +19 -15
- package/src/nodes/display/GaussianBlurNode.js +11 -8
- package/src/nodes/display/Lut3DNode.js +6 -5
- package/src/nodes/display/MotionBlur.js +25 -0
- package/src/nodes/display/NormalMapNode.js +8 -10
- package/src/nodes/display/ParallaxBarrierPassNode.js +55 -0
- package/src/nodes/display/PassNode.js +84 -8
- package/src/nodes/display/PixelationPassNode.js +12 -7
- package/src/nodes/display/PosterizeNode.js +4 -6
- package/src/nodes/display/RGBShiftNode.js +8 -7
- package/src/nodes/display/RenderOutputNode.js +9 -9
- package/src/nodes/display/SSAAPassNode.js +284 -0
- package/src/nodes/display/Sepia.js +17 -0
- package/src/nodes/display/SobelOperatorNode.js +9 -7
- package/src/nodes/display/StereoCompositePassNode.js +107 -0
- package/src/nodes/display/StereoPassNode.js +80 -0
- package/src/nodes/display/ToneMappingFunctions.js +190 -0
- package/src/nodes/display/ToneMappingNode.js +12 -173
- package/src/nodes/display/TransitionNode.js +9 -8
- package/src/nodes/display/ViewportDepthNode.js +30 -29
- package/src/nodes/display/ViewportDepthTextureNode.js +6 -8
- package/src/nodes/display/ViewportNode.js +26 -25
- package/src/nodes/display/ViewportSharedTextureNode.js +6 -8
- package/src/nodes/display/ViewportTextureNode.js +7 -10
- package/src/nodes/fog/FogExp2Node.js +4 -6
- package/src/nodes/fog/FogNode.js +5 -7
- package/src/nodes/fog/FogRangeNode.js +4 -6
- package/src/nodes/functions/BSDF/BRDF_GGX.js +4 -4
- package/src/nodes/functions/BSDF/BRDF_Lambert.js +2 -2
- package/src/nodes/functions/BSDF/BRDF_Sheen.js +6 -6
- package/src/nodes/functions/BSDF/DFGApprox.js +2 -2
- package/src/nodes/functions/BSDF/D_GGX.js +2 -2
- package/src/nodes/functions/BSDF/D_GGX_Anisotropic.js +3 -3
- package/src/nodes/functions/BSDF/EnvironmentBRDF.js +2 -2
- package/src/nodes/functions/BSDF/F_Schlick.js +2 -2
- package/src/nodes/functions/BSDF/LTC.js +6 -6
- package/src/nodes/functions/BSDF/Schlick_to_F0.js +2 -2
- package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +2 -2
- package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +2 -2
- package/src/nodes/functions/BasicLightingModel.js +1 -1
- package/src/nodes/functions/PhongLightingModel.js +5 -5
- package/src/nodes/functions/PhysicalLightingModel.js +32 -31
- package/src/nodes/functions/ShadowMaskModel.js +1 -1
- package/src/nodes/functions/ToonLightingModel.js +3 -3
- package/src/nodes/functions/material/getGeometryRoughness.js +4 -4
- package/src/nodes/functions/material/getRoughness.js +2 -2
- package/src/nodes/geometry/RangeNode.js +4 -4
- package/src/nodes/gpgpu/ComputeNode.js +5 -5
- package/src/nodes/lighting/AONode.js +2 -2
- package/src/nodes/lighting/AmbientLightNode.js +2 -7
- package/src/nodes/lighting/AnalyticLightNode.js +34 -13
- package/src/nodes/lighting/BasicEnvironmentNode.js +4 -3
- package/src/nodes/lighting/BasicLightMapNode.js +3 -3
- package/src/nodes/lighting/DirectionalLightNode.js +2 -7
- package/src/nodes/lighting/EnvironmentNode.js +20 -19
- package/src/nodes/lighting/HemisphereLightNode.js +3 -7
- package/src/nodes/lighting/IESSpotLightNode.js +3 -8
- package/src/nodes/lighting/IrradianceNode.js +2 -2
- package/src/nodes/lighting/LightNode.js +5 -5
- package/src/nodes/lighting/LightProbeNode.js +76 -0
- package/src/nodes/lighting/LightUtils.js +3 -3
- package/src/nodes/lighting/LightingContextNode.js +15 -17
- package/src/nodes/lighting/LightingNode.js +2 -2
- package/src/nodes/lighting/LightsNode.js +94 -76
- package/src/nodes/lighting/PointLightNode.js +3 -8
- package/src/nodes/lighting/RectAreaLightNode.js +2 -6
- package/src/nodes/lighting/SpotLightNode.js +3 -8
- package/src/nodes/materialx/MaterialXNodes.js +2 -2
- package/src/nodes/materialx/lib/mx_hsv.js +36 -31
- package/src/nodes/materialx/lib/mx_noise.js +96 -96
- package/src/nodes/materialx/lib/mx_transform_color.js +2 -2
- package/src/nodes/math/{CondNode.js → ConditionalNode.js} +18 -7
- package/src/nodes/math/Hash.js +13 -0
- package/src/nodes/math/MathNode.js +124 -124
- package/src/nodes/math/MathUtils.js +0 -7
- package/src/nodes/math/OperatorNode.js +94 -52
- package/src/nodes/math/TriNoise3D.js +19 -29
- package/src/nodes/pmrem/PMREMNode.js +58 -15
- package/src/nodes/pmrem/PMREMUtils.js +46 -46
- package/src/nodes/procedural/Checker.js +14 -0
- package/src/nodes/tsl/TSLBase.js +30 -0
- package/src/nodes/{shadernode/ShaderNode.js → tsl/TSLCore.js} +105 -97
- package/src/nodes/utils/ArrayElementNode.js +2 -2
- package/src/nodes/utils/ConvertNode.js +2 -2
- package/src/nodes/utils/CubeMapNode.js +157 -0
- package/src/nodes/utils/Discard.js +8 -0
- package/src/nodes/utils/EquirectUVNode.js +5 -5
- package/src/nodes/utils/FlipNode.js +65 -0
- package/src/nodes/utils/FunctionOverloadingNode.js +5 -5
- package/src/nodes/utils/JoinNode.js +2 -2
- package/src/nodes/utils/LoopNode.js +12 -6
- package/src/nodes/utils/MatcapUVNode.js +6 -6
- package/src/nodes/utils/MaxMipLevelNode.js +4 -4
- package/src/nodes/utils/OscNode.js +7 -7
- package/src/nodes/utils/Packing.js +4 -0
- package/src/nodes/utils/RTTNode.js +8 -8
- package/src/nodes/utils/ReflectorNode.js +8 -3
- package/src/nodes/utils/RemapNode.js +7 -7
- package/src/nodes/utils/RotateNode.js +4 -12
- package/src/nodes/utils/SetNode.js +2 -2
- package/src/nodes/utils/SplitNode.js +2 -2
- package/src/nodes/utils/SpriteSheetUVNode.js +5 -5
- package/src/nodes/utils/SpriteUtils.js +47 -0
- package/src/nodes/utils/StorageArrayElementNode.js +4 -6
- package/src/nodes/utils/TimerNode.js +5 -5
- package/src/nodes/utils/TriplanarTexturesNode.js +7 -9
- package/src/nodes/utils/UVUtils.js +19 -0
- package/src/nodes/utils/ViewportUtils.js +14 -0
- package/src/objects/BatchedMesh.js +2 -3
- package/src/renderers/WebGLRenderer.js +24 -0
- package/src/renderers/common/Backend.js +2 -2
- package/src/renderers/common/Background.js +3 -1
- package/src/renderers/common/BindGroup.js +3 -1
- package/src/renderers/common/Bindings.js +13 -15
- package/src/renderers/common/ClippingContext.js +14 -5
- package/src/renderers/common/CubeRenderTarget.js +9 -3
- package/src/renderers/common/PostProcessing.js +4 -1
- package/src/renderers/common/QuadMesh.js +2 -0
- package/src/renderers/common/RenderContext.js +24 -0
- package/src/renderers/common/RenderList.js +1 -1
- package/src/renderers/common/RenderObject.js +2 -2
- package/src/renderers/common/Renderer.js +75 -49
- package/src/renderers/common/SampledTexture.js +12 -3
- package/src/renderers/common/StandardRenderer.js +18 -0
- package/src/renderers/common/Textures.js +8 -12
- package/src/renderers/common/extras/PMREMGenerator.js +12 -13
- package/src/renderers/common/nodes/NodeBuilderState.js +1 -1
- package/src/renderers/common/nodes/NodeLibrary.js +118 -0
- package/src/renderers/common/nodes/NodeSampledTexture.js +2 -2
- package/src/renderers/common/nodes/Nodes.js +36 -9
- package/src/renderers/common/nodes/StandardNodeLibrary.js +105 -0
- package/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +2 -2
- package/src/renderers/webgl/WebGLProgram.js +1 -1
- package/src/renderers/webgl/WebGLProperties.js +7 -0
- package/src/renderers/webgl/WebGLTextures.js +61 -4
- package/src/renderers/webgl-fallback/WebGLBackend.js +88 -68
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +57 -9
- package/src/renderers/webgl-fallback/utils/WebGLState.js +21 -0
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +28 -21
- package/src/renderers/webgpu/WebGPUBackend.js +86 -68
- package/src/renderers/webgpu/WebGPURenderer.js +8 -8
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +99 -63
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +45 -21
- package/src/renderers/webgpu/utils/WebGPUConstants.js +2 -1
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +6 -15
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +62 -5
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +36 -21
- package/src/renderers/webgpu/utils/WebGPUUtils.js +18 -1
- package/src/renderers/webxr/WebXRManager.js +32 -25
- package/examples/jsm/loaders/LogLuvLoader.js +0 -606
- package/src/nodes/accessors/NormalNode.js +0 -14
- package/src/nodes/accessors/PositionNode.js +0 -10
- package/src/nodes/accessors/ReflectVectorNode.js +0 -10
- package/src/nodes/accessors/TangentNode.js +0 -23
- package/src/nodes/core/NodeKeywords.js +0 -80
- package/src/nodes/display/BlendModeNode.js +0 -128
- package/src/nodes/display/ColorAdjustmentNode.js +0 -104
- package/src/nodes/materials/MeshNormalNodeMaterial.js +0 -40
- package/src/nodes/math/HashNode.js +0 -34
- package/src/nodes/procedural/CheckerNode.js +0 -42
- package/src/nodes/utils/DiscardNode.js +0 -28
- package/src/nodes/utils/PackingNode.js +0 -55
- package/src/nodes/utils/RotateUVNode.js +0 -35
- /package/src/{nodes/loaders → loaders/nodes}/NodeObjectLoader.js +0 -0
- /package/src/nodes/accessors/{UVNode.js → UV.js} +0 -0
|
@@ -4,13 +4,11 @@ import { Vector4 } from '../../math/Vector4.js';
|
|
|
4
4
|
|
|
5
5
|
const _plane = /*@__PURE__*/ new Plane();
|
|
6
6
|
|
|
7
|
-
let _clippingContextVersion = 0;
|
|
8
|
-
|
|
9
7
|
class ClippingContext {
|
|
10
8
|
|
|
11
9
|
constructor() {
|
|
12
10
|
|
|
13
|
-
this.version =
|
|
11
|
+
this.version = 0;
|
|
14
12
|
|
|
15
13
|
this.globalClippingCount = 0;
|
|
16
14
|
|
|
@@ -22,6 +20,7 @@ class ClippingContext {
|
|
|
22
20
|
|
|
23
21
|
this.parentVersion = 0;
|
|
24
22
|
this.viewNormalMatrix = new Matrix3();
|
|
23
|
+
this.cacheKey = '';
|
|
25
24
|
|
|
26
25
|
}
|
|
27
26
|
|
|
@@ -93,7 +92,12 @@ class ClippingContext {
|
|
|
93
92
|
|
|
94
93
|
}
|
|
95
94
|
|
|
96
|
-
if ( update )
|
|
95
|
+
if ( update ) {
|
|
96
|
+
|
|
97
|
+
this.version ++;
|
|
98
|
+
this.cacheKey = `${ this.globalClippingCount }:${ this.localClippingEnabled === undefined ? false : this.localClippingEnabled }:`;
|
|
99
|
+
|
|
100
|
+
}
|
|
97
101
|
|
|
98
102
|
}
|
|
99
103
|
|
|
@@ -158,7 +162,12 @@ class ClippingContext {
|
|
|
158
162
|
|
|
159
163
|
}
|
|
160
164
|
|
|
161
|
-
if ( update )
|
|
165
|
+
if ( update ) {
|
|
166
|
+
|
|
167
|
+
this.version += parent.version;
|
|
168
|
+
this.cacheKey = parent.cacheKey + `:${ this.localClippingCount }:${ this.localClipIntersection === undefined ? false : this.localClipIntersection }`;
|
|
169
|
+
|
|
170
|
+
}
|
|
162
171
|
|
|
163
172
|
}
|
|
164
173
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { equirectUV } from '../../nodes/utils/EquirectUVNode.js';
|
|
2
2
|
import { texture as TSL_Texture } from '../../nodes/accessors/TextureNode.js';
|
|
3
|
-
import { positionWorldDirection } from '../../nodes/accessors/
|
|
4
|
-
import
|
|
3
|
+
import { positionWorldDirection } from '../../nodes/accessors/Position.js';
|
|
4
|
+
import NodeMaterial from '../../materials/nodes/NodeMaterial.js';
|
|
5
5
|
|
|
6
6
|
import { WebGLCubeRenderTarget } from '../../renderers/WebGLCubeRenderTarget.js';
|
|
7
7
|
import { Scene } from '../../scenes/Scene.js';
|
|
@@ -40,7 +40,7 @@ class CubeRenderTarget extends WebGLCubeRenderTarget {
|
|
|
40
40
|
|
|
41
41
|
const uvNode = equirectUV( positionWorldDirection );
|
|
42
42
|
|
|
43
|
-
const material =
|
|
43
|
+
const material = new NodeMaterial();
|
|
44
44
|
material.colorNode = TSL_Texture( texture, uvNode, 0 );
|
|
45
45
|
material.side = BackSide;
|
|
46
46
|
material.blending = NoBlending;
|
|
@@ -54,8 +54,14 @@ class CubeRenderTarget extends WebGLCubeRenderTarget {
|
|
|
54
54
|
if ( texture.minFilter === LinearMipmapLinearFilter ) texture.minFilter = LinearFilter;
|
|
55
55
|
|
|
56
56
|
const camera = new CubeCamera( 1, 10, this );
|
|
57
|
+
|
|
58
|
+
const currentMRT = renderer.getMRT();
|
|
59
|
+
renderer.setMRT( null );
|
|
60
|
+
|
|
57
61
|
camera.update( renderer, scene );
|
|
58
62
|
|
|
63
|
+
renderer.setMRT( currentMRT );
|
|
64
|
+
|
|
59
65
|
texture.minFilter = currentMinFilter;
|
|
60
66
|
texture.currentGenerateMipmaps = currentGenerateMipmaps;
|
|
61
67
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import NodeMaterial from '../../materials/nodes/NodeMaterial.js';
|
|
2
|
+
import { vec4, renderOutput } from '../../nodes/TSL.js';
|
|
2
3
|
import { LinearSRGBColorSpace, NoToneMapping } from '../../constants.js';
|
|
3
4
|
import QuadMesh from '../../renderers/common/QuadMesh.js';
|
|
4
5
|
|
|
@@ -16,6 +17,8 @@ class PostProcessing {
|
|
|
16
17
|
|
|
17
18
|
this.needsUpdate = true;
|
|
18
19
|
|
|
20
|
+
_material.name = 'PostProcessing';
|
|
21
|
+
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
render() {
|
|
@@ -38,6 +38,30 @@ class RenderContext {
|
|
|
38
38
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
getCacheKey() {
|
|
42
|
+
|
|
43
|
+
return getCacheKey( this );
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function getCacheKey( renderContext ) {
|
|
50
|
+
|
|
51
|
+
const { textures, activeCubeFace } = renderContext;
|
|
52
|
+
|
|
53
|
+
let key = '';
|
|
54
|
+
|
|
55
|
+
for ( const texture of textures ) {
|
|
56
|
+
|
|
57
|
+
key += texture.id + ',';
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
key += activeCubeFace;
|
|
62
|
+
|
|
63
|
+
return key;
|
|
64
|
+
|
|
41
65
|
}
|
|
42
66
|
|
|
43
67
|
export default RenderContext;
|
|
@@ -235,7 +235,7 @@ export default class RenderObject {
|
|
|
235
235
|
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
cacheKey += this.
|
|
238
|
+
cacheKey += this.clippingContext.cacheKey + ',';
|
|
239
239
|
|
|
240
240
|
if ( object.skeleton ) {
|
|
241
241
|
|
|
@@ -263,7 +263,7 @@ export default class RenderObject {
|
|
|
263
263
|
|
|
264
264
|
if ( object.count > 1 ) {
|
|
265
265
|
|
|
266
|
-
cacheKey += object.count + ',';
|
|
266
|
+
cacheKey += object.count + ',' + object.uuid + ',';
|
|
267
267
|
|
|
268
268
|
}
|
|
269
269
|
|
|
@@ -14,8 +14,9 @@ import Color4 from './Color4.js';
|
|
|
14
14
|
import ClippingContext from './ClippingContext.js';
|
|
15
15
|
import QuadMesh from './QuadMesh.js';
|
|
16
16
|
import RenderBundles from './RenderBundles.js';
|
|
17
|
+
import NodeLibrary from './nodes/NodeLibrary.js';
|
|
17
18
|
|
|
18
|
-
import
|
|
19
|
+
import NodeMaterial from '../../materials/nodes/NodeMaterial.js';
|
|
19
20
|
|
|
20
21
|
import { Scene } from '../../scenes/Scene.js';
|
|
21
22
|
import { Frustum } from '../../math/Frustum.js';
|
|
@@ -24,7 +25,7 @@ import { Vector2 } from '../../math/Vector2.js';
|
|
|
24
25
|
import { Vector3 } from '../../math/Vector3.js';
|
|
25
26
|
import { Vector4 } from '../../math/Vector4.js';
|
|
26
27
|
import { RenderTarget } from '../../core/RenderTarget.js';
|
|
27
|
-
import { DoubleSide, BackSide, FrontSide, SRGBColorSpace,
|
|
28
|
+
import { DoubleSide, BackSide, FrontSide, SRGBColorSpace, NoToneMapping, LinearFilter, LinearSRGBColorSpace, HalfFloatType, RGBAFormat, PCFShadowMap } from '../../constants.js';
|
|
28
29
|
|
|
29
30
|
const _scene = /*@__PURE__*/ new Scene();
|
|
30
31
|
const _drawingBufferSize = /*@__PURE__*/ new Vector2();
|
|
@@ -45,7 +46,8 @@ class Renderer {
|
|
|
45
46
|
logarithmicDepthBuffer = false,
|
|
46
47
|
alpha = true,
|
|
47
48
|
antialias = false,
|
|
48
|
-
samples = 0
|
|
49
|
+
samples = 0,
|
|
50
|
+
getFallback = null
|
|
49
51
|
} = parameters;
|
|
50
52
|
|
|
51
53
|
// public
|
|
@@ -78,8 +80,14 @@ class Renderer {
|
|
|
78
80
|
|
|
79
81
|
this.info = new Info();
|
|
80
82
|
|
|
83
|
+
this.nodes = {
|
|
84
|
+
library: new NodeLibrary()
|
|
85
|
+
};
|
|
86
|
+
|
|
81
87
|
// internals
|
|
82
88
|
|
|
89
|
+
this._getFallback = getFallback;
|
|
90
|
+
|
|
83
91
|
this._pixelRatio = 1;
|
|
84
92
|
this._width = this.domElement.width;
|
|
85
93
|
this._height = this.domElement.height;
|
|
@@ -102,6 +110,7 @@ class Renderer {
|
|
|
102
110
|
this._background = null;
|
|
103
111
|
|
|
104
112
|
this._quad = new QuadMesh( new NodeMaterial() );
|
|
113
|
+
this._quad.material.type = 'Renderer_output';
|
|
105
114
|
|
|
106
115
|
this._currentRenderContext = null;
|
|
107
116
|
|
|
@@ -147,7 +156,23 @@ class Renderer {
|
|
|
147
156
|
|
|
148
157
|
this.debug = {
|
|
149
158
|
checkShaderErrors: true,
|
|
150
|
-
onShaderError: null
|
|
159
|
+
onShaderError: null,
|
|
160
|
+
getShaderAsync: async ( scene, camera, object ) => {
|
|
161
|
+
|
|
162
|
+
await this.compileAsync( scene, camera );
|
|
163
|
+
|
|
164
|
+
const renderList = this._renderLists.get( scene, camera );
|
|
165
|
+
const renderContext = this._renderContexts.get( scene, camera, this._renderTarget );
|
|
166
|
+
|
|
167
|
+
const material = scene.overrideMaterial || object.material;
|
|
168
|
+
|
|
169
|
+
const renderObject = this._objects.get( object, material, scene, camera, renderList.lightsNode, renderContext );
|
|
170
|
+
|
|
171
|
+
const { fragmentShader, vertexShader } = renderObject.getNodeBuilderState();
|
|
172
|
+
|
|
173
|
+
return { fragmentShader, vertexShader };
|
|
174
|
+
|
|
175
|
+
}
|
|
151
176
|
};
|
|
152
177
|
|
|
153
178
|
}
|
|
@@ -168,7 +193,7 @@ class Renderer {
|
|
|
168
193
|
|
|
169
194
|
this._initPromise = new Promise( async ( resolve, reject ) => {
|
|
170
195
|
|
|
171
|
-
|
|
196
|
+
let backend = this.backend;
|
|
172
197
|
|
|
173
198
|
try {
|
|
174
199
|
|
|
@@ -176,8 +201,28 @@ class Renderer {
|
|
|
176
201
|
|
|
177
202
|
} catch ( error ) {
|
|
178
203
|
|
|
179
|
-
|
|
180
|
-
|
|
204
|
+
if ( this._getFallback !== null ) {
|
|
205
|
+
|
|
206
|
+
// try the fallback
|
|
207
|
+
|
|
208
|
+
try {
|
|
209
|
+
|
|
210
|
+
this.backend = backend = this._getFallback( error );
|
|
211
|
+
await backend.init( this );
|
|
212
|
+
|
|
213
|
+
} catch ( error ) {
|
|
214
|
+
|
|
215
|
+
reject( error );
|
|
216
|
+
return;
|
|
217
|
+
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
} else {
|
|
221
|
+
|
|
222
|
+
reject( error );
|
|
223
|
+
return;
|
|
224
|
+
|
|
225
|
+
}
|
|
181
226
|
|
|
182
227
|
}
|
|
183
228
|
|
|
@@ -366,13 +411,12 @@ class Renderer {
|
|
|
366
411
|
const { object, camera, renderList } = bundle;
|
|
367
412
|
|
|
368
413
|
const renderContext = this._currentRenderContext;
|
|
369
|
-
const renderContextData = this.backend.get( renderContext );
|
|
370
414
|
|
|
371
415
|
//
|
|
372
416
|
|
|
373
417
|
const renderBundle = this._bundles.get( object, camera );
|
|
374
|
-
|
|
375
418
|
const renderBundleData = this.backend.get( renderBundle );
|
|
419
|
+
|
|
376
420
|
if ( renderBundleData.renderContexts === undefined ) renderBundleData.renderContexts = new Set();
|
|
377
421
|
|
|
378
422
|
//
|
|
@@ -383,17 +427,11 @@ class Renderer {
|
|
|
383
427
|
|
|
384
428
|
if ( renderBundleNeedsUpdate ) {
|
|
385
429
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
const nodeFrame = this._nodes.nodeFrame;
|
|
430
|
+
this.backend.beginBundle( renderContext );
|
|
389
431
|
|
|
390
|
-
|
|
391
|
-
renderContextData.renderBundles = [];
|
|
392
|
-
renderContextData.scene = sceneRef;
|
|
393
|
-
renderContextData.camera = camera;
|
|
394
|
-
renderContextData.renderId = nodeFrame.renderId;
|
|
432
|
+
if ( renderBundleData.renderObjects === undefined || object.needsUpdate === true ) {
|
|
395
433
|
|
|
396
|
-
|
|
434
|
+
renderBundleData.renderObjects = [];
|
|
397
435
|
|
|
398
436
|
}
|
|
399
437
|
|
|
@@ -407,16 +445,17 @@ class Renderer {
|
|
|
407
445
|
|
|
408
446
|
//
|
|
409
447
|
|
|
448
|
+
this.backend.finishBundle( renderContext, renderBundle );
|
|
449
|
+
|
|
410
450
|
object.needsUpdate = false;
|
|
411
451
|
|
|
412
452
|
} else {
|
|
413
453
|
|
|
414
|
-
const
|
|
415
|
-
const renderContextData = this.backend.get( renderContext );
|
|
454
|
+
const renderObjects = renderBundleData.renderObjects;
|
|
416
455
|
|
|
417
|
-
for ( let i = 0, l =
|
|
456
|
+
for ( let i = 0, l = renderObjects.length; i < l; i ++ ) {
|
|
418
457
|
|
|
419
|
-
const renderObject =
|
|
458
|
+
const renderObject = renderObjects[ i ];
|
|
420
459
|
|
|
421
460
|
this._nodes.updateBefore( renderObject );
|
|
422
461
|
|
|
@@ -428,14 +467,14 @@ class Renderer {
|
|
|
428
467
|
this._nodes.updateForRender( renderObject );
|
|
429
468
|
this._bindings.updateForRender( renderObject );
|
|
430
469
|
|
|
431
|
-
this.backend.draw( renderObject, this.info );
|
|
432
|
-
|
|
433
470
|
this._nodes.updateAfter( renderObject );
|
|
434
471
|
|
|
435
472
|
}
|
|
436
473
|
|
|
437
474
|
}
|
|
438
475
|
|
|
476
|
+
this.backend.addBundle( renderContext, renderBundle );
|
|
477
|
+
|
|
439
478
|
}
|
|
440
479
|
|
|
441
480
|
render( scene, camera ) {
|
|
@@ -454,10 +493,10 @@ class Renderer {
|
|
|
454
493
|
|
|
455
494
|
_getFrameBufferTarget() {
|
|
456
495
|
|
|
457
|
-
const { currentColorSpace } = this;
|
|
496
|
+
const { currentToneMapping, currentColorSpace } = this;
|
|
458
497
|
|
|
459
|
-
const useToneMapping =
|
|
460
|
-
const useColorSpace =
|
|
498
|
+
const useToneMapping = currentToneMapping !== NoToneMapping;
|
|
499
|
+
const useColorSpace = currentColorSpace !== LinearSRGBColorSpace;
|
|
461
500
|
|
|
462
501
|
if ( useToneMapping === false && useColorSpace === false ) return null;
|
|
463
502
|
|
|
@@ -1049,19 +1088,15 @@ class Renderer {
|
|
|
1049
1088
|
|
|
1050
1089
|
}
|
|
1051
1090
|
|
|
1052
|
-
get
|
|
1053
|
-
|
|
1054
|
-
const renderTarget = this._renderTarget;
|
|
1055
|
-
|
|
1056
|
-
if ( renderTarget !== null ) {
|
|
1091
|
+
get currentToneMapping() {
|
|
1057
1092
|
|
|
1058
|
-
|
|
1093
|
+
return this._renderTarget !== null ? NoToneMapping : this.toneMapping;
|
|
1059
1094
|
|
|
1060
|
-
|
|
1095
|
+
}
|
|
1061
1096
|
|
|
1062
|
-
|
|
1097
|
+
get currentColorSpace() {
|
|
1063
1098
|
|
|
1064
|
-
return this.outputColorSpace;
|
|
1099
|
+
return this._renderTarget !== null ? LinearSRGBColorSpace : this.outputColorSpace;
|
|
1065
1100
|
|
|
1066
1101
|
}
|
|
1067
1102
|
|
|
@@ -1326,7 +1361,7 @@ class Renderer {
|
|
|
1326
1361
|
|
|
1327
1362
|
}
|
|
1328
1363
|
|
|
1329
|
-
if ( object.static === true ) {
|
|
1364
|
+
if ( object.static === true && this.backend.beginBundle !== undefined ) {
|
|
1330
1365
|
|
|
1331
1366
|
const baseRenderList = renderList;
|
|
1332
1367
|
|
|
@@ -1556,25 +1591,16 @@ class Renderer {
|
|
|
1556
1591
|
|
|
1557
1592
|
//
|
|
1558
1593
|
|
|
1559
|
-
if ( this._currentRenderBundle !== null
|
|
1594
|
+
if ( this._currentRenderBundle !== null ) {
|
|
1560
1595
|
|
|
1561
|
-
const
|
|
1596
|
+
const renderBundleData = this.backend.get( this._currentRenderBundle );
|
|
1562
1597
|
|
|
1563
|
-
|
|
1564
|
-
renderObjectData.lastPipelineGPU = undefined;
|
|
1598
|
+
renderBundleData.renderObjects.push( renderObject );
|
|
1565
1599
|
|
|
1566
1600
|
}
|
|
1567
1601
|
|
|
1568
1602
|
this.backend.draw( renderObject, this.info );
|
|
1569
1603
|
|
|
1570
|
-
if ( this._currentRenderBundle !== null ) {
|
|
1571
|
-
|
|
1572
|
-
const renderContextData = this.backend.get( this._currentRenderContext );
|
|
1573
|
-
|
|
1574
|
-
renderContextData.renderObjects.push( renderObject );
|
|
1575
|
-
|
|
1576
|
-
}
|
|
1577
|
-
|
|
1578
1604
|
this._nodes.updateAfter( renderObject );
|
|
1579
1605
|
|
|
1580
1606
|
}
|
|
@@ -13,16 +13,25 @@ class SampledTexture extends Binding {
|
|
|
13
13
|
this.texture = texture;
|
|
14
14
|
this.version = texture ? texture.version : 0;
|
|
15
15
|
this.store = false;
|
|
16
|
+
this.generation = null;
|
|
16
17
|
|
|
17
18
|
this.isSampledTexture = true;
|
|
18
19
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
needsBindingsUpdate( generation ) {
|
|
22
23
|
|
|
23
|
-
const { texture
|
|
24
|
+
const { texture } = this;
|
|
25
|
+
|
|
26
|
+
if ( generation !== this.generation ) {
|
|
27
|
+
|
|
28
|
+
this.generation = generation;
|
|
29
|
+
|
|
30
|
+
return true;
|
|
31
|
+
|
|
32
|
+
}
|
|
24
33
|
|
|
25
|
-
return texture.isVideoTexture
|
|
34
|
+
return texture.isVideoTexture;
|
|
26
35
|
|
|
27
36
|
}
|
|
28
37
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Renderer from './Renderer.js';
|
|
2
|
+
import StandardNodeLibrary from './nodes/StandardNodeLibrary.js';
|
|
3
|
+
|
|
4
|
+
class StandardRenderer extends Renderer {
|
|
5
|
+
|
|
6
|
+
constructor( backend, parameters = {} ) {
|
|
7
|
+
|
|
8
|
+
super( backend, parameters );
|
|
9
|
+
|
|
10
|
+
this.isStandardRenderer = true;
|
|
11
|
+
|
|
12
|
+
this.nodes.library = new StandardNodeLibrary();
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default StandardRenderer;
|
|
@@ -25,10 +25,9 @@ class Textures extends DataMap {
|
|
|
25
25
|
const sampleCount = renderTarget.samples === 0 ? 1 : renderTarget.samples;
|
|
26
26
|
const depthTextureMips = renderTargetData.depthTextureMips || ( renderTargetData.depthTextureMips = {} );
|
|
27
27
|
|
|
28
|
-
const texture = renderTarget.texture;
|
|
29
28
|
const textures = renderTarget.textures;
|
|
30
29
|
|
|
31
|
-
const size = this.getSize(
|
|
30
|
+
const size = this.getSize( textures[ 0 ] );
|
|
32
31
|
|
|
33
32
|
const mipWidth = size.width >> activeMipmapLevel;
|
|
34
33
|
const mipHeight = size.height >> activeMipmapLevel;
|
|
@@ -103,17 +102,9 @@ class Textures extends DataMap {
|
|
|
103
102
|
|
|
104
103
|
renderTarget.removeEventListener( 'dispose', onDispose );
|
|
105
104
|
|
|
106
|
-
|
|
105
|
+
for ( let i = 0; i < textures.length; i ++ ) {
|
|
107
106
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
this._destroyTexture( textures[ i ] );
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
} else {
|
|
115
|
-
|
|
116
|
-
this._destroyTexture( texture );
|
|
107
|
+
this._destroyTexture( textures[ i ] );
|
|
117
108
|
|
|
118
109
|
}
|
|
119
110
|
|
|
@@ -182,6 +173,8 @@ class Textures extends DataMap {
|
|
|
182
173
|
backend.createSampler( texture );
|
|
183
174
|
backend.createTexture( texture, options );
|
|
184
175
|
|
|
176
|
+
textureData.generation = texture.version;
|
|
177
|
+
|
|
185
178
|
} else {
|
|
186
179
|
|
|
187
180
|
const needsCreate = textureData.initialized !== true;
|
|
@@ -225,6 +218,7 @@ class Textures extends DataMap {
|
|
|
225
218
|
backend.createTexture( texture, options );
|
|
226
219
|
|
|
227
220
|
textureData.isDefaultTexture = false;
|
|
221
|
+
textureData.generation = texture.version;
|
|
228
222
|
|
|
229
223
|
}
|
|
230
224
|
|
|
@@ -241,6 +235,7 @@ class Textures extends DataMap {
|
|
|
241
235
|
backend.createDefaultTexture( texture );
|
|
242
236
|
|
|
243
237
|
textureData.isDefaultTexture = true;
|
|
238
|
+
textureData.generation = texture.version;
|
|
244
239
|
|
|
245
240
|
}
|
|
246
241
|
|
|
@@ -251,6 +246,7 @@ class Textures extends DataMap {
|
|
|
251
246
|
if ( textureData.initialized !== true ) {
|
|
252
247
|
|
|
253
248
|
textureData.initialized = true;
|
|
249
|
+
textureData.generation = texture.version;
|
|
254
250
|
|
|
255
251
|
//
|
|
256
252
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import NodeMaterial from '../../../nodes/
|
|
1
|
+
import NodeMaterial from '../../../materials/nodes/NodeMaterial.js';
|
|
2
2
|
import { getDirection, blur } from '../../../nodes/pmrem/PMREMUtils.js';
|
|
3
3
|
import { equirectUV } from '../../../nodes/utils/EquirectUVNode.js';
|
|
4
4
|
import { uniform } from '../../../nodes/core/UniformNode.js';
|
|
5
|
-
import {
|
|
5
|
+
import { uniformArray } from '../../../nodes/accessors/UniformArrayNode.js';
|
|
6
6
|
import { texture } from '../../../nodes/accessors/TextureNode.js';
|
|
7
7
|
import { cubeTexture } from '../../../nodes/accessors/CubeTextureNode.js';
|
|
8
|
-
import { float, vec3 } from '../../../nodes/
|
|
9
|
-
import { uv } from '../../../nodes/accessors/
|
|
8
|
+
import { float, vec3 } from '../../../nodes/tsl/TSLBase.js';
|
|
9
|
+
import { uv } from '../../../nodes/accessors/UV.js';
|
|
10
10
|
import { attribute } from '../../../nodes/core/AttributeNode.js';
|
|
11
11
|
|
|
12
12
|
import { OrthographicCamera } from '../../../cameras/OrthographicCamera.js';
|
|
@@ -698,19 +698,18 @@ function _createRenderTarget( width, height, params ) {
|
|
|
698
698
|
|
|
699
699
|
function _setViewport( target, x, y, width, height ) {
|
|
700
700
|
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
target.viewport.set( x, viewY, width, height );
|
|
704
|
-
target.scissor.set( x, viewY, width, height );
|
|
701
|
+
target.viewport.set( x, y, width, height );
|
|
702
|
+
target.scissor.set( x, y, width, height );
|
|
705
703
|
|
|
706
704
|
}
|
|
707
705
|
|
|
708
|
-
function _getMaterial() {
|
|
706
|
+
function _getMaterial( type ) {
|
|
709
707
|
|
|
710
708
|
const material = new NodeMaterial();
|
|
711
709
|
material.depthTest = false;
|
|
712
710
|
material.depthWrite = false;
|
|
713
711
|
material.blending = NoBlending;
|
|
712
|
+
material.name = `PMREM_${ type }`;
|
|
714
713
|
|
|
715
714
|
return material;
|
|
716
715
|
|
|
@@ -718,7 +717,7 @@ function _getMaterial() {
|
|
|
718
717
|
|
|
719
718
|
function _getBlurShader( lodMax, width, height ) {
|
|
720
719
|
|
|
721
|
-
const weights =
|
|
720
|
+
const weights = uniformArray( new Array( MAX_SAMPLES ).fill( 0 ) );
|
|
722
721
|
const poleAxis = uniform( new Vector3( 0, 1, 0 ) );
|
|
723
722
|
const dTheta = uniform( 0 );
|
|
724
723
|
const n = float( MAX_SAMPLES );
|
|
@@ -745,7 +744,7 @@ function _getBlurShader( lodMax, width, height ) {
|
|
|
745
744
|
CUBEUV_MAX_MIP
|
|
746
745
|
};
|
|
747
746
|
|
|
748
|
-
const material = _getMaterial();
|
|
747
|
+
const material = _getMaterial( 'blur' );
|
|
749
748
|
material.uniforms = materialUniforms; // TODO: Move to outside of the material
|
|
750
749
|
material.fragmentNode = blur( { ...materialUniforms, latitudinal: latitudinal.equal( 1 ) } );
|
|
751
750
|
|
|
@@ -755,7 +754,7 @@ function _getBlurShader( lodMax, width, height ) {
|
|
|
755
754
|
|
|
756
755
|
function _getCubemapMaterial( envTexture ) {
|
|
757
756
|
|
|
758
|
-
const material = _getMaterial();
|
|
757
|
+
const material = _getMaterial( 'cubemap' );
|
|
759
758
|
material.fragmentNode = cubeTexture( envTexture, outputDirection );
|
|
760
759
|
|
|
761
760
|
return material;
|
|
@@ -764,7 +763,7 @@ function _getCubemapMaterial( envTexture ) {
|
|
|
764
763
|
|
|
765
764
|
function _getEquirectMaterial( envTexture ) {
|
|
766
765
|
|
|
767
|
-
const material = _getMaterial();
|
|
766
|
+
const material = _getMaterial( 'equirect' );
|
|
768
767
|
material.fragmentNode = texture( envTexture, equirectUV( outputDirection ), 0 );
|
|
769
768
|
|
|
770
769
|
return material;
|
|
@@ -32,7 +32,7 @@ class NodeBuilderState {
|
|
|
32
32
|
|
|
33
33
|
if ( shared !== true ) {
|
|
34
34
|
|
|
35
|
-
const bindingsGroup = new BindGroup( instanceGroup.name );
|
|
35
|
+
const bindingsGroup = new BindGroup( instanceGroup.name, [], instanceGroup.index, instanceGroup );
|
|
36
36
|
bindings.push( bindingsGroup );
|
|
37
37
|
|
|
38
38
|
for ( const instanceBinding of instanceGroup.bindings ) {
|