@plastic-software/three 0.182.0 → 0.183.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/LICENSE +1 -1
- package/build/three.cjs +11520 -10877
- package/build/three.core.js +11732 -11340
- package/build/three.core.min.js +2 -2
- package/build/three.module.js +509 -262
- package/build/three.module.min.js +2 -2
- package/build/three.tsl.js +7 -11
- package/build/three.tsl.min.js +2 -2
- package/build/three.webgpu.js +3072 -2607
- package/build/three.webgpu.min.js +2 -2
- package/build/three.webgpu.nodes.js +3071 -2607
- package/build/three.webgpu.nodes.min.js +2 -2
- package/examples/jsm/Addons.js +0 -3
- package/examples/jsm/animation/CCDIKSolver.js +2 -2
- package/examples/jsm/controls/ArcballControls.js +3 -3
- package/examples/jsm/controls/OrbitControls.js +103 -0
- package/examples/jsm/effects/AnaglyphEffect.js +102 -7
- package/examples/jsm/environments/ColorEnvironment.js +59 -0
- package/examples/jsm/environments/RoomEnvironment.js +1 -0
- package/examples/jsm/exporters/EXRExporter.js +1 -1
- package/examples/jsm/exporters/GLTFExporter.js +131 -4
- package/examples/jsm/exporters/USDZExporter.js +22 -3
- package/examples/jsm/helpers/AnimationPathHelper.js +302 -0
- package/examples/jsm/helpers/ViewHelper.js +67 -8
- package/examples/jsm/inspector/Inspector.js +21 -5
- package/examples/jsm/inspector/tabs/Console.js +39 -5
- package/examples/jsm/inspector/tabs/Parameters.js +16 -0
- package/examples/jsm/inspector/ui/Style.js +25 -1
- package/examples/jsm/libs/meshopt_decoder.module.js +6 -5
- package/examples/jsm/lines/LineMaterial.js +6 -0
- package/examples/jsm/loaders/3MFLoader.js +2 -2
- package/examples/jsm/loaders/AMFLoader.js +2 -2
- package/examples/jsm/loaders/ColladaLoader.js +24 -4026
- package/examples/jsm/loaders/EXRLoader.js +5 -5
- package/examples/jsm/loaders/FBXLoader.js +2 -2
- package/examples/jsm/loaders/GCodeLoader.js +34 -8
- package/examples/jsm/loaders/GLTFLoader.js +122 -171
- package/examples/jsm/loaders/KMZLoader.js +5 -5
- package/examples/jsm/loaders/KTX2Loader.js +5 -5
- package/examples/jsm/loaders/LWOLoader.js +7 -39
- package/examples/jsm/loaders/NRRDLoader.js +2 -2
- package/examples/jsm/loaders/PCDLoader.js +3 -2
- package/examples/jsm/loaders/USDLoader.js +100 -40
- package/examples/jsm/loaders/UltraHDRLoader.js +182 -30
- package/examples/jsm/loaders/VRMLLoader.js +77 -0
- package/examples/jsm/loaders/VTKLoader.js +37 -24
- package/examples/jsm/loaders/collada/ColladaComposer.js +2950 -0
- package/examples/jsm/loaders/collada/ColladaParser.js +1962 -0
- package/examples/jsm/loaders/usd/USDAParser.js +447 -366
- package/examples/jsm/loaders/usd/USDCParser.js +1841 -6
- package/examples/jsm/loaders/usd/USDComposer.js +4041 -0
- package/examples/jsm/materials/LDrawConditionalLineNodeMaterial.js +2 -2
- package/examples/jsm/objects/LensflareMesh.js +1 -1
- package/examples/jsm/objects/Sky.js +76 -4
- package/examples/jsm/objects/SkyMesh.js +114 -7
- package/examples/jsm/objects/Water.js +4 -3
- package/examples/jsm/objects/Water2.js +5 -3
- package/examples/jsm/objects/WaterMesh.js +5 -7
- package/examples/jsm/physics/JoltPhysics.js +7 -5
- package/examples/jsm/physics/RapierPhysics.js +6 -4
- package/examples/jsm/postprocessing/EffectComposer.js +7 -5
- package/examples/jsm/postprocessing/RenderTransitionPass.js +1 -1
- package/examples/jsm/renderers/CSS3DRenderer.js +1 -1
- package/examples/jsm/renderers/SVGRenderer.js +2 -2
- package/examples/jsm/shaders/GTAOShader.js +19 -6
- package/examples/jsm/shaders/HalftoneShader.js +12 -1
- package/examples/jsm/shaders/PoissonDenoiseShader.js +6 -2
- package/examples/jsm/shaders/SAOShader.js +17 -4
- package/examples/jsm/shaders/SSAOShader.js +11 -1
- package/examples/jsm/shaders/SSRShader.js +6 -5
- package/examples/jsm/shaders/VignetteShader.js +1 -1
- package/examples/jsm/tsl/display/AfterImageNode.js +1 -1
- package/examples/jsm/tsl/display/AnaglyphPassNode.js +456 -16
- package/examples/jsm/tsl/display/AnamorphicNode.js +1 -1
- package/examples/jsm/tsl/display/BilateralBlurNode.js +364 -0
- package/examples/jsm/tsl/display/BloomNode.js +5 -5
- package/examples/jsm/tsl/display/CRT.js +150 -0
- package/examples/jsm/tsl/display/DenoiseNode.js +1 -1
- package/examples/jsm/tsl/display/DepthOfFieldNode.js +1 -1
- package/examples/jsm/tsl/display/DotScreenNode.js +1 -1
- package/examples/jsm/tsl/display/FXAANode.js +2 -2
- package/examples/jsm/tsl/display/GTAONode.js +2 -2
- package/examples/jsm/tsl/display/GaussianBlurNode.js +11 -2
- package/examples/jsm/tsl/display/GodraysNode.js +624 -0
- package/examples/jsm/tsl/display/LensflareNode.js +1 -1
- package/examples/jsm/tsl/display/Lut3DNode.js +1 -1
- package/examples/jsm/tsl/display/OutlineNode.js +3 -3
- package/examples/jsm/tsl/display/ParallaxBarrierPassNode.js +2 -2
- package/examples/jsm/tsl/display/PixelationPassNode.js +5 -5
- package/examples/jsm/tsl/display/RGBShiftNode.js +2 -2
- package/examples/jsm/tsl/display/RetroPassNode.js +263 -0
- package/examples/jsm/tsl/display/SMAANode.js +2 -2
- package/examples/jsm/tsl/display/SSAAPassNode.js +2 -2
- package/examples/jsm/tsl/display/SSGINode.js +2 -2
- package/examples/jsm/tsl/display/SSRNode.js +7 -7
- package/examples/jsm/tsl/display/SSSNode.js +2 -2
- package/examples/jsm/tsl/display/Shape.js +29 -0
- package/examples/jsm/tsl/display/SobelOperatorNode.js +2 -2
- package/examples/jsm/tsl/display/StereoPassNode.js +1 -2
- package/examples/jsm/tsl/display/TRAANode.js +9 -12
- package/examples/jsm/tsl/display/TransitionNode.js +1 -1
- package/examples/jsm/tsl/display/depthAwareBlend.js +80 -0
- package/examples/jsm/tsl/math/Bayer.js +40 -1
- package/examples/jsm/utils/LDrawUtils.js +1 -1
- package/package.json +11 -19
- package/src/Three.Core.js +1 -1
- package/src/Three.TSL.js +5 -9
- package/src/Three.WebGPU.Nodes.js +2 -0
- package/src/Three.WebGPU.js +3 -0
- package/src/Three.js +1 -0
- package/src/animation/AnimationAction.js +1 -1
- package/src/animation/AnimationClip.js +1 -1
- package/src/animation/AnimationMixer.js +6 -0
- package/src/animation/KeyframeTrack.js +46 -7
- package/src/animation/PropertyMixer.js +4 -4
- package/src/audio/Audio.js +1 -1
- package/src/audio/AudioListener.js +5 -3
- package/src/cameras/Camera.js +32 -2
- package/src/cameras/CubeCamera.js +20 -0
- package/src/constants.js +30 -1
- package/src/core/Clock.js +7 -0
- package/src/core/Object3D.js +56 -4
- package/src/core/RenderTarget.js +3 -4
- package/src/extras/PMREMGenerator.js +4 -8
- package/src/geometries/TorusGeometry.js +8 -3
- package/src/helpers/CameraHelper.js +3 -0
- package/src/helpers/DirectionalLightHelper.js +4 -1
- package/src/helpers/HemisphereLightHelper.js +3 -0
- package/src/helpers/PointLightHelper.js +0 -24
- package/src/helpers/SpotLightHelper.js +3 -0
- package/src/lights/LightShadow.js +15 -3
- package/src/lights/webgpu/IESSpotLight.js +2 -1
- package/src/loaders/Cache.js +28 -0
- package/src/loaders/FileLoader.js +1 -1
- package/src/loaders/ImageBitmapLoader.js +8 -3
- package/src/loaders/Loader.js +6 -0
- package/src/loaders/ObjectLoader.js +18 -1
- package/src/materials/MeshLambertMaterial.js +9 -0
- package/src/materials/MeshPhongMaterial.js +9 -0
- package/src/materials/nodes/Line2NodeMaterial.js +5 -5
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +2 -0
- package/src/materials/nodes/NodeMaterial.js +15 -24
- package/src/materials/nodes/manager/NodeMaterialObserver.js +9 -3
- package/src/math/Line3.js +3 -5
- package/src/math/MathUtils.js +10 -10
- package/src/math/Matrix4.js +35 -26
- package/src/math/Quaternion.js +3 -29
- package/src/math/Vector3.js +3 -3
- package/src/math/interpolants/BezierInterpolant.js +108 -0
- package/src/nodes/Nodes.js +87 -68
- package/src/nodes/TSL.js +2 -5
- package/src/nodes/accessors/Arrays.js +1 -1
- package/src/nodes/accessors/Bitangent.js +5 -5
- package/src/nodes/accessors/BufferAttributeNode.js +1 -1
- package/src/nodes/accessors/Camera.js +149 -28
- package/src/nodes/accessors/InstanceNode.js +105 -40
- package/src/nodes/accessors/Normal.js +9 -9
- package/src/nodes/accessors/Position.js +34 -2
- package/src/nodes/accessors/SceneProperties.js +53 -0
- package/src/nodes/accessors/SkinningNode.js +12 -24
- package/src/nodes/accessors/StorageBufferNode.js +0 -19
- package/src/nodes/accessors/StorageTextureNode.js +37 -1
- package/src/nodes/accessors/Tangent.js +3 -3
- package/src/nodes/accessors/Texture3DNode.js +6 -34
- package/src/nodes/accessors/TextureNode.js +58 -22
- package/src/nodes/accessors/UniformArrayNode.js +2 -0
- package/src/nodes/core/MRTNode.js +48 -2
- package/src/nodes/core/Node.js +29 -3
- package/src/nodes/core/NodeBuilder.js +115 -40
- package/src/nodes/core/NodeError.js +28 -0
- package/src/nodes/core/NodeUtils.js +5 -3
- package/src/nodes/core/OutputStructNode.js +12 -10
- package/src/nodes/core/ParameterNode.js +2 -1
- package/src/nodes/core/StackNode.js +9 -8
- package/src/nodes/core/StackTrace.js +139 -0
- package/src/nodes/core/StructNode.js +15 -0
- package/src/nodes/core/SubBuildNode.js +1 -1
- package/src/nodes/core/UniformNode.js +2 -1
- package/src/nodes/core/VarNode.js +1 -1
- package/src/nodes/core/VaryingNode.js +1 -18
- package/src/nodes/display/BlendModes.js +0 -64
- package/src/nodes/display/ColorAdjustment.js +17 -0
- package/src/nodes/display/ColorSpaceNode.js +3 -3
- package/src/nodes/display/NormalMapNode.js +2 -2
- package/src/nodes/display/PassNode.js +21 -2
- package/src/nodes/display/RenderOutputNode.js +3 -3
- package/src/nodes/display/ScreenNode.js +2 -1
- package/src/nodes/display/ToneMappingNode.js +1 -1
- package/src/nodes/display/ToonOutlinePassNode.js +2 -2
- package/src/nodes/display/ViewportDepthNode.js +52 -4
- package/src/nodes/display/ViewportTextureNode.js +21 -4
- package/src/nodes/fog/Fog.js +18 -35
- package/src/nodes/functions/PhysicalLightingModel.js +25 -3
- package/src/nodes/geometry/RangeNode.js +4 -2
- package/src/nodes/gpgpu/ComputeNode.js +5 -4
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +2 -1
- package/src/nodes/lighting/EnvironmentNode.js +28 -3
- package/src/nodes/lighting/PointShadowNode.js +24 -12
- package/src/nodes/lighting/ShadowFilterNode.js +15 -43
- package/src/nodes/lighting/ShadowNode.js +54 -32
- package/src/nodes/math/ConditionalNode.js +2 -2
- package/src/nodes/math/MathNode.js +3 -40
- package/src/nodes/math/OperatorNode.js +2 -1
- package/src/nodes/pmrem/PMREMUtils.js +9 -15
- package/src/nodes/tsl/TSLCore.js +13 -10
- package/src/nodes/utils/DebugNode.js +11 -11
- package/src/nodes/utils/JoinNode.js +2 -2
- package/src/nodes/utils/LoopNode.js +1 -1
- package/src/nodes/utils/MemberNode.js +1 -1
- package/src/nodes/utils/RTTNode.js +1 -1
- package/src/nodes/utils/ReflectorNode.js +2 -3
- package/src/nodes/utils/SpriteSheetUV.js +35 -0
- package/src/nodes/utils/UVUtils.js +4 -2
- package/src/objects/BatchedMesh.js +22 -12
- package/src/objects/InstancedMesh.js +11 -0
- package/src/renderers/WebGLRenderer.js +34 -60
- package/src/renderers/common/Backend.js +21 -0
- package/src/renderers/common/Background.js +7 -4
- package/src/renderers/common/BindGroup.js +1 -9
- package/src/renderers/common/Bindings.js +20 -5
- package/src/renderers/common/BlendMode.js +143 -0
- package/src/renderers/common/BundleGroup.js +1 -1
- package/src/renderers/common/CubeRenderTarget.js +50 -6
- package/src/renderers/common/Geometries.js +17 -3
- package/src/renderers/common/Lighting.js +5 -21
- package/src/renderers/common/Pipelines.js +4 -4
- package/src/renderers/common/PostProcessing.js +8 -206
- package/src/renderers/common/RenderBundles.js +2 -1
- package/src/renderers/common/RenderContext.js +16 -0
- package/src/renderers/common/RenderContexts.js +33 -56
- package/src/renderers/common/RenderLists.js +2 -1
- package/src/renderers/common/RenderObject.js +2 -3
- package/src/renderers/common/RenderObjectPipeline.js +40 -0
- package/src/renderers/common/RenderObjects.js +18 -2
- package/src/renderers/common/RenderPipeline.js +203 -17
- package/src/renderers/common/Renderer.js +207 -40
- package/src/renderers/common/Sampler.js +4 -4
- package/src/renderers/common/StorageBuffer.js +13 -1
- package/src/renderers/common/Textures.js +16 -0
- package/src/renderers/common/TimestampQueryPool.js +5 -3
- package/src/renderers/common/Uniform.js +8 -0
- package/src/renderers/common/UniformsGroup.js +60 -0
- package/src/renderers/common/XRManager.js +2 -2
- package/src/renderers/common/nodes/NodeBuilderState.js +1 -1
- package/src/renderers/common/nodes/{Nodes.js → NodeManager.js} +18 -6
- package/src/renderers/common/nodes/NodeStorageBuffer.js +13 -2
- package/src/renderers/shaders/ShaderChunk/batching_pars_vertex.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/color_fragment.glsl.js +1 -5
- package/src/renderers/shaders/ShaderChunk/color_pars_fragment.glsl.js +1 -5
- package/src/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js +1 -5
- package/src/renderers/shaders/ShaderChunk/color_vertex.glsl.js +8 -10
- package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +7 -11
- package/src/renderers/shaders/ShaderChunk/lights_fragment_end.glsl.js +6 -0
- package/src/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js +6 -2
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +23 -1
- package/src/renderers/shaders/ShaderChunk/packing.glsl.js +20 -4
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +55 -24
- package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +2 -0
- package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +2 -0
- package/src/renderers/shaders/ShaderLib/shadow.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib.js +4 -2
- package/src/renderers/shaders/UniformsLib.js +0 -3
- package/src/renderers/webgl/WebGLBackground.js +2 -2
- package/src/renderers/webgl/WebGLBindingStates.js +99 -27
- package/src/renderers/webgl/WebGLEnvironments.js +228 -0
- package/src/renderers/webgl/WebGLGeometries.js +10 -7
- package/src/renderers/webgl/WebGLMaterials.js +12 -0
- package/src/renderers/webgl/WebGLObjects.js +3 -1
- package/src/renderers/webgl/WebGLProgram.js +2 -2
- package/src/renderers/webgl/WebGLPrograms.js +10 -4
- package/src/renderers/webgl/WebGLRenderLists.js +15 -0
- package/src/renderers/webgl/WebGLShadowMap.js +5 -4
- package/src/renderers/webgl/WebGLState.js +12 -17
- package/src/renderers/webgl-fallback/WebGLBackend.js +71 -7
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +98 -29
- package/src/renderers/webgl-fallback/utils/WebGLState.js +168 -7
- package/src/renderers/webgpu/WebGPUBackend.js +58 -9
- package/src/renderers/webgpu/WebGPURenderer.js +1 -0
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +257 -45
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +8 -19
- package/src/renderers/webgpu/utils/WebGPUConstants.js +1 -1
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +56 -31
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +152 -200
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +25 -25
- package/src/renderers/webgpu/utils/WebGPUUtils.js +10 -6
- package/src/renderers/webxr/WebXRManager.js +2 -2
- package/src/textures/Texture.js +2 -2
- package/src/utils.js +246 -3
- package/examples/jsm/materials/MeshGouraudMaterial.js +0 -433
- package/examples/jsm/materials/MeshPostProcessingMaterial.js +0 -167
- package/examples/jsm/shaders/GodRaysShader.js +0 -333
- package/src/nodes/accessors/SceneNode.js +0 -145
- package/src/nodes/code/ScriptableNode.js +0 -726
- package/src/nodes/code/ScriptableValueNode.js +0 -253
- package/src/nodes/display/PosterizeNode.js +0 -65
- package/src/nodes/utils/SpriteSheetUVNode.js +0 -90
- package/src/renderers/webgl/WebGLCubeMaps.js +0 -99
- package/src/renderers/webgl/WebGLCubeUVMaps.js +0 -134
package/src/nodes/Nodes.js
CHANGED
|
@@ -6,143 +6,162 @@ export { default as ArrayNode } from './core/ArrayNode.js';
|
|
|
6
6
|
export { default as AssignNode } from './core/AssignNode.js';
|
|
7
7
|
export { default as AttributeNode } from './core/AttributeNode.js';
|
|
8
8
|
export { default as BypassNode } from './core/BypassNode.js';
|
|
9
|
-
export { default as IsolateNode } from './core/IsolateNode.js';
|
|
10
9
|
export { default as ConstNode } from './core/ConstNode.js';
|
|
11
10
|
export { default as ContextNode } from './core/ContextNode.js';
|
|
12
11
|
export { default as IndexNode } from './core/IndexNode.js';
|
|
12
|
+
export { default as InputNode } from './core/InputNode.js';
|
|
13
|
+
export { default as InspectorNode } from './core/InspectorNode.js';
|
|
14
|
+
export { default as IsolateNode } from './core/IsolateNode.js';
|
|
13
15
|
export { default as LightingModel } from './core/LightingModel.js';
|
|
16
|
+
export { default as MRTNode } from './core/MRTNode.js';
|
|
14
17
|
export { default as Node } from './core/Node.js';
|
|
15
|
-
export { default as VarNode } from './core/VarNode.js';
|
|
16
18
|
export { default as NodeAttribute } from './core/NodeAttribute.js';
|
|
17
19
|
export { default as NodeBuilder } from './core/NodeBuilder.js';
|
|
18
20
|
export { default as NodeCache } from './core/NodeCache.js';
|
|
19
21
|
export { default as NodeCode } from './core/NodeCode.js';
|
|
22
|
+
export { default as NodeError } from './core/NodeError.js';
|
|
20
23
|
export { default as NodeFrame } from './core/NodeFrame.js';
|
|
21
24
|
export { default as NodeFunctionInput } from './core/NodeFunctionInput.js';
|
|
22
25
|
export { default as NodeUniform } from './core/NodeUniform.js';
|
|
23
26
|
export { default as NodeVar } from './core/NodeVar.js';
|
|
24
27
|
export { default as NodeVarying } from './core/NodeVarying.js';
|
|
28
|
+
export { default as OutputStructNode } from './core/OutputStructNode.js';
|
|
25
29
|
export { default as ParameterNode } from './core/ParameterNode.js';
|
|
26
30
|
export { default as PropertyNode } from './core/PropertyNode.js';
|
|
27
31
|
export { default as StackNode } from './core/StackNode.js';
|
|
32
|
+
export { default as StackTrace } from './core/StackTrace.js';
|
|
33
|
+
export { default as StructNode } from './core/StructNode.js';
|
|
34
|
+
export { default as StructTypeNode } from './core/StructTypeNode.js';
|
|
35
|
+
export { default as SubBuildNode } from './core/SubBuildNode.js';
|
|
28
36
|
export { default as TempNode } from './core/TempNode.js';
|
|
29
37
|
export { default as UniformGroupNode } from './core/UniformGroupNode.js';
|
|
30
38
|
export { default as UniformNode } from './core/UniformNode.js';
|
|
39
|
+
export { default as VarNode } from './core/VarNode.js';
|
|
31
40
|
export { default as VaryingNode } from './core/VaryingNode.js';
|
|
32
|
-
export { default as StructNode } from './core/StructNode.js';
|
|
33
|
-
export { default as StructTypeNode } from './core/StructTypeNode.js';
|
|
34
|
-
export { default as OutputStructNode } from './core/OutputStructNode.js';
|
|
35
|
-
export { default as MRTNode } from './core/MRTNode.js';
|
|
36
|
-
export { default as SubBuildNode } from './core/SubBuildNode.js';
|
|
37
41
|
|
|
38
42
|
import * as NodeUtils from './core/NodeUtils.js';
|
|
39
43
|
export { NodeUtils };
|
|
40
44
|
|
|
41
|
-
// utils
|
|
42
|
-
export { default as ArrayElementNode } from './utils/ArrayElementNode.js';
|
|
43
|
-
export { default as ConvertNode } from './utils/ConvertNode.js';
|
|
44
|
-
export { default as FunctionOverloadingNode } from './utils/FunctionOverloadingNode.js';
|
|
45
|
-
export { default as JoinNode } from './utils/JoinNode.js';
|
|
46
|
-
export { default as LoopNode } from './utils/LoopNode.js';
|
|
47
|
-
export { default as MaxMipLevelNode } from './utils/MaxMipLevelNode.js';
|
|
48
|
-
export { default as RemapNode } from './utils/RemapNode.js';
|
|
49
|
-
export { default as RotateNode } from './utils/RotateNode.js';
|
|
50
|
-
export { default as SetNode } from './utils/SetNode.js';
|
|
51
|
-
export { default as SplitNode } from './utils/SplitNode.js';
|
|
52
|
-
export { default as SpriteSheetUVNode } from './utils/SpriteSheetUVNode.js';
|
|
53
|
-
export { default as StorageArrayElementNode } from './utils/StorageArrayElementNode.js';
|
|
54
|
-
export { default as ReflectorNode } from './utils/ReflectorNode.js';
|
|
55
|
-
export { default as RTTNode } from './utils/RTTNode.js';
|
|
56
|
-
export { default as MemberNode } from './utils/MemberNode.js';
|
|
57
|
-
export { default as DebugNode } from './utils/DebugNode.js';
|
|
58
|
-
export { default as EventNode } from './utils/EventNode.js';
|
|
59
|
-
|
|
60
|
-
// math
|
|
61
|
-
export { default as BitcastNode } from './math/BitcastNode.js';
|
|
62
|
-
|
|
63
45
|
// accessors
|
|
64
|
-
export { default as
|
|
46
|
+
export { default as BatchNode } from './accessors/BatchNode.js';
|
|
65
47
|
export { default as BufferAttributeNode } from './accessors/BufferAttributeNode.js';
|
|
66
48
|
export { default as BufferNode } from './accessors/BufferNode.js';
|
|
67
|
-
export { default as
|
|
49
|
+
export { default as BuiltinNode } from './accessors/BuiltinNode.js';
|
|
50
|
+
export { default as ClippingNode } from './accessors/ClippingNode.js';
|
|
68
51
|
export { default as CubeTextureNode } from './accessors/CubeTextureNode.js';
|
|
69
52
|
export { default as InstanceNode } from './accessors/InstanceNode.js';
|
|
70
53
|
export { default as InstancedMeshNode } from './accessors/InstancedMeshNode.js';
|
|
71
|
-
export { default as BatchNode } from './accessors/BatchNode.js';
|
|
72
54
|
export { default as MaterialNode } from './accessors/MaterialNode.js';
|
|
73
55
|
export { default as MaterialReferenceNode } from './accessors/MaterialReferenceNode.js';
|
|
74
|
-
export { default as RendererReferenceNode } from './accessors/RendererReferenceNode.js';
|
|
75
|
-
export { default as MorphNode } from './accessors/MorphNode.js';
|
|
76
56
|
export { default as ModelNode } from './accessors/ModelNode.js';
|
|
57
|
+
export { default as MorphNode } from './accessors/MorphNode.js';
|
|
77
58
|
export { default as Object3DNode } from './accessors/Object3DNode.js';
|
|
78
59
|
export { default as PointUVNode } from './accessors/PointUVNode.js';
|
|
60
|
+
export { default as ReferenceBaseNode } from './accessors/ReferenceBaseNode.js';
|
|
79
61
|
export { default as ReferenceNode } from './accessors/ReferenceNode.js';
|
|
62
|
+
export { default as RendererReferenceNode } from './accessors/RendererReferenceNode.js';
|
|
80
63
|
export { default as SkinningNode } from './accessors/SkinningNode.js';
|
|
81
|
-
export { default as SceneNode } from './accessors/SceneNode.js';
|
|
82
64
|
export { default as StorageBufferNode } from './accessors/StorageBufferNode.js';
|
|
83
|
-
export { default as TextureNode } from './accessors/TextureNode.js';
|
|
84
|
-
export { default as TextureSizeNode } from './accessors/TextureSizeNode.js';
|
|
85
65
|
export { default as StorageTextureNode } from './accessors/StorageTextureNode.js';
|
|
86
66
|
export { default as Texture3DNode } from './accessors/Texture3DNode.js';
|
|
67
|
+
export { default as TextureNode } from './accessors/TextureNode.js';
|
|
68
|
+
export { default as TextureSizeNode } from './accessors/TextureSizeNode.js';
|
|
69
|
+
export { default as UniformArrayNode } from './accessors/UniformArrayNode.js';
|
|
87
70
|
export { default as UserDataNode } from './accessors/UserDataNode.js';
|
|
71
|
+
export { default as VelocityNode } from './accessors/VelocityNode.js';
|
|
72
|
+
export { default as VertexColorNode } from './accessors/VertexColorNode.js';
|
|
73
|
+
|
|
74
|
+
// code
|
|
75
|
+
export { default as CodeNode } from './code/CodeNode.js';
|
|
76
|
+
export { default as ExpressionNode } from './code/ExpressionNode.js';
|
|
77
|
+
export { default as FunctionCallNode } from './code/FunctionCallNode.js';
|
|
78
|
+
export { default as FunctionNode } from './code/FunctionNode.js';
|
|
88
79
|
|
|
89
80
|
// display
|
|
90
81
|
export { default as BumpMapNode } from './display/BumpMapNode.js';
|
|
91
82
|
export { default as ColorSpaceNode } from './display/ColorSpaceNode.js';
|
|
92
83
|
export { default as FrontFacingNode } from './display/FrontFacingNode.js';
|
|
93
84
|
export { default as NormalMapNode } from './display/NormalMapNode.js';
|
|
94
|
-
export { default as PosterizeNode } from './display/PosterizeNode.js';
|
|
95
|
-
export { default as ToneMappingNode } from './display/ToneMappingNode.js';
|
|
96
|
-
export { default as ScreenNode } from './display/ScreenNode.js';
|
|
97
|
-
export { default as ViewportTextureNode } from './display/ViewportTextureNode.js';
|
|
98
|
-
export { default as ViewportSharedTextureNode } from './display/ViewportSharedTextureNode.js';
|
|
99
|
-
export { default as ViewportDepthTextureNode } from './display/ViewportDepthTextureNode.js';
|
|
100
|
-
export { default as ViewportDepthNode } from './display/ViewportDepthNode.js';
|
|
101
|
-
export { default as RenderOutputNode } from './display/RenderOutputNode.js';
|
|
102
85
|
export { default as PassNode } from './display/PassNode.js';
|
|
86
|
+
export { default as RenderOutputNode } from './display/RenderOutputNode.js';
|
|
87
|
+
export { default as ScreenNode } from './display/ScreenNode.js';
|
|
88
|
+
export { default as ToneMappingNode } from './display/ToneMappingNode.js';
|
|
103
89
|
export { default as ToonOutlinePassNode } from './display/ToonOutlinePassNode.js';
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
export { default as
|
|
107
|
-
export { default as
|
|
108
|
-
export { default as FunctionCallNode } from './code/FunctionCallNode.js';
|
|
109
|
-
export { default as FunctionNode } from './code/FunctionNode.js';
|
|
110
|
-
export { default as ScriptableNode } from './code/ScriptableNode.js';
|
|
111
|
-
export { default as ScriptableValueNode } from './code/ScriptableValueNode.js';
|
|
90
|
+
export { default as ViewportDepthNode } from './display/ViewportDepthNode.js';
|
|
91
|
+
export { default as ViewportDepthTextureNode } from './display/ViewportDepthTextureNode.js';
|
|
92
|
+
export { default as ViewportSharedTextureNode } from './display/ViewportSharedTextureNode.js';
|
|
93
|
+
export { default as ViewportTextureNode } from './display/ViewportTextureNode.js';
|
|
112
94
|
|
|
113
95
|
// geometry
|
|
114
96
|
export { default as RangeNode } from './geometry/RangeNode.js';
|
|
115
97
|
|
|
116
98
|
// gpgpu
|
|
99
|
+
export { default as AtomicFunctionNode } from './gpgpu/AtomicFunctionNode.js';
|
|
100
|
+
export { default as BarrierNode } from './gpgpu/BarrierNode.js';
|
|
101
|
+
export { default as ComputeBuiltinNode } from './gpgpu/ComputeBuiltinNode.js';
|
|
117
102
|
export { default as ComputeNode } from './gpgpu/ComputeNode.js';
|
|
103
|
+
export { default as SubgroupFunctionNode } from './gpgpu/SubgroupFunctionNode.js';
|
|
104
|
+
export { default as WorkgroupInfoNode } from './gpgpu/WorkgroupInfoNode.js';
|
|
118
105
|
|
|
119
106
|
// lighting
|
|
120
|
-
export { default as
|
|
107
|
+
export { default as AmbientLightNode } from './lighting/AmbientLightNode.js';
|
|
108
|
+
export { default as AnalyticLightNode } from './lighting/AnalyticLightNode.js';
|
|
109
|
+
export { default as AONode } from './lighting/AONode.js';
|
|
110
|
+
export { default as BasicEnvironmentNode } from './lighting/BasicEnvironmentNode.js';
|
|
111
|
+
export { default as BasicLightMapNode } from './lighting/BasicLightMapNode.js';
|
|
121
112
|
export { default as DirectionalLightNode } from './lighting/DirectionalLightNode.js';
|
|
122
|
-
export { default as
|
|
123
|
-
export { default as
|
|
113
|
+
export { default as EnvironmentNode } from './lighting/EnvironmentNode.js';
|
|
114
|
+
export { default as HemisphereLightNode } from './lighting/HemisphereLightNode.js';
|
|
124
115
|
export { default as IESSpotLightNode } from './lighting/IESSpotLightNode.js';
|
|
125
|
-
export { default as
|
|
126
|
-
export { default as AmbientLightNode } from './lighting/AmbientLightNode.js';
|
|
127
|
-
export { default as LightsNode } from './lighting/LightsNode.js';
|
|
128
|
-
export { default as LightingNode } from './lighting/LightingNode.js';
|
|
116
|
+
export { default as IrradianceNode } from './lighting/IrradianceNode.js';
|
|
129
117
|
export { default as LightingContextNode } from './lighting/LightingContextNode.js';
|
|
130
|
-
export { default as
|
|
118
|
+
export { default as LightingNode } from './lighting/LightingNode.js';
|
|
131
119
|
export { default as LightProbeNode } from './lighting/LightProbeNode.js';
|
|
132
|
-
export { default as
|
|
133
|
-
export { default as
|
|
134
|
-
export { default as
|
|
135
|
-
export { default as
|
|
136
|
-
export { default as
|
|
120
|
+
export { default as LightsNode } from './lighting/LightsNode.js';
|
|
121
|
+
export { default as PointLightNode } from './lighting/PointLightNode.js';
|
|
122
|
+
export { default as PointShadowNode } from './lighting/PointShadowNode.js';
|
|
123
|
+
export { default as ProjectorLightNode } from './lighting/ProjectorLightNode.js';
|
|
124
|
+
export { default as RectAreaLightNode } from './lighting/RectAreaLightNode.js';
|
|
137
125
|
export { default as ShadowBaseNode } from './lighting/ShadowBaseNode.js';
|
|
138
126
|
export { default as ShadowNode } from './lighting/ShadowNode.js';
|
|
127
|
+
export { default as SpotLightNode } from './lighting/SpotLightNode.js';
|
|
139
128
|
|
|
140
|
-
//
|
|
141
|
-
export { default as
|
|
129
|
+
// math
|
|
130
|
+
export { default as BitcastNode } from './math/BitcastNode.js';
|
|
131
|
+
export { default as BitcountNode } from './math/BitcountNode.js';
|
|
132
|
+
export { default as ConditionalNode } from './math/ConditionalNode.js';
|
|
133
|
+
export { default as MathNode } from './math/MathNode.js';
|
|
134
|
+
export { default as OperatorNode } from './math/OperatorNode.js';
|
|
135
|
+
export { default as PackFloatNode } from './math/PackFloatNode.js';
|
|
136
|
+
export { default as UnpackFloatNode } from './math/UnpackFloatNode.js';
|
|
142
137
|
|
|
143
138
|
// parsers
|
|
144
139
|
export { default as GLSLNodeParser } from './parsers/GLSLNodeParser.js'; // @TODO: Move to jsm/renderers/webgl.
|
|
145
140
|
|
|
141
|
+
// pmrem
|
|
142
|
+
export { default as PMREMNode } from './pmrem/PMREMNode.js';
|
|
143
|
+
|
|
144
|
+
// utils
|
|
145
|
+
export { default as ArrayElementNode } from './utils/ArrayElementNode.js';
|
|
146
|
+
export { default as ConvertNode } from './utils/ConvertNode.js';
|
|
147
|
+
export { default as CubeMapNode } from './utils/CubeMapNode.js';
|
|
148
|
+
export { default as DebugNode } from './utils/DebugNode.js';
|
|
149
|
+
export { default as EventNode } from './utils/EventNode.js';
|
|
150
|
+
export { default as FlipNode } from './utils/FlipNode.js';
|
|
151
|
+
export { default as FunctionOverloadingNode } from './utils/FunctionOverloadingNode.js';
|
|
152
|
+
export { default as JoinNode } from './utils/JoinNode.js';
|
|
153
|
+
export { default as LoopNode } from './utils/LoopNode.js';
|
|
154
|
+
export { default as MaxMipLevelNode } from './utils/MaxMipLevelNode.js';
|
|
155
|
+
export { default as MemberNode } from './utils/MemberNode.js';
|
|
156
|
+
export { default as ReflectorNode } from './utils/ReflectorNode.js';
|
|
157
|
+
export { default as RemapNode } from './utils/RemapNode.js';
|
|
158
|
+
export { default as RotateNode } from './utils/RotateNode.js';
|
|
159
|
+
export { default as RTTNode } from './utils/RTTNode.js';
|
|
160
|
+
export { default as SampleNode } from './utils/SampleNode.js';
|
|
161
|
+
export { default as SetNode } from './utils/SetNode.js';
|
|
162
|
+
export { default as SplitNode } from './utils/SplitNode.js';
|
|
163
|
+
export { default as StorageArrayElementNode } from './utils/StorageArrayElementNode.js';
|
|
164
|
+
|
|
146
165
|
// lighting models
|
|
147
166
|
export { default as PhongLightingModel } from './functions/PhongLightingModel.js';
|
|
148
167
|
export { default as PhysicalLightingModel } from './functions/PhysicalLightingModel.js';
|
package/src/nodes/TSL.js
CHANGED
|
@@ -40,7 +40,7 @@ export * from './utils/UVUtils.js';
|
|
|
40
40
|
export * from './utils/SpriteUtils.js';
|
|
41
41
|
export * from './utils/ViewportUtils.js';
|
|
42
42
|
export * from './utils/RotateNode.js';
|
|
43
|
-
export * from './utils/
|
|
43
|
+
export * from './utils/SpriteSheetUV.js';
|
|
44
44
|
export * from './utils/Timer.js';
|
|
45
45
|
export * from './utils/TriplanarTextures.js';
|
|
46
46
|
export * from './utils/ReflectorNode.js';
|
|
@@ -81,7 +81,7 @@ export * from './accessors/Position.js';
|
|
|
81
81
|
export * from './accessors/ReferenceNode.js';
|
|
82
82
|
export * from './accessors/ReflectVector.js';
|
|
83
83
|
export * from './accessors/SkinningNode.js';
|
|
84
|
-
export * from './accessors/
|
|
84
|
+
export * from './accessors/SceneProperties.js';
|
|
85
85
|
export * from './accessors/StorageBufferNode.js';
|
|
86
86
|
export * from './accessors/Tangent.js';
|
|
87
87
|
export * from './accessors/TextureNode.js';
|
|
@@ -99,7 +99,6 @@ export * from './display/ColorAdjustment.js';
|
|
|
99
99
|
export * from './display/ColorSpaceNode.js';
|
|
100
100
|
export * from './display/FrontFacingNode.js';
|
|
101
101
|
export * from './display/NormalMapNode.js';
|
|
102
|
-
export * from './display/PosterizeNode.js';
|
|
103
102
|
export * from './display/ToneMappingNode.js';
|
|
104
103
|
export * from './display/ScreenNode.js';
|
|
105
104
|
export * from './display/ViewportTextureNode.js';
|
|
@@ -119,8 +118,6 @@ export * from './code/ExpressionNode.js';
|
|
|
119
118
|
export * from './code/CodeNode.js';
|
|
120
119
|
export * from './code/FunctionCallNode.js';
|
|
121
120
|
export * from './code/FunctionNode.js';
|
|
122
|
-
export * from './code/ScriptableNode.js';
|
|
123
|
-
export * from './code/ScriptableValueNode.js';
|
|
124
121
|
|
|
125
122
|
// fog
|
|
126
123
|
export * from './fog/Fog.js';
|
|
@@ -61,7 +61,7 @@ export const instancedArray = ( count, type = 'float' ) => {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
const buffer = new StorageInstancedBufferAttribute( count, itemSize, typedArray );
|
|
64
|
-
const node = storage( buffer, type, count );
|
|
64
|
+
const node = storage( buffer, type, buffer.count );
|
|
65
65
|
|
|
66
66
|
return node;
|
|
67
67
|
|
|
@@ -13,11 +13,11 @@ import { directionToFaceDirection } from '../display/FrontFacingNode.js';
|
|
|
13
13
|
* @param {string} varyingName - The name of the varying to assign the bitangent to.
|
|
14
14
|
* @returns {Node<vec3>} The bitangent node.
|
|
15
15
|
*/
|
|
16
|
-
const getBitangent = /*@__PURE__*/ Fn( ( [ crossNormalTangent, varyingName ],
|
|
16
|
+
const getBitangent = /*@__PURE__*/ Fn( ( [ crossNormalTangent, varyingName ], builder ) => {
|
|
17
17
|
|
|
18
18
|
let bitangent = crossNormalTangent.mul( tangentGeometry.w ).xyz;
|
|
19
19
|
|
|
20
|
-
if ( subBuildFn === 'NORMAL' &&
|
|
20
|
+
if ( builder.subBuildFn === 'NORMAL' && builder.isFlatShading() !== true ) {
|
|
21
21
|
|
|
22
22
|
bitangent = bitangent.toVarying( varyingName );
|
|
23
23
|
|
|
@@ -49,11 +49,11 @@ export const bitangentLocal = /*@__PURE__*/ getBitangent( normalLocal.cross( tan
|
|
|
49
49
|
* @tsl
|
|
50
50
|
* @type {Node<vec3>}
|
|
51
51
|
*/
|
|
52
|
-
export const bitangentView = /*@__PURE__*/ ( Fn( (
|
|
52
|
+
export const bitangentView = /*@__PURE__*/ ( Fn( ( builder ) => {
|
|
53
53
|
|
|
54
54
|
let node;
|
|
55
55
|
|
|
56
|
-
if ( subBuildFn === 'VERTEX' || geometry.hasAttribute( 'tangent' ) ) {
|
|
56
|
+
if ( builder.subBuildFn === 'VERTEX' || builder.geometry.hasAttribute( 'tangent' ) ) {
|
|
57
57
|
|
|
58
58
|
node = getBitangent( normalView.cross( tangentView ), 'v_bitangentView' ).normalize();
|
|
59
59
|
|
|
@@ -63,7 +63,7 @@ export const bitangentView = /*@__PURE__*/ ( Fn( ( { subBuildFn, geometry, mater
|
|
|
63
63
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
if (
|
|
66
|
+
if ( builder.isFlatShading() !== true ) {
|
|
67
67
|
|
|
68
68
|
node = directionToFaceDirection( node );
|
|
69
69
|
|
|
@@ -366,7 +366,7 @@ function createBufferAttribute( array, type = null, stride = 0, offset = 0, usag
|
|
|
366
366
|
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
-
return new BufferAttributeNode( array, type, stride, offset );
|
|
369
|
+
return new BufferAttributeNode( array, type, stride, offset ).setUsage( usage );
|
|
370
370
|
|
|
371
371
|
}
|
|
372
372
|
|
|
@@ -6,6 +6,29 @@ import { uniformArray } from './UniformArrayNode.js';
|
|
|
6
6
|
import { builtin } from './BuiltinNode.js';
|
|
7
7
|
import { screenSize } from '../display/ScreenNode.js';
|
|
8
8
|
|
|
9
|
+
// Cache node uniforms
|
|
10
|
+
|
|
11
|
+
let _cameraProjectionMatrixBase = null;
|
|
12
|
+
let _cameraProjectionMatrixArray = null;
|
|
13
|
+
|
|
14
|
+
let _cameraProjectionMatrixInverseBase = null;
|
|
15
|
+
let _cameraProjectionMatrixInverseArray = null;
|
|
16
|
+
|
|
17
|
+
let _cameraViewMatrixBase = null;
|
|
18
|
+
let _cameraViewMatrixArray = null;
|
|
19
|
+
|
|
20
|
+
let _cameraWorldMatrixBase = null;
|
|
21
|
+
let _cameraWorldMatrixArray = null;
|
|
22
|
+
|
|
23
|
+
let _cameraNormalMatrixBase = null;
|
|
24
|
+
let _cameraNormalMatrixArray = null;
|
|
25
|
+
|
|
26
|
+
let _cameraPositionBase = null;
|
|
27
|
+
let _cameraPositionArray = null;
|
|
28
|
+
|
|
29
|
+
let _cameraViewportBase = null;
|
|
30
|
+
let _cameraViewportArray = null;
|
|
31
|
+
|
|
9
32
|
/**
|
|
10
33
|
* TSL object that represents the current `index` value of the camera if used ArrayCamera.
|
|
11
34
|
*
|
|
@@ -50,13 +73,27 @@ export const cameraProjectionMatrix = /*@__PURE__*/ ( Fn( ( { camera } ) => {
|
|
|
50
73
|
|
|
51
74
|
}
|
|
52
75
|
|
|
53
|
-
|
|
76
|
+
if ( _cameraProjectionMatrixArray === null ) {
|
|
77
|
+
|
|
78
|
+
_cameraProjectionMatrixArray = uniformArray( matrices ).setGroup( renderGroup ).setName( 'cameraProjectionMatrices' );
|
|
54
79
|
|
|
55
|
-
|
|
80
|
+
} else {
|
|
81
|
+
|
|
82
|
+
_cameraProjectionMatrixArray.array = matrices;
|
|
83
|
+
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
cameraProjectionMatrix = _cameraProjectionMatrixArray.element( camera.isMultiViewCamera ? builtin( 'gl_ViewID_OVR' ) : cameraIndex ).toConst( 'cameraProjectionMatrix' );
|
|
56
87
|
|
|
57
88
|
} else {
|
|
58
89
|
|
|
59
|
-
|
|
90
|
+
if ( _cameraProjectionMatrixBase === null ) {
|
|
91
|
+
|
|
92
|
+
_cameraProjectionMatrixBase = uniform( camera.projectionMatrix ).setName( 'cameraProjectionMatrix' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.projectionMatrix );
|
|
93
|
+
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
cameraProjectionMatrix = _cameraProjectionMatrixBase;
|
|
60
97
|
|
|
61
98
|
}
|
|
62
99
|
|
|
@@ -84,13 +121,27 @@ export const cameraProjectionMatrixInverse = /*@__PURE__*/ ( Fn( ( { camera } )
|
|
|
84
121
|
|
|
85
122
|
}
|
|
86
123
|
|
|
87
|
-
|
|
124
|
+
if ( _cameraProjectionMatrixInverseArray === null ) {
|
|
125
|
+
|
|
126
|
+
_cameraProjectionMatrixInverseArray = uniformArray( matrices ).setGroup( renderGroup ).setName( 'cameraProjectionMatricesInverse' );
|
|
88
127
|
|
|
89
|
-
|
|
128
|
+
} else {
|
|
129
|
+
|
|
130
|
+
_cameraProjectionMatrixInverseArray.array = matrices;
|
|
131
|
+
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
cameraProjectionMatrixInverse = _cameraProjectionMatrixInverseArray.element( camera.isMultiViewCamera ? builtin( 'gl_ViewID_OVR' ) : cameraIndex ).toConst( 'cameraProjectionMatrixInverse' );
|
|
90
135
|
|
|
91
136
|
} else {
|
|
92
137
|
|
|
93
|
-
|
|
138
|
+
if ( _cameraProjectionMatrixInverseBase === null ) {
|
|
139
|
+
|
|
140
|
+
_cameraProjectionMatrixInverseBase = uniform( camera.projectionMatrixInverse ).setName( 'cameraProjectionMatrixInverse' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.projectionMatrixInverse );
|
|
141
|
+
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
cameraProjectionMatrixInverse = _cameraProjectionMatrixInverseBase;
|
|
94
145
|
|
|
95
146
|
}
|
|
96
147
|
|
|
@@ -118,13 +169,27 @@ export const cameraViewMatrix = /*@__PURE__*/ ( Fn( ( { camera } ) => {
|
|
|
118
169
|
|
|
119
170
|
}
|
|
120
171
|
|
|
121
|
-
|
|
172
|
+
if ( _cameraViewMatrixArray === null ) {
|
|
173
|
+
|
|
174
|
+
_cameraViewMatrixArray = uniformArray( matrices ).setGroup( renderGroup ).setName( 'cameraViewMatrices' );
|
|
122
175
|
|
|
123
|
-
|
|
176
|
+
} else {
|
|
177
|
+
|
|
178
|
+
_cameraViewMatrixArray.array = matrices;
|
|
179
|
+
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
cameraViewMatrix = _cameraViewMatrixArray.element( camera.isMultiViewCamera ? builtin( 'gl_ViewID_OVR' ) : cameraIndex ).toConst( 'cameraViewMatrix' );
|
|
124
183
|
|
|
125
184
|
} else {
|
|
126
185
|
|
|
127
|
-
|
|
186
|
+
if ( _cameraViewMatrixBase === null ) {
|
|
187
|
+
|
|
188
|
+
_cameraViewMatrixBase = uniform( camera.matrixWorldInverse ).setName( 'cameraViewMatrix' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.matrixWorldInverse );
|
|
189
|
+
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
cameraViewMatrix = _cameraViewMatrixBase;
|
|
128
193
|
|
|
129
194
|
}
|
|
130
195
|
|
|
@@ -152,13 +217,27 @@ export const cameraWorldMatrix = /*@__PURE__*/ ( Fn( ( { camera } ) => {
|
|
|
152
217
|
|
|
153
218
|
}
|
|
154
219
|
|
|
155
|
-
|
|
220
|
+
if ( _cameraWorldMatrixArray === null ) {
|
|
221
|
+
|
|
222
|
+
_cameraWorldMatrixArray = uniformArray( matrices ).setGroup( renderGroup ).setName( 'cameraWorldMatrices' );
|
|
156
223
|
|
|
157
|
-
|
|
224
|
+
} else {
|
|
225
|
+
|
|
226
|
+
_cameraWorldMatrixArray.array = matrices;
|
|
227
|
+
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
cameraWorldMatrix = _cameraWorldMatrixArray.element( camera.isMultiViewCamera ? builtin( 'gl_ViewID_OVR' ) : cameraIndex ).toConst( 'cameraWorldMatrix' );
|
|
158
231
|
|
|
159
232
|
} else {
|
|
160
233
|
|
|
161
|
-
|
|
234
|
+
if ( _cameraWorldMatrixBase === null ) {
|
|
235
|
+
|
|
236
|
+
_cameraWorldMatrixBase = uniform( camera.matrixWorld ).setName( 'cameraWorldMatrix' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.matrixWorld );
|
|
237
|
+
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
cameraWorldMatrix = _cameraWorldMatrixBase;
|
|
162
241
|
|
|
163
242
|
}
|
|
164
243
|
|
|
@@ -186,13 +265,27 @@ export const cameraNormalMatrix = /*@__PURE__*/ ( Fn( ( { camera } ) => {
|
|
|
186
265
|
|
|
187
266
|
}
|
|
188
267
|
|
|
189
|
-
|
|
268
|
+
if ( _cameraNormalMatrixArray === null ) {
|
|
269
|
+
|
|
270
|
+
_cameraNormalMatrixArray = uniformArray( matrices ).setGroup( renderGroup ).setName( 'cameraNormalMatrices' );
|
|
190
271
|
|
|
191
|
-
|
|
272
|
+
} else {
|
|
273
|
+
|
|
274
|
+
_cameraNormalMatrixArray.array = matrices;
|
|
275
|
+
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
cameraNormalMatrix = _cameraNormalMatrixArray.element( camera.isMultiViewCamera ? builtin( 'gl_ViewID_OVR' ) : cameraIndex ).toConst( 'cameraNormalMatrix' );
|
|
192
279
|
|
|
193
280
|
} else {
|
|
194
281
|
|
|
195
|
-
|
|
282
|
+
if ( _cameraNormalMatrixBase === null ) {
|
|
283
|
+
|
|
284
|
+
_cameraNormalMatrixBase = uniform( camera.normalMatrix ).setName( 'cameraNormalMatrix' ).setGroup( renderGroup ).onRenderUpdate( ( { camera } ) => camera.normalMatrix );
|
|
285
|
+
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
cameraNormalMatrix = _cameraNormalMatrixBase;
|
|
196
289
|
|
|
197
290
|
}
|
|
198
291
|
|
|
@@ -220,24 +313,38 @@ export const cameraPosition = /*@__PURE__*/ ( Fn( ( { camera } ) => {
|
|
|
220
313
|
|
|
221
314
|
}
|
|
222
315
|
|
|
223
|
-
|
|
316
|
+
if ( _cameraPositionArray === null ) {
|
|
317
|
+
|
|
318
|
+
_cameraPositionArray = uniformArray( positions ).setGroup( renderGroup ).setName( 'cameraPositions' ).onRenderUpdate( ( { camera }, self ) => {
|
|
224
319
|
|
|
225
|
-
|
|
226
|
-
|
|
320
|
+
const subCameras = camera.cameras;
|
|
321
|
+
const array = self.array;
|
|
227
322
|
|
|
228
|
-
|
|
323
|
+
for ( let i = 0, l = subCameras.length; i < l; i ++ ) {
|
|
229
324
|
|
|
230
|
-
|
|
325
|
+
array[ i ].setFromMatrixPosition( subCameras[ i ].matrixWorld );
|
|
231
326
|
|
|
232
|
-
|
|
327
|
+
}
|
|
233
328
|
|
|
234
|
-
|
|
329
|
+
} );
|
|
235
330
|
|
|
236
|
-
|
|
331
|
+
} else {
|
|
332
|
+
|
|
333
|
+
_cameraPositionArray.array = positions;
|
|
334
|
+
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
cameraPosition = _cameraPositionArray.element( camera.isMultiViewCamera ? builtin( 'gl_ViewID_OVR' ) : cameraIndex ).toConst( 'cameraPosition' );
|
|
237
338
|
|
|
238
339
|
} else {
|
|
239
340
|
|
|
240
|
-
|
|
341
|
+
if ( _cameraPositionBase === null ) {
|
|
342
|
+
|
|
343
|
+
_cameraPositionBase = uniform( new Vector3() ).setName( 'cameraPosition' ).setGroup( renderGroup ).onRenderUpdate( ( { camera }, self ) => self.value.setFromMatrixPosition( camera.matrixWorld ) );
|
|
344
|
+
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
cameraPosition = _cameraPositionBase;
|
|
241
348
|
|
|
242
349
|
}
|
|
243
350
|
|
|
@@ -266,14 +373,28 @@ export const cameraViewport = /*@__PURE__*/ ( Fn( ( { camera } ) => {
|
|
|
266
373
|
|
|
267
374
|
}
|
|
268
375
|
|
|
269
|
-
|
|
376
|
+
if ( _cameraViewportArray === null ) {
|
|
377
|
+
|
|
378
|
+
_cameraViewportArray = uniformArray( viewports, 'vec4' ).setGroup( renderGroup ).setName( 'cameraViewports' );
|
|
270
379
|
|
|
271
|
-
|
|
380
|
+
} else {
|
|
381
|
+
|
|
382
|
+
_cameraViewportArray.array = viewports;
|
|
383
|
+
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
cameraViewport = _cameraViewportArray.element( cameraIndex ).toConst( 'cameraViewport' );
|
|
272
387
|
|
|
273
388
|
} else {
|
|
274
389
|
|
|
275
|
-
|
|
276
|
-
|
|
390
|
+
if ( _cameraViewportBase === null ) {
|
|
391
|
+
|
|
392
|
+
// Fallback for single camera
|
|
393
|
+
_cameraViewportBase = vec4( 0, 0, screenSize.x, screenSize.y ).toConst( 'cameraViewport' );
|
|
394
|
+
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
cameraViewport = _cameraViewportBase;
|
|
277
398
|
|
|
278
399
|
}
|
|
279
400
|
|