super-three 0.165.0 → 0.167.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 +706 -383
- package/build/three.module.js +702 -384
- package/build/three.module.min.js +1 -1
- package/build/three.webgpu.js +76086 -0
- package/build/three.webgpu.min.js +6 -0
- package/examples/jsm/Addons.js +2 -1
- package/examples/jsm/csm/CSMShader.js +4 -4
- package/examples/jsm/exporters/GLTFExporter.js +7 -3
- package/examples/jsm/geometries/TeapotGeometry.js +1 -1
- package/examples/jsm/helpers/ViewHelper.js +51 -2
- package/examples/jsm/libs/tween.module.js +64 -75
- package/examples/jsm/lights/RectAreaLightTexturesLib.js +91 -0
- package/examples/jsm/lights/RectAreaLightUniformsLib.js +8 -63
- package/examples/jsm/lines/webgpu/Line2.js +20 -0
- package/examples/jsm/lines/webgpu/LineSegments2.js +376 -0
- package/examples/jsm/loaders/FBXLoader.js +23 -45
- package/examples/jsm/loaders/GLTFLoader.js +10 -4
- package/examples/jsm/loaders/MaterialXLoader.js +2 -9
- package/examples/jsm/loaders/USDZLoader.js +124 -76
- package/examples/jsm/loaders/UltraHDRLoader.js +583 -0
- package/examples/jsm/loaders/VTKLoader.js +76 -3
- package/examples/jsm/misc/GPUComputationRenderer.js +9 -19
- package/examples/jsm/modifiers/SimplifyModifier.js +2 -1
- package/examples/jsm/objects/InstancedPoints.js +2 -2
- package/examples/jsm/postprocessing/RenderTransitionPass.js +13 -38
- package/examples/jsm/postprocessing/SSAOPass.js +6 -9
- package/examples/jsm/postprocessing/UnrealBloomPass.js +4 -4
- package/examples/jsm/shaders/ColorifyShader.js +1 -2
- package/examples/jsm/shaders/FXAAShader.js +0 -2
- package/examples/jsm/shaders/GTAOShader.js +1 -1
- package/examples/jsm/shaders/LuminosityHighPassShader.js +1 -3
- package/examples/jsm/transpiler/GLSLDecoder.js +46 -4
- package/examples/jsm/transpiler/TSLEncoder.js +17 -15
- package/package.json +7 -6
- package/src/Three.WebGPU.js +194 -0
- package/src/Three.js +2 -0
- package/src/constants.js +4 -1
- package/src/core/Object3D.js +22 -22
- package/src/extras/TextureUtils.js +210 -0
- package/src/lights/Light.js +1 -0
- package/src/lights/LightShadow.js +5 -0
- package/{examples/jsm/lights → src/lights/webgpu}/IESSpotLight.js +1 -1
- package/src/loaders/ObjectLoader.js +33 -2
- package/src/materials/Material.js +13 -4
- package/src/math/Box2.js +4 -4
- package/src/math/Box3.js +6 -6
- package/src/math/ColorManagement.js +10 -0
- package/src/math/Matrix2.js +54 -0
- package/src/math/Vector4.js +13 -0
- package/{examples/jsm → src}/nodes/Nodes.js +30 -12
- package/{examples/jsm → src}/nodes/accessors/BatchNode.js +28 -10
- package/{examples/jsm → src}/nodes/accessors/BufferAttributeNode.js +36 -1
- package/src/nodes/accessors/CameraNode.js +19 -0
- package/{examples/jsm → src}/nodes/accessors/CubeTextureNode.js +22 -5
- package/src/nodes/accessors/InstanceNode.js +140 -0
- package/{examples/jsm → src}/nodes/accessors/MaterialNode.js +22 -2
- package/{examples/jsm → src}/nodes/accessors/ModelNode.js +2 -1
- package/{examples/jsm → src}/nodes/accessors/MorphNode.js +24 -20
- package/{examples/jsm → src}/nodes/accessors/NormalNode.js +1 -1
- package/{examples/jsm → src}/nodes/accessors/Object3DNode.js +1 -1
- package/{examples/jsm → src}/nodes/accessors/ReferenceNode.js +1 -1
- package/{examples/jsm → src}/nodes/accessors/ReflectVectorNode.js +4 -0
- package/{examples/jsm → src}/nodes/accessors/StorageBufferNode.js +50 -1
- package/{examples/jsm → src}/nodes/accessors/StorageTextureNode.js +12 -3
- package/{examples/jsm → src}/nodes/accessors/TextureNode.js +55 -18
- package/{examples/jsm → src}/nodes/accessors/UniformsNode.js +7 -1
- package/{examples/jsm → src}/nodes/accessors/VertexColorNode.js +2 -1
- package/{examples/jsm → src}/nodes/code/ScriptableNode.js +14 -0
- package/{examples/jsm → src}/nodes/code/ScriptableValueNode.js +2 -1
- package/{examples/jsm → src}/nodes/core/AttributeNode.js +20 -6
- package/{examples/jsm → src}/nodes/core/CacheNode.js +7 -10
- package/{examples/jsm → src}/nodes/core/IndexNode.js +6 -0
- package/{examples/jsm → src}/nodes/core/LightingModel.js +2 -2
- package/src/nodes/core/MRTNode.js +76 -0
- package/{examples/jsm → src}/nodes/core/Node.js +18 -12
- package/{examples/jsm → src}/nodes/core/NodeBuilder.js +175 -37
- package/src/nodes/core/NodeCache.js +36 -0
- package/{examples/jsm → src}/nodes/core/NodeFrame.js +42 -0
- package/{examples/jsm → src}/nodes/core/NodeFunction.js +2 -2
- package/{examples/jsm → src}/nodes/core/NodeUniform.js +1 -2
- package/{examples/jsm → src}/nodes/core/NodeUtils.js +6 -1
- package/{examples/jsm → src}/nodes/core/PropertyNode.js +1 -0
- package/{examples/jsm → src}/nodes/core/TempNode.js +2 -2
- package/{examples/jsm → src}/nodes/core/UniformGroupNode.js +20 -0
- package/{examples/jsm → src}/nodes/core/UniformNode.js +10 -1
- package/{examples/jsm → src}/nodes/core/VarNode.js +2 -6
- package/{examples/jsm → src}/nodes/core/VaryingNode.js +8 -0
- package/{examples/jsm → src}/nodes/display/AfterImageNode.js +19 -27
- package/{examples/jsm → src}/nodes/display/AnamorphicNode.js +18 -21
- package/src/nodes/display/BloomNode.js +333 -0
- package/{examples/jsm → src}/nodes/display/ColorAdjustmentNode.js +7 -2
- package/{examples/jsm → src}/nodes/display/ColorSpaceNode.js +1 -1
- package/src/nodes/display/DenoiseNode.js +198 -0
- package/src/nodes/display/DepthOfFieldNode.js +119 -0
- package/src/nodes/display/DotScreenNode.js +75 -0
- package/src/nodes/display/FXAANode.js +327 -0
- package/src/nodes/display/FilmNode.js +52 -0
- package/{examples/jsm → src}/nodes/display/FrontFacingNode.js +2 -1
- package/src/nodes/display/GTAONode.js +324 -0
- package/{examples/jsm → src}/nodes/display/GaussianBlurNode.js +34 -17
- package/src/nodes/display/Lut3DNode.js +53 -0
- package/{examples/jsm → src}/nodes/display/NormalMapNode.js +1 -1
- package/src/nodes/display/PassNode.js +291 -0
- package/src/nodes/display/PixelationPassNode.js +201 -0
- package/src/nodes/display/RGBShiftNode.js +49 -0
- package/src/nodes/display/RenderOutputNode.js +56 -0
- package/src/nodes/display/SobelOperatorNode.js +121 -0
- package/{examples/jsm → src}/nodes/display/ToneMappingNode.js +44 -5
- package/src/nodes/display/TransitionNode.js +76 -0
- package/{examples/jsm → src}/nodes/display/ViewportDepthNode.js +39 -16
- package/{examples/jsm → src}/nodes/display/ViewportDepthTextureNode.js +2 -1
- package/{examples/jsm → src}/nodes/display/ViewportNode.js +2 -1
- package/{examples/jsm → src}/nodes/display/ViewportSharedTextureNode.js +2 -1
- package/{examples/jsm → src}/nodes/display/ViewportTextureNode.js +5 -2
- package/src/nodes/functions/BSDF/LTC.js +131 -0
- package/src/nodes/functions/BasicLightingModel.js +78 -0
- package/{examples/jsm → src}/nodes/functions/PhongLightingModel.js +5 -3
- package/{examples/jsm → src}/nodes/functions/PhysicalLightingModel.js +42 -1
- package/{examples/jsm → src}/nodes/functions/ToonLightingModel.js +3 -1
- package/{examples/jsm → src}/nodes/geometry/RangeNode.js +19 -6
- package/{examples/jsm → src}/nodes/lighting/AONode.js +1 -4
- package/{examples/jsm → src}/nodes/lighting/AmbientLightNode.js +1 -1
- package/src/nodes/lighting/AnalyticLightNode.js +333 -0
- package/src/nodes/lighting/BasicEnvironmentNode.js +26 -0
- package/src/nodes/lighting/BasicLightMapNode.js +29 -0
- package/{examples/jsm → src}/nodes/lighting/DirectionalLightNode.js +2 -3
- package/{examples/jsm → src}/nodes/lighting/EnvironmentNode.js +5 -4
- package/{examples/jsm → src}/nodes/lighting/HemisphereLightNode.js +2 -1
- package/{examples/jsm → src}/nodes/lighting/IESSpotLightNode.js +1 -1
- package/{examples/jsm → src}/nodes/lighting/LightingNode.js +2 -0
- package/{examples/jsm → src}/nodes/lighting/LightsNode.js +1 -3
- package/{examples/jsm → src}/nodes/lighting/PointLightNode.js +2 -3
- package/src/nodes/lighting/RectAreaLightNode.js +97 -0
- package/{examples/jsm → src}/nodes/lighting/SpotLightNode.js +2 -3
- package/{examples/jsm → src}/nodes/loaders/NodeLoader.js +3 -1
- package/{examples/jsm → src}/nodes/loaders/NodeMaterialLoader.js +2 -1
- package/{examples/jsm → src}/nodes/loaders/NodeObjectLoader.js +2 -1
- package/{examples/jsm → src}/nodes/materials/InstancedPointsNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/Line2NodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/LineBasicNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/LineDashedNodeMaterial.js +4 -3
- package/src/nodes/materials/MeshBasicNodeMaterial.js +73 -0
- package/{examples/jsm → src}/nodes/materials/MeshLambertNodeMaterial.js +12 -3
- package/{examples/jsm → src}/nodes/materials/MeshMatcapNodeMaterial.js +6 -5
- package/{examples/jsm → src}/nodes/materials/MeshNormalNodeMaterial.js +5 -3
- package/{examples/jsm → src}/nodes/materials/MeshPhongNodeMaterial.js +11 -3
- package/{examples/jsm → src}/nodes/materials/MeshPhysicalNodeMaterial.js +5 -4
- package/{examples/jsm → src}/nodes/materials/MeshStandardNodeMaterial.js +14 -3
- package/{examples/jsm → src}/nodes/materials/MeshToonNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/NodeMaterial.js +85 -20
- package/{examples/jsm → src}/nodes/materials/PointsNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/ShadowNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/SpriteNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materialx/lib/mx_hsv.js +9 -17
- package/{examples/jsm → src}/nodes/materialx/lib/mx_noise.js +474 -577
- package/{examples/jsm → src}/nodes/materialx/lib/mx_transform_color.js +2 -8
- package/{examples/jsm → src}/nodes/math/CondNode.js +13 -6
- package/{examples/jsm → src}/nodes/math/MathNode.js +14 -1
- package/{examples/jsm → src}/nodes/math/OperatorNode.js +6 -6
- package/{examples/jsm → src}/nodes/parsers/GLSLNodeFunction.js +7 -7
- package/{examples/jsm → src}/nodes/pmrem/PMREMNode.js +2 -1
- package/{examples/jsm → src}/nodes/shadernode/ShaderNode.js +2 -0
- package/{examples/jsm → src}/nodes/utils/DiscardNode.js +1 -0
- package/{examples/jsm → src}/nodes/utils/FunctionOverloadingNode.js +2 -0
- package/{examples/jsm → src}/nodes/utils/LoopNode.js +7 -6
- package/{examples/jsm → src}/nodes/utils/MaxMipLevelNode.js +8 -2
- package/src/nodes/utils/RTTNode.js +130 -0
- package/{examples/jsm → src}/nodes/utils/ReflectorNode.js +9 -1
- package/src/objects/BatchedMesh.js +168 -188
- package/src/objects/InstancedMesh.js +1 -1
- package/src/renderers/WebGLRenderer.js +38 -25
- package/{examples/jsm → src}/renderers/common/Attributes.js +2 -1
- package/{examples/jsm → src}/renderers/common/Backend.js +30 -27
- package/{examples/jsm → src}/renderers/common/Background.js +9 -3
- package/src/renderers/common/BindGroup.js +16 -0
- package/{examples/jsm → src}/renderers/common/Bindings.js +38 -23
- package/{examples/jsm → src}/renderers/common/ClippingContext.js +4 -2
- package/{examples/jsm → src}/renderers/common/Color4.js +1 -1
- package/{examples/jsm → src}/renderers/common/CubeRenderTarget.js +7 -1
- package/{examples/jsm → src}/renderers/common/Geometries.js +37 -5
- package/{examples/jsm → src}/renderers/common/Info.js +34 -6
- package/src/renderers/common/PostProcessing.js +87 -0
- package/{examples/jsm/objects → src/renderers/common}/QuadMesh.js +6 -3
- package/{examples/jsm → src}/renderers/common/RenderContext.js +1 -1
- package/{examples/jsm → src}/renderers/common/RenderContexts.js +1 -1
- package/{examples/jsm → src}/renderers/common/RenderObject.js +44 -11
- package/{examples/jsm → src}/renderers/common/Renderer.js +84 -32
- package/{examples/jsm → src}/renderers/common/SampledTexture.js +2 -2
- package/{examples/jsm → src}/renderers/common/StorageBufferAttribute.js +1 -1
- package/{examples/jsm → src}/renderers/common/StorageInstancedBufferAttribute.js +1 -1
- package/{examples/jsm → src}/renderers/common/StorageTexture.js +2 -1
- package/{examples/jsm → src}/renderers/common/Textures.js +6 -2
- package/{examples/jsm → src}/renderers/common/Uniform.js +9 -4
- package/{examples/jsm → src}/renderers/common/UniformsGroup.js +69 -31
- package/{examples/jsm → src}/renderers/common/extras/PMREMGenerator.js +13 -12
- package/src/renderers/common/nodes/NodeBuilderState.js +58 -0
- package/{examples/jsm → src}/renderers/common/nodes/NodeSampledTexture.js +6 -5
- package/{examples/jsm → src}/renderers/common/nodes/NodeSampler.js +2 -1
- package/{examples/jsm → src}/renderers/common/nodes/NodeStorageBuffer.js +5 -1
- package/{examples/jsm → src}/renderers/common/nodes/NodeUniform.js +3 -3
- package/{examples/jsm → src}/renderers/common/nodes/NodeUniformBuffer.js +2 -1
- package/{examples/jsm → src}/renderers/common/nodes/NodeUniformsGroup.js +2 -8
- package/{examples/jsm → src}/renderers/common/nodes/Nodes.js +37 -16
- package/src/renderers/shaders/ShaderChunk/batching_pars_vertex.glsl.js +16 -1
- package/src/renderers/shaders/ShaderChunk/batching_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/color_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/colorspace_pars_fragment.glsl.js +0 -9
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +0 -10
- package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +3 -3
- package/src/renderers/shaders/ShaderChunk/packing.glsl.js +45 -13
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +7 -4
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_vertex.glsl.js +3 -0
- package/src/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl.js +3 -3
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +8 -0
- package/src/renderers/shaders/UniformsLib.js +3 -0
- package/src/renderers/webgl/WebGLAttributes.js +2 -2
- package/src/renderers/webgl/WebGLBufferRenderer.js +6 -19
- package/src/renderers/webgl/WebGLIndexedBufferRenderer.js +6 -18
- package/src/renderers/webgl/WebGLLights.js +6 -0
- package/src/renderers/webgl/WebGLProgram.js +26 -0
- package/src/renderers/webgl/WebGLPrograms.js +1 -1
- package/src/renderers/webgl/WebGLTextures.js +14 -53
- package/src/renderers/webgl/WebGLUniforms.js +12 -2
- package/src/renderers/webgl/WebGLUniformsGroups.js +7 -7
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/WebGLBackend.js +156 -54
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/nodes/GLSLNodeBuilder.js +178 -43
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLAttributeUtils.js +2 -2
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLConstants.js +1 -0
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLExtensions.js +2 -0
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLState.js +1 -1
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLTextureUtils.js +34 -2
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLUtils.js +1 -1
- package/{examples/jsm → src}/renderers/webgpu/WebGPUBackend.js +164 -76
- package/{examples/jsm → src}/renderers/webgpu/WebGPURenderer.js +2 -2
- package/{examples/jsm → src}/renderers/webgpu/nodes/WGSLNodeBuilder.js +194 -56
- package/src/renderers/webgpu/nodes/WGSLNodeFunction.js +159 -0
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUAttributeUtils.js +2 -1
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUBindingUtils.js +20 -13
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUConstants.js +3 -1
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUPipelineUtils.js +28 -21
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUTextureUtils.js +40 -23
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUUtils.js +24 -3
- package/src/renderers/webxr/WebXRDepthSensing.js +6 -0
- package/src/renderers/webxr/WebXRManager.js +6 -0
- package/src/textures/CompressedArrayTexture.js +1 -1
- package/examples/jsm/nodes/accessors/CameraNode.js +0 -12
- package/examples/jsm/nodes/accessors/InstanceNode.js +0 -94
- package/examples/jsm/nodes/core/NodeCache.js +0 -26
- package/examples/jsm/nodes/display/PassNode.js +0 -201
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +0 -256
- package/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js +0 -28
- package/examples/jsm/renderers/common/PostProcessing.js +0 -33
- package/examples/jsm/renderers/common/nodes/NodeBuilderState.js +0 -44
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeFunction.js +0 -104
- /package/{examples/jsm → src}/nodes/accessors/AccessorsUtils.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/BitangentNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/BufferNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/ClippingNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/InstancedPointsMaterialNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/MaterialReferenceNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/ModelViewProjectionNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/PointUVNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/PositionNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/RendererReferenceNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/SceneNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/SkinningNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/TangentNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/Texture3DNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/TextureBicubicNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/TextureSizeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/UVNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/UserDataNode.js +0 -0
- /package/{examples/jsm → src}/nodes/code/CodeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/code/ExpressionNode.js +0 -0
- /package/{examples/jsm → src}/nodes/code/FunctionCallNode.js +0 -0
- /package/{examples/jsm → src}/nodes/code/FunctionNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/AssignNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/BypassNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/ConstNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/ContextNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/InputNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeAttribute.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeCode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeFunctionInput.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeKeywords.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeParser.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeVar.js +0 -0
- /package/{examples/jsm → src}/nodes/core/NodeVarying.js +0 -0
- /package/{examples/jsm → src}/nodes/core/OutputStructNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/ParameterNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/StackNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/StructTypeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/core/UniformGroup.js +0 -0
- /package/{examples/jsm → src}/nodes/core/constants.js +0 -0
- /package/{examples/jsm → src}/nodes/display/BlendModeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/display/BumpMapNode.js +0 -0
- /package/{examples/jsm → src}/nodes/display/PosterizeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/fog/FogExp2Node.js +0 -0
- /package/{examples/jsm → src}/nodes/fog/FogNode.js +0 -0
- /package/{examples/jsm → src}/nodes/fog/FogRangeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/BRDF_GGX.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/BRDF_Lambert.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/BRDF_Sheen.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/DFGApprox.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/D_GGX.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/D_GGX_Anisotropic.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/EnvironmentBRDF.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/F_Schlick.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/Schlick_to_F0.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/ShadowMaskModel.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/material/getGeometryRoughness.js +0 -0
- /package/{examples/jsm → src}/nodes/functions/material/getRoughness.js +0 -0
- /package/{examples/jsm → src}/nodes/gpgpu/ComputeNode.js +0 -0
- /package/{examples/jsm → src}/nodes/lighting/IrradianceNode.js +0 -0
- /package/{examples/jsm → src}/nodes/lighting/LightNode.js +0 -0
- /package/{examples/jsm → src}/nodes/lighting/LightUtils.js +0 -0
- /package/{examples/jsm → src}/nodes/lighting/LightingContextNode.js +0 -0
- /package/{examples/jsm → src}/nodes/materials/Materials.js +0 -0
- /package/{examples/jsm → src}/nodes/materials/MeshSSSNodeMaterial.js +0 -0
- /package/{examples/jsm → src}/nodes/materials/VolumeNodeMaterial.js +0 -0
- /package/{examples/jsm → src}/nodes/materialx/DISCLAIMER.md +0 -0
- /package/{examples/jsm → src}/nodes/materialx/MaterialXNodes.js +0 -0
- /package/{examples/jsm → src}/nodes/math/HashNode.js +0 -0
- /package/{examples/jsm → src}/nodes/math/MathUtils.js +0 -0
- /package/{examples/jsm → src}/nodes/math/TriNoise3D.js +0 -0
- /package/{examples/jsm → src}/nodes/parsers/GLSLNodeParser.js +0 -0
- /package/{examples/jsm → src}/nodes/pmrem/PMREMUtils.js +0 -0
- /package/{examples/jsm → src}/nodes/procedural/CheckerNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/ArrayElementNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/ConvertNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/EquirectUVNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/JoinNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/MatcapUVNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/OscNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/PackingNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/RemapNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/RotateNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/RotateUVNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/SetNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/SplitNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/SpriteSheetUVNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/StorageArrayElementNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/TimerNode.js +0 -0
- /package/{examples/jsm → src}/nodes/utils/TriplanarTexturesNode.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Animation.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Binding.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Buffer.js +0 -0
- /package/{examples/jsm → src}/renderers/common/BufferUtils.js +0 -0
- /package/{examples/jsm → src}/renderers/common/ChainMap.js +0 -0
- /package/{examples/jsm → src}/renderers/common/ComputePipeline.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Constants.js +0 -0
- /package/{examples/jsm → src}/renderers/common/DataMap.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Pipeline.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Pipelines.js +0 -0
- /package/{examples/jsm → src}/renderers/common/ProgrammableStage.js +0 -0
- /package/{examples/jsm → src}/renderers/common/RenderBundle.js +0 -0
- /package/{examples/jsm → src}/renderers/common/RenderBundles.js +0 -0
- /package/{examples/jsm → src}/renderers/common/RenderList.js +0 -0
- /package/{examples/jsm → src}/renderers/common/RenderLists.js +0 -0
- /package/{examples/jsm → src}/renderers/common/RenderObjects.js +0 -0
- /package/{examples/jsm → src}/renderers/common/RenderPipeline.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Sampler.js +0 -0
- /package/{examples/jsm → src}/renderers/common/StorageBuffer.js +0 -0
- /package/{examples/jsm → src}/renderers/common/UniformBuffer.js +0 -0
- /package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/WebGLBufferRenderer.js +0 -0
- /package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLCapabilities.js +0 -0
- /package/{examples/jsm → src}/renderers/webgpu/nodes/WGSLNodeParser.js +0 -0
- /package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUTexturePassUtils.js +0 -0
|
@@ -100,10 +100,6 @@ class Material extends EventDispatcher {
|
|
|
100
100
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
onBuild( /* shaderobject, renderer */ ) {}
|
|
104
|
-
|
|
105
|
-
onBeforeRender( /* renderer, scene, camera, geometry, object, group */ ) {}
|
|
106
|
-
|
|
107
103
|
onBeforeCompile( /* shaderobject, renderer */ ) {}
|
|
108
104
|
|
|
109
105
|
customProgramCacheKey() {
|
|
@@ -520,6 +516,19 @@ class Material extends EventDispatcher {
|
|
|
520
516
|
|
|
521
517
|
}
|
|
522
518
|
|
|
519
|
+
onBuild( /* shaderobject, renderer */ ) {
|
|
520
|
+
|
|
521
|
+
console.warn( 'Material: onBuild() has been removed.' ); // @deprecated, r166
|
|
522
|
+
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
onBeforeRender( /* renderer, scene, camera, geometry, object, group */ ) {
|
|
526
|
+
|
|
527
|
+
console.warn( 'Material: onBeforeRender() has been removed.' ); // @deprecated, r166
|
|
528
|
+
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
|
|
523
532
|
}
|
|
524
533
|
|
|
525
534
|
export { Material };
|
package/src/math/Box2.js
CHANGED
|
@@ -119,8 +119,8 @@ class Box2 {
|
|
|
119
119
|
|
|
120
120
|
containsPoint( point ) {
|
|
121
121
|
|
|
122
|
-
return point.x
|
|
123
|
-
point.y
|
|
122
|
+
return point.x >= this.min.x && point.x <= this.max.x &&
|
|
123
|
+
point.y >= this.min.y && point.y <= this.max.y;
|
|
124
124
|
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -147,8 +147,8 @@ class Box2 {
|
|
|
147
147
|
|
|
148
148
|
// using 4 splitting planes to rule out intersections
|
|
149
149
|
|
|
150
|
-
return box.max.x
|
|
151
|
-
box.max.y
|
|
150
|
+
return box.max.x >= this.min.x && box.min.x <= this.max.x &&
|
|
151
|
+
box.max.y >= this.min.y && box.min.y <= this.max.y;
|
|
152
152
|
|
|
153
153
|
}
|
|
154
154
|
|
package/src/math/Box3.js
CHANGED
|
@@ -238,9 +238,9 @@ class Box3 {
|
|
|
238
238
|
|
|
239
239
|
containsPoint( point ) {
|
|
240
240
|
|
|
241
|
-
return point.x
|
|
242
|
-
point.y
|
|
243
|
-
point.z
|
|
241
|
+
return point.x >= this.min.x && point.x <= this.max.x &&
|
|
242
|
+
point.y >= this.min.y && point.y <= this.max.y &&
|
|
243
|
+
point.z >= this.min.z && point.z <= this.max.z;
|
|
244
244
|
|
|
245
245
|
}
|
|
246
246
|
|
|
@@ -268,9 +268,9 @@ class Box3 {
|
|
|
268
268
|
intersectsBox( box ) {
|
|
269
269
|
|
|
270
270
|
// using 6 splitting planes to rule out intersections.
|
|
271
|
-
return box.max.x
|
|
272
|
-
box.max.y
|
|
273
|
-
box.max.z
|
|
271
|
+
return box.max.x >= this.min.x && box.min.x <= this.max.x &&
|
|
272
|
+
box.max.y >= this.min.y && box.min.y <= this.max.y &&
|
|
273
|
+
box.max.z >= this.min.z && box.min.z <= this.max.z;
|
|
274
274
|
|
|
275
275
|
}
|
|
276
276
|
|
|
@@ -33,24 +33,28 @@ const COLOR_SPACES = {
|
|
|
33
33
|
[ LinearSRGBColorSpace ]: {
|
|
34
34
|
transfer: LinearTransfer,
|
|
35
35
|
primaries: Rec709Primaries,
|
|
36
|
+
luminanceCoefficients: [ 0.2126, 0.7152, 0.0722 ],
|
|
36
37
|
toReference: ( color ) => color,
|
|
37
38
|
fromReference: ( color ) => color,
|
|
38
39
|
},
|
|
39
40
|
[ SRGBColorSpace ]: {
|
|
40
41
|
transfer: SRGBTransfer,
|
|
41
42
|
primaries: Rec709Primaries,
|
|
43
|
+
luminanceCoefficients: [ 0.2126, 0.7152, 0.0722 ],
|
|
42
44
|
toReference: ( color ) => color.convertSRGBToLinear(),
|
|
43
45
|
fromReference: ( color ) => color.convertLinearToSRGB(),
|
|
44
46
|
},
|
|
45
47
|
[ LinearDisplayP3ColorSpace ]: {
|
|
46
48
|
transfer: LinearTransfer,
|
|
47
49
|
primaries: P3Primaries,
|
|
50
|
+
luminanceCoefficients: [ 0.2289, 0.6917, 0.0793 ],
|
|
48
51
|
toReference: ( color ) => color.applyMatrix3( LINEAR_DISPLAY_P3_TO_LINEAR_SRGB ),
|
|
49
52
|
fromReference: ( color ) => color.applyMatrix3( LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 ),
|
|
50
53
|
},
|
|
51
54
|
[ DisplayP3ColorSpace ]: {
|
|
52
55
|
transfer: SRGBTransfer,
|
|
53
56
|
primaries: P3Primaries,
|
|
57
|
+
luminanceCoefficients: [ 0.2289, 0.6917, 0.0793 ],
|
|
54
58
|
toReference: ( color ) => color.convertSRGBToLinear().applyMatrix3( LINEAR_DISPLAY_P3_TO_LINEAR_SRGB ),
|
|
55
59
|
fromReference: ( color ) => color.applyMatrix3( LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 ).convertLinearToSRGB(),
|
|
56
60
|
},
|
|
@@ -123,6 +127,12 @@ export const ColorManagement = {
|
|
|
123
127
|
|
|
124
128
|
},
|
|
125
129
|
|
|
130
|
+
getLuminanceCoefficients: function ( target, colorSpace = this._workingColorSpace ) {
|
|
131
|
+
|
|
132
|
+
return target.fromArray( COLOR_SPACES[ colorSpace ].luminanceCoefficients );
|
|
133
|
+
|
|
134
|
+
},
|
|
135
|
+
|
|
126
136
|
};
|
|
127
137
|
|
|
128
138
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export class Matrix2 {
|
|
2
|
+
|
|
3
|
+
constructor( n11, n12, n21, n22 ) {
|
|
4
|
+
|
|
5
|
+
Matrix2.prototype.isMatrix2 = true;
|
|
6
|
+
|
|
7
|
+
this.elements = [
|
|
8
|
+
1, 0,
|
|
9
|
+
0, 1,
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
if ( n11 !== undefined ) {
|
|
13
|
+
|
|
14
|
+
this.set( n11, n12, n21, n22 );
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
identity() {
|
|
21
|
+
|
|
22
|
+
this.set(
|
|
23
|
+
1, 0,
|
|
24
|
+
0, 1,
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
return this;
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
fromArray( array, offset = 0 ) {
|
|
32
|
+
|
|
33
|
+
for ( let i = 0; i < 4; i ++ ) {
|
|
34
|
+
|
|
35
|
+
this.elements[ i ] = array[ i + offset ];
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return this;
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
set( n11, n12, n21, n22 ) {
|
|
44
|
+
|
|
45
|
+
const te = this.elements;
|
|
46
|
+
|
|
47
|
+
te[ 0 ] = n11; te[ 2 ] = n12;
|
|
48
|
+
te[ 1 ] = n21; te[ 3 ] = n22;
|
|
49
|
+
|
|
50
|
+
return this;
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
}
|
package/src/math/Vector4.js
CHANGED
|
@@ -413,6 +413,19 @@ class Vector4 {
|
|
|
413
413
|
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
+
setFromMatrixPosition( m ) {
|
|
417
|
+
|
|
418
|
+
const e = m.elements;
|
|
419
|
+
|
|
420
|
+
this.x = e[ 12 ];
|
|
421
|
+
this.y = e[ 13 ];
|
|
422
|
+
this.z = e[ 14 ];
|
|
423
|
+
this.w = e[ 15 ];
|
|
424
|
+
|
|
425
|
+
return this;
|
|
426
|
+
|
|
427
|
+
}
|
|
428
|
+
|
|
416
429
|
min( v ) {
|
|
417
430
|
|
|
418
431
|
this.x = Math.min( this.x, v.x );
|
|
@@ -11,7 +11,7 @@ export { default as BypassNode, bypass } from './core/BypassNode.js';
|
|
|
11
11
|
export { default as CacheNode, cache } from './core/CacheNode.js';
|
|
12
12
|
export { default as ConstNode } from './core/ConstNode.js';
|
|
13
13
|
export { default as ContextNode, context, label } from './core/ContextNode.js';
|
|
14
|
-
export { default as IndexNode, vertexIndex, instanceIndex } from './core/IndexNode.js';
|
|
14
|
+
export { default as IndexNode, vertexIndex, instanceIndex, drawIndex } from './core/IndexNode.js';
|
|
15
15
|
export { default as LightingModel } from './core/LightingModel.js';
|
|
16
16
|
export { default as Node, addNodeClass, createNodeFromType } from './core/Node.js';
|
|
17
17
|
export { default as VarNode, temp } from './core/VarNode.js';
|
|
@@ -26,19 +26,20 @@ export { default as NodeUniform } from './core/NodeUniform.js';
|
|
|
26
26
|
export { default as NodeVar } from './core/NodeVar.js';
|
|
27
27
|
export { default as NodeVarying } from './core/NodeVarying.js';
|
|
28
28
|
export { default as ParameterNode, parameter } from './core/ParameterNode.js';
|
|
29
|
-
export { default as PropertyNode, property, varyingProperty, output, diffuseColor, roughness, metalness, clearcoat, clearcoatRoughness, sheen, sheenRoughness, iridescence, iridescenceIOR, iridescenceThickness, specularColor, shininess, dashSize, gapSize, pointWidth, alphaT, anisotropy, anisotropyB, anisotropyT } from './core/PropertyNode.js';
|
|
29
|
+
export { default as PropertyNode, property, varyingProperty, output, diffuseColor, emissive, roughness, metalness, clearcoat, clearcoatRoughness, sheen, sheenRoughness, iridescence, iridescenceIOR, iridescenceThickness, specularColor, shininess, dashSize, gapSize, pointWidth, alphaT, anisotropy, anisotropyB, anisotropyT } from './core/PropertyNode.js';
|
|
30
30
|
export { default as StackNode, stack } from './core/StackNode.js';
|
|
31
31
|
export { default as TempNode } from './core/TempNode.js';
|
|
32
32
|
export { default as UniformGroupNode, uniformGroup, objectGroup, renderGroup, frameGroup } from './core/UniformGroupNode.js';
|
|
33
33
|
export { default as UniformNode, uniform } from './core/UniformNode.js';
|
|
34
34
|
export { default as VaryingNode, varying } from './core/VaryingNode.js';
|
|
35
35
|
export { default as OutputStructNode, outputStruct } from './core/OutputStructNode.js';
|
|
36
|
+
export { default as MRTNode, mrt } from './core/MRTNode.js';
|
|
36
37
|
|
|
37
38
|
import * as NodeUtils from './core/NodeUtils.js';
|
|
38
39
|
export { NodeUtils };
|
|
39
40
|
|
|
40
41
|
// math
|
|
41
|
-
export { default as MathNode, PI, PI2, EPSILON, INFINITY, radians, degrees, exp, exp2, log, log2, sqrt, inverseSqrt, floor, ceil, normalize, fract, sin, cos, tan, asin, acos, atan, abs, sign, length, lengthSq, negate, oneMinus, dFdx, dFdy, round, reciprocal, trunc, fwidth, bitcast, atan2, min, max, mod, step, reflect, distance, difference, dot, cross, pow, pow2, pow3, pow4, transformDirection, mix, clamp, saturate, refract, smoothstep, faceForward, cbrt, all, any, equals } from './math/MathNode.js';
|
|
42
|
+
export { default as MathNode, PI, PI2, EPSILON, INFINITY, radians, degrees, exp, exp2, log, log2, sqrt, inverseSqrt, floor, ceil, normalize, fract, sin, cos, tan, asin, acos, atan, abs, sign, length, lengthSq, negate, oneMinus, dFdx, dFdy, round, reciprocal, trunc, fwidth, bitcast, atan2, min, max, mod, step, reflect, distance, difference, dot, cross, pow, pow2, pow3, pow4, transformDirection, mix, clamp, saturate, refract, smoothstep, faceForward, cbrt, transpose, all, any, equals, rand } from './math/MathNode.js';
|
|
42
43
|
|
|
43
44
|
export { default as OperatorNode, add, sub, mul, div, remainder, equal, lessThan, greaterThan, lessThanEqual, greaterThanEqual, and, or, not, xor, bitAnd, bitNot, bitOr, bitXor, shiftLeft, shiftRight } from './math/OperatorNode.js';
|
|
44
45
|
export { default as CondNode, cond } from './math/CondNode.js';
|
|
@@ -51,7 +52,7 @@ export { triNoise3D } from './math/TriNoise3D.js';
|
|
|
51
52
|
// utils
|
|
52
53
|
export { default as ArrayElementNode } from './utils/ArrayElementNode.js';
|
|
53
54
|
export { default as ConvertNode } from './utils/ConvertNode.js';
|
|
54
|
-
export { default as DiscardNode, discard } from './utils/DiscardNode.js';
|
|
55
|
+
export { default as DiscardNode, discard, Return } from './utils/DiscardNode.js';
|
|
55
56
|
export { default as EquirectUVNode, equirectUV } from './utils/EquirectUVNode.js';
|
|
56
57
|
export { default as FunctionOverloadingNode, overloadingFn } from './utils/FunctionOverloadingNode.js';
|
|
57
58
|
export { default as JoinNode } from './utils/JoinNode.js';
|
|
@@ -70,6 +71,7 @@ export { default as StorageArrayElementNode } from './utils/StorageArrayElementN
|
|
|
70
71
|
export { default as TimerNode, timerLocal, timerGlobal, timerDelta, frameId } from './utils/TimerNode.js';
|
|
71
72
|
export { default as TriplanarTexturesNode, triplanarTextures, triplanarTexture } from './utils/TriplanarTexturesNode.js';
|
|
72
73
|
export { default as ReflectorNode, reflector } from './utils/ReflectorNode.js';
|
|
74
|
+
export { default as RTTNode, rtt } from './utils/RTTNode.js';
|
|
73
75
|
|
|
74
76
|
// shadernode
|
|
75
77
|
export * from './shadernode/ShaderNode.js';
|
|
@@ -85,7 +87,7 @@ export { default as VertexColorNode, vertexColor } from './accessors/VertexColor
|
|
|
85
87
|
export { default as CubeTextureNode, cubeTexture } from './accessors/CubeTextureNode.js';
|
|
86
88
|
export { default as InstanceNode, instance } from './accessors/InstanceNode.js';
|
|
87
89
|
export { default as BatchNode, batch } from './accessors/BatchNode.js';
|
|
88
|
-
export { default as MaterialNode, materialAlphaTest, materialColor, materialShininess, materialEmissive, materialOpacity, materialSpecular, materialSpecularStrength, materialReflectivity, materialRoughness, materialMetalness, materialNormal, materialClearcoat, materialClearcoatRoughness, materialClearcoatNormal, materialRotation, materialSheen, materialSheenRoughness, materialIridescence, materialIridescenceIOR, materialIridescenceThickness, materialLineScale, materialLineDashSize, materialLineGapSize, materialLineWidth, materialLineDashOffset, materialPointWidth, materialAnisotropy, materialAnisotropyVector, materialDispersion } from './accessors/MaterialNode.js';
|
|
90
|
+
export { default as MaterialNode, materialAlphaTest, materialColor, materialShininess, materialEmissive, materialOpacity, materialSpecular, materialSpecularStrength, materialReflectivity, materialRoughness, materialMetalness, materialNormal, materialClearcoat, materialClearcoatRoughness, materialClearcoatNormal, materialRotation, materialSheen, materialSheenRoughness, materialIridescence, materialIridescenceIOR, materialIridescenceThickness, materialLineScale, materialLineDashSize, materialLineGapSize, materialLineWidth, materialLineDashOffset, materialPointWidth, materialAnisotropy, materialAnisotropyVector, materialDispersion, materialLightMap, materialAOMap } from './accessors/MaterialNode.js';
|
|
89
91
|
export { default as MaterialReferenceNode, materialReference } from './accessors/MaterialReferenceNode.js';
|
|
90
92
|
export { default as RendererReferenceNode, rendererReference } from './accessors/RendererReferenceNode.js';
|
|
91
93
|
export { default as MorphNode, morphReference } from './accessors/MorphNode.js';
|
|
@@ -98,12 +100,13 @@ export { default as PointUVNode, pointUV } from './accessors/PointUVNode.js';
|
|
|
98
100
|
export * from './accessors/PositionNode.js';
|
|
99
101
|
export { default as ReferenceNode, reference, referenceBuffer } from './accessors/ReferenceNode.js';
|
|
100
102
|
export * from './accessors/ReflectVectorNode.js';
|
|
101
|
-
export { default as SkinningNode, skinning } from './accessors/SkinningNode.js';
|
|
103
|
+
export { default as SkinningNode, skinning, skinningReference } from './accessors/SkinningNode.js';
|
|
102
104
|
export { default as SceneNode, backgroundBlurriness, backgroundIntensity } from './accessors/SceneNode.js';
|
|
103
105
|
export { default as StorageBufferNode, storage, storageObject } from './accessors/StorageBufferNode.js';
|
|
104
106
|
export * from './accessors/TangentNode.js';
|
|
105
107
|
export { default as TextureNode, texture, textureLoad, /*textureLevel,*/ sampler } from './accessors/TextureNode.js';
|
|
106
|
-
export { default as
|
|
108
|
+
export { default as TextureSizeNode, textureSize } from './accessors/TextureSizeNode.js';
|
|
109
|
+
export { default as StorageTextureNode, storageTexture, textureStore } from './accessors/StorageTextureNode.js';
|
|
107
110
|
export { default as Texture3DNode, texture3D } from './accessors/Texture3DNode.js';
|
|
108
111
|
export * from './accessors/UVNode.js';
|
|
109
112
|
export { default as UserDataNode, userData } from './accessors/UserDataNode.js';
|
|
@@ -111,7 +114,7 @@ export { default as UserDataNode, userData } from './accessors/UserDataNode.js';
|
|
|
111
114
|
// display
|
|
112
115
|
export { default as BlendModeNode, burn, dodge, overlay, screen } from './display/BlendModeNode.js';
|
|
113
116
|
export { default as BumpMapNode, bumpMap } from './display/BumpMapNode.js';
|
|
114
|
-
export { default as ColorAdjustmentNode, saturation, vibrance, hue,
|
|
117
|
+
export { default as ColorAdjustmentNode, saturation, vibrance, hue, luminance, threshold } from './display/ColorAdjustmentNode.js';
|
|
115
118
|
export { default as ColorSpaceNode, linearToColorSpace, colorSpaceToLinear, linearTosRGB, sRGBToLinear } from './display/ColorSpaceNode.js';
|
|
116
119
|
export { default as FrontFacingNode, frontFacing, faceDirection } from './display/FrontFacingNode.js';
|
|
117
120
|
export { default as NormalMapNode, normalMap } from './display/NormalMapNode.js';
|
|
@@ -121,12 +124,25 @@ export { default as ViewportNode, viewport, viewportCoordinate, viewportResoluti
|
|
|
121
124
|
export { default as ViewportTextureNode, viewportTexture, viewportMipTexture } from './display/ViewportTextureNode.js';
|
|
122
125
|
export { default as ViewportSharedTextureNode, viewportSharedTexture } from './display/ViewportSharedTextureNode.js';
|
|
123
126
|
export { default as ViewportDepthTextureNode, viewportDepthTexture } from './display/ViewportDepthTextureNode.js';
|
|
124
|
-
export { default as ViewportDepthNode, viewZToOrthographicDepth, orthographicDepthToViewZ, viewZToPerspectiveDepth, perspectiveDepthToViewZ, depth,
|
|
127
|
+
export { default as ViewportDepthNode, viewZToOrthographicDepth, orthographicDepthToViewZ, viewZToPerspectiveDepth, perspectiveDepthToViewZ, depth, linearDepth, viewportLinearDepth } from './display/ViewportDepthNode.js';
|
|
125
128
|
export { default as GaussianBlurNode, gaussianBlur } from './display/GaussianBlurNode.js';
|
|
126
129
|
export { default as AfterImageNode, afterImage } from './display/AfterImageNode.js';
|
|
127
130
|
export { default as AnamorphicNode, anamorphic } from './display/AnamorphicNode.js';
|
|
128
|
-
|
|
129
|
-
export { default as
|
|
131
|
+
export { default as SobelOperatorNode, sobel } from './display/SobelOperatorNode.js';
|
|
132
|
+
export { default as DepthOfFieldNode, dof } from './display/DepthOfFieldNode.js';
|
|
133
|
+
export { default as DotScreenNode, dotScreen } from './display/DotScreenNode.js';
|
|
134
|
+
export { default as RGBShiftNode, rgbShift } from './display/RGBShiftNode.js';
|
|
135
|
+
export { default as FilmNode, film } from './display/FilmNode.js';
|
|
136
|
+
export { default as Lut3DNode, lut3D } from './display/Lut3DNode.js';
|
|
137
|
+
export { default as GTAONode, ao } from './display/GTAONode.js';
|
|
138
|
+
export { default as DenoiseNode, denoise } from './display/DenoiseNode.js';
|
|
139
|
+
export { default as FXAANode, fxaa } from './display/FXAANode.js';
|
|
140
|
+
export { default as BloomNode, bloom } from './display/BloomNode.js';
|
|
141
|
+
export { default as TransitionNode, transition } from './display/TransitionNode.js';
|
|
142
|
+
export { default as RenderOutputNode, renderOutput } from './display/RenderOutputNode.js';
|
|
143
|
+
export { default as PixelationPassNode, pixelationPass } from './display/PixelationPassNode.js';
|
|
144
|
+
|
|
145
|
+
export { default as PassNode, pass, passTexture, depthPass } from './display/PassNode.js';
|
|
130
146
|
|
|
131
147
|
// code
|
|
132
148
|
export { default as ExpressionNode, expression } from './code/ExpressionNode.js';
|
|
@@ -151,6 +167,7 @@ export { default as ComputeNode, compute } from './gpgpu/ComputeNode.js';
|
|
|
151
167
|
export { default as LightNode, lightTargetDirection } from './lighting/LightNode.js';
|
|
152
168
|
export { default as PointLightNode } from './lighting/PointLightNode.js';
|
|
153
169
|
export { default as DirectionalLightNode } from './lighting/DirectionalLightNode.js';
|
|
170
|
+
export { default as RectAreaLightNode } from './lighting/RectAreaLightNode.js';
|
|
154
171
|
export { default as SpotLightNode } from './lighting/SpotLightNode.js';
|
|
155
172
|
export { default as IESSpotLightNode } from './lighting/IESSpotLightNode.js';
|
|
156
173
|
export { default as AmbientLightNode } from './lighting/AmbientLightNode.js';
|
|
@@ -159,13 +176,14 @@ export { default as LightingNode /* @TODO: lighting (abstract), light */ } from
|
|
|
159
176
|
export { default as LightingContextNode, lightingContext } from './lighting/LightingContextNode.js';
|
|
160
177
|
export { default as HemisphereLightNode } from './lighting/HemisphereLightNode.js';
|
|
161
178
|
export { default as EnvironmentNode } from './lighting/EnvironmentNode.js';
|
|
179
|
+
export { default as BasicEnvironmentNode } from './lighting/BasicEnvironmentNode.js';
|
|
162
180
|
export { default as IrradianceNode } from './lighting/IrradianceNode.js';
|
|
163
181
|
export { default as AONode } from './lighting/AONode.js';
|
|
164
182
|
export { default as AnalyticLightNode } from './lighting/AnalyticLightNode.js';
|
|
165
183
|
|
|
166
184
|
// pmrem
|
|
167
185
|
export { default as PMREMNode, pmremTexture } from './pmrem/PMREMNode.js';
|
|
168
|
-
export *
|
|
186
|
+
export * from './pmrem/PMREMUtils.js';
|
|
169
187
|
|
|
170
188
|
// procedural
|
|
171
189
|
export { default as CheckerNode, checker } from './procedural/CheckerNode.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import Node, { addNodeClass } from '../core/Node.js';
|
|
2
2
|
import { normalLocal } from './NormalNode.js';
|
|
3
3
|
import { positionLocal } from './PositionNode.js';
|
|
4
|
-
import { nodeProxy, vec3, mat3, mat4, int, ivec2, float } from '../shadernode/ShaderNode.js';
|
|
4
|
+
import { nodeProxy, vec3, mat3, mat4, int, ivec2, float, tslFn } from '../shadernode/ShaderNode.js';
|
|
5
5
|
import { textureLoad } from './TextureNode.js';
|
|
6
6
|
import { textureSize } from './TextureSizeNode.js';
|
|
7
|
-
import { attribute } from '../core/AttributeNode.js';
|
|
8
7
|
import { tangentLocal } from './TangentNode.js';
|
|
8
|
+
import { instanceIndex, drawIndex } from '../core/IndexNode.js';
|
|
9
9
|
|
|
10
10
|
class BatchNode extends Node {
|
|
11
11
|
|
|
@@ -28,14 +28,37 @@ class BatchNode extends Node {
|
|
|
28
28
|
|
|
29
29
|
if ( this.batchingIdNode === null ) {
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
if ( builder.getDrawIndex() === null ) {
|
|
32
|
+
|
|
33
|
+
this.batchingIdNode = instanceIndex;
|
|
34
|
+
|
|
35
|
+
} else {
|
|
36
|
+
|
|
37
|
+
this.batchingIdNode = drawIndex;
|
|
38
|
+
|
|
39
|
+
}
|
|
32
40
|
|
|
33
41
|
}
|
|
34
42
|
|
|
43
|
+
const getIndirectIndex = tslFn( ( [ id ] ) => {
|
|
44
|
+
|
|
45
|
+
const size = textureSize( textureLoad( this.batchMesh._indirectTexture ), 0 );
|
|
46
|
+
const x = int( id ).remainder( int( size ) );
|
|
47
|
+
const y = int( id ).div( int( size ) );
|
|
48
|
+
return textureLoad( this.batchMesh._indirectTexture, ivec2( x, y ) ).x;
|
|
49
|
+
|
|
50
|
+
} ).setLayout( {
|
|
51
|
+
name: 'getIndirectIndex',
|
|
52
|
+
type: 'uint',
|
|
53
|
+
inputs: [
|
|
54
|
+
{ name: 'id', type: 'int' }
|
|
55
|
+
]
|
|
56
|
+
} );
|
|
57
|
+
|
|
35
58
|
const matriceTexture = this.batchMesh._matricesTexture;
|
|
36
59
|
|
|
37
60
|
const size = textureSize( textureLoad( matriceTexture ), 0 );
|
|
38
|
-
const j = float( int( this.batchingIdNode ) ).mul( 4 ).toVar();
|
|
61
|
+
const j = float( getIndirectIndex( int( this.batchingIdNode ) ) ).mul( 4 ).toVar();
|
|
39
62
|
|
|
40
63
|
const x = int( j.mod( size ) );
|
|
41
64
|
const y = int( j ).div( int( size ) );
|
|
@@ -46,12 +69,7 @@ class BatchNode extends Node {
|
|
|
46
69
|
textureLoad( matriceTexture, ivec2( x.add( 3 ), y ) )
|
|
47
70
|
);
|
|
48
71
|
|
|
49
|
-
|
|
50
|
-
const bm = mat3(
|
|
51
|
-
batchingMatrix[ 0 ].xyz,
|
|
52
|
-
batchingMatrix[ 1 ].xyz,
|
|
53
|
-
batchingMatrix[ 2 ].xyz
|
|
54
|
-
);
|
|
72
|
+
const bm = mat3( batchingMatrix );
|
|
55
73
|
|
|
56
74
|
positionLocal.assign( batchingMatrix.mul( positionLocal ) );
|
|
57
75
|
|
|
@@ -2,7 +2,10 @@ import InputNode from '../core/InputNode.js';
|
|
|
2
2
|
import { addNodeClass } from '../core/Node.js';
|
|
3
3
|
import { varying } from '../core/VaryingNode.js';
|
|
4
4
|
import { nodeObject, addNodeElement } from '../shadernode/ShaderNode.js';
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
import { InterleavedBufferAttribute } from '../../core/InterleavedBufferAttribute.js';
|
|
7
|
+
import { InterleavedBuffer } from '../../core/InterleavedBuffer.js';
|
|
8
|
+
import { StaticDrawUsage, DynamicDrawUsage } from '../../constants.js';
|
|
6
9
|
|
|
7
10
|
class BufferAttributeNode extends InputNode {
|
|
8
11
|
|
|
@@ -21,6 +24,8 @@ class BufferAttributeNode extends InputNode {
|
|
|
21
24
|
|
|
22
25
|
this.attribute = null;
|
|
23
26
|
|
|
27
|
+
this.global = true;
|
|
28
|
+
|
|
24
29
|
if ( value && value.isBufferAttribute === true ) {
|
|
25
30
|
|
|
26
31
|
this.attribute = value;
|
|
@@ -31,6 +36,30 @@ class BufferAttributeNode extends InputNode {
|
|
|
31
36
|
|
|
32
37
|
}
|
|
33
38
|
|
|
39
|
+
getHash( builder ) {
|
|
40
|
+
|
|
41
|
+
if ( this.bufferStride === 0 && this.bufferOffset === 0 ) {
|
|
42
|
+
|
|
43
|
+
let bufferData = builder.globalCache.getData( this.value );
|
|
44
|
+
|
|
45
|
+
if ( bufferData === undefined ) {
|
|
46
|
+
|
|
47
|
+
bufferData = {
|
|
48
|
+
node: this
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
builder.globalCache.setData( this.value, bufferData );
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return bufferData.node.uuid;
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return this.uuid;
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
|
|
34
63
|
getNodeType( builder ) {
|
|
35
64
|
|
|
36
65
|
if ( this.bufferType === null ) {
|
|
@@ -100,6 +129,12 @@ class BufferAttributeNode extends InputNode {
|
|
|
100
129
|
|
|
101
130
|
this.usage = value;
|
|
102
131
|
|
|
132
|
+
if ( this.attribute && this.attribute.isBufferAttribute === true ) {
|
|
133
|
+
|
|
134
|
+
this.attribute.usage = value;
|
|
135
|
+
|
|
136
|
+
}
|
|
137
|
+
|
|
103
138
|
return this;
|
|
104
139
|
|
|
105
140
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { uniform } from '../core/UniformNode.js';
|
|
2
|
+
import { sharedUniformGroup } from '../core/UniformGroupNode.js';
|
|
3
|
+
import { Vector3 } from '../../math/Vector3.js';
|
|
4
|
+
|
|
5
|
+
const cameraGroup = /*#__PURE__*/ sharedUniformGroup( 'camera' ).onRenderUpdate( () => {
|
|
6
|
+
|
|
7
|
+
cameraGroup.needsUpdate = true;
|
|
8
|
+
|
|
9
|
+
} );
|
|
10
|
+
|
|
11
|
+
export const cameraNear = /*#__PURE__*/ uniform( 'float' ).label( 'cameraNear' ).setGroup( cameraGroup ).onRenderUpdate( ( { camera } ) => camera.near );
|
|
12
|
+
export const cameraFar = /*#__PURE__*/ uniform( 'float' ).label( 'cameraFar' ).setGroup( cameraGroup ).onRenderUpdate( ( { camera } ) => camera.far );
|
|
13
|
+
export const cameraLogDepth = /*#__PURE__*/ uniform( 'float' ).label( 'cameraLogDepth' ).setGroup( cameraGroup ).onRenderUpdate( ( { camera } ) => 2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) );
|
|
14
|
+
export const cameraProjectionMatrix = /*#__PURE__*/ uniform( 'mat4' ).label( 'cameraProjectionMatrix' ).setGroup( cameraGroup ).onRenderUpdate( ( { camera } ) => camera.projectionMatrix );
|
|
15
|
+
export const cameraProjectionMatrixInverse = /*#__PURE__*/ uniform( 'mat4' ).label( 'cameraProjectionMatrixInverse' ).setGroup( cameraGroup ).onRenderUpdate( ( { camera } ) => camera.projectionMatrixInverse );
|
|
16
|
+
export const cameraViewMatrix = /*#__PURE__*/ uniform( 'mat4' ).label( 'cameraViewMatrix' ).setGroup( cameraGroup ).onRenderUpdate( ( { camera } ) => camera.matrixWorldInverse );
|
|
17
|
+
export const cameraWorldMatrix = /*#__PURE__*/ uniform( 'mat4' ).label( 'cameraWorldMatrix' ).setGroup( cameraGroup ).onRenderUpdate( ( { camera } ) => camera.matrixWorld );
|
|
18
|
+
export const cameraNormalMatrix = /*#__PURE__*/ uniform( 'mat3' ).label( 'cameraNormalMatrix' ).setGroup( cameraGroup ).onRenderUpdate( ( { camera } ) => camera.normalMatrix );
|
|
19
|
+
export const cameraPosition = /*#__PURE__*/ uniform( new Vector3() ).label( 'cameraPosition' ).setGroup( cameraGroup ).onRenderUpdate( ( { camera }, self ) => self.value.setFromMatrixPosition( camera.matrixWorld ) );
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import TextureNode from './TextureNode.js';
|
|
2
|
-
import { reflectVector } from './ReflectVectorNode.js';
|
|
2
|
+
import { reflectVector, refractVector } from './ReflectVectorNode.js';
|
|
3
3
|
import { addNodeClass } from '../core/Node.js';
|
|
4
4
|
import { addNodeElement, nodeProxy, vec3 } from '../shadernode/ShaderNode.js';
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
import { CubeReflectionMapping, CubeRefractionMapping, WebGPUCoordinateSystem } from '../../constants.js';
|
|
6
7
|
|
|
7
8
|
class CubeTextureNode extends TextureNode {
|
|
8
9
|
|
|
9
|
-
constructor( value, uvNode = null, levelNode = null ) {
|
|
10
|
+
constructor( value, uvNode = null, levelNode = null, biasNode = null ) {
|
|
10
11
|
|
|
11
|
-
super( value, uvNode, levelNode );
|
|
12
|
+
super( value, uvNode, levelNode, biasNode );
|
|
12
13
|
|
|
13
14
|
this.isCubeTextureNode = true;
|
|
14
15
|
|
|
@@ -22,7 +23,23 @@ class CubeTextureNode extends TextureNode {
|
|
|
22
23
|
|
|
23
24
|
getDefaultUV() {
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
const texture = this.value;
|
|
27
|
+
|
|
28
|
+
if ( texture.mapping === CubeReflectionMapping ) {
|
|
29
|
+
|
|
30
|
+
return reflectVector;
|
|
31
|
+
|
|
32
|
+
} else if ( texture.mapping === CubeRefractionMapping ) {
|
|
33
|
+
|
|
34
|
+
return refractVector;
|
|
35
|
+
|
|
36
|
+
} else {
|
|
37
|
+
|
|
38
|
+
console.error( 'THREE.CubeTextureNode: Mapping "%s" not supported.', texture.mapping );
|
|
39
|
+
|
|
40
|
+
return vec3( 0, 0, 0 );
|
|
41
|
+
|
|
42
|
+
}
|
|
26
43
|
|
|
27
44
|
}
|
|
28
45
|
|