super-three 0.164.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/README.md +3 -3
- package/build/three.cjs +1273 -503
- package/build/three.module.js +1269 -504
- 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/controls/TransformControls.js +1 -1
- package/examples/jsm/csm/CSMShader.js +4 -4
- package/examples/jsm/environments/RoomEnvironment.js +1 -5
- package/examples/jsm/exporters/GLTFExporter.js +8 -4
- package/examples/jsm/exporters/USDZExporter.js +6 -4
- package/examples/jsm/geometries/TeapotGeometry.js +1 -1
- package/examples/jsm/helpers/ViewHelper.js +75 -61
- package/examples/jsm/lights/RectAreaLightTexturesLib.js +91 -0
- package/examples/jsm/lights/RectAreaLightUniformsLib.js +8 -63
- package/examples/jsm/lines/LineMaterial.js +1 -15
- package/examples/jsm/lines/LineSegments2.js +15 -0
- package/examples/jsm/lines/Wireframe.js +16 -1
- package/examples/jsm/lines/webgpu/Line2.js +20 -0
- package/examples/jsm/lines/webgpu/LineSegments2.js +376 -0
- package/examples/jsm/loaders/DRACOLoader.js +1 -1
- package/examples/jsm/loaders/FBXLoader.js +47 -58
- package/examples/jsm/loaders/GLTFLoader.js +12 -4
- package/examples/jsm/loaders/LDrawLoader.js +3 -2
- package/examples/jsm/loaders/MMDLoader.js +31 -12
- 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/CurveModifier.js +11 -9
- package/examples/jsm/modifiers/SimplifyModifier.js +2 -1
- package/examples/jsm/objects/InstancedPoints.js +2 -2
- package/examples/jsm/objects/Lensflare.js +2 -2
- package/examples/jsm/postprocessing/RenderPass.js +1 -1
- 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/renderers/CSS2DRenderer.js +25 -5
- package/examples/jsm/renderers/CSS3DRenderer.js +24 -3
- 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/examples/jsm/utils/BufferGeometryUtils.js +18 -16
- package/examples/jsm/utils/GPUStatsPanel.js +2 -0
- package/examples/jsm/utils/SortUtils.js +8 -5
- package/package.json +9 -7
- package/src/Three.WebGPU.js +194 -0
- package/src/Three.js +2 -0
- package/src/animation/tracks/BooleanKeyframeTrack.js +10 -1
- package/src/animation/tracks/QuaternionKeyframeTrack.js +1 -2
- package/src/animation/tracks/StringKeyframeTrack.js +10 -1
- package/src/constants.js +4 -1
- package/src/core/Object3D.js +24 -22
- package/src/core/Raycaster.js +6 -2
- 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/FileLoader.js +4 -0
- package/src/loaders/LoaderUtils.js +3 -1
- package/src/loaders/ObjectLoader.js +34 -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 +39 -20
- package/{examples/jsm → src}/nodes/accessors/BatchNode.js +28 -10
- package/src/nodes/accessors/BitangentNode.js +13 -0
- package/{examples/jsm → src}/nodes/accessors/BufferAttributeNode.js +36 -1
- package/{examples/jsm → src}/nodes/accessors/BufferNode.js +6 -0
- 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 +24 -2
- package/{examples/jsm → src}/nodes/accessors/ModelNode.js +4 -0
- package/{examples/jsm → src}/nodes/accessors/MorphNode.js +24 -20
- package/src/nodes/accessors/NormalNode.js +14 -0
- package/{examples/jsm → src}/nodes/accessors/Object3DNode.js +1 -1
- package/src/nodes/accessors/PositionNode.js +10 -0
- package/{examples/jsm → src}/nodes/accessors/ReferenceNode.js +7 -1
- package/src/nodes/accessors/ReflectVectorNode.js +10 -0
- package/{examples/jsm → src}/nodes/accessors/StorageBufferNode.js +50 -1
- package/{examples/jsm/nodes/accessors/TextureStoreNode.js → src/nodes/accessors/StorageTextureNode.js} +28 -6
- package/src/nodes/accessors/TangentNode.js +23 -0
- package/src/nodes/accessors/Texture3DNode.js +100 -0
- package/{examples/jsm → src}/nodes/accessors/TextureNode.js +55 -18
- package/src/nodes/accessors/UVNode.js +3 -0
- 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 +34 -8
- package/{examples/jsm → src}/nodes/core/CacheNode.js +7 -10
- package/{examples/jsm → src}/nodes/core/ContextNode.js +6 -0
- 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 +33 -14
- package/{examples/jsm → src}/nodes/core/NodeBuilder.js +194 -45
- 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/NodeKeywords.js +1 -1
- 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/OutputStructNode.js +1 -5
- package/{examples/jsm → src}/nodes/core/PropertyNode.js +2 -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/src/nodes/core/VaryingNode.js +104 -0
- package/{examples/jsm → src}/nodes/display/AfterImageNode.js +24 -20
- 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 +3 -2
- 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 +103 -18
- package/src/nodes/functions/ToonLightingModel.js +51 -0
- 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 +18 -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 +4 -4
- package/{examples/jsm → src}/nodes/materials/LineBasicNodeMaterial.js +3 -3
- package/{examples/jsm → src}/nodes/materials/LineDashedNodeMaterial.js +4 -3
- package/{examples/jsm → src}/nodes/materials/Materials.js +3 -0
- package/src/nodes/materials/MeshBasicNodeMaterial.js +73 -0
- package/{examples/jsm → src}/nodes/materials/MeshLambertNodeMaterial.js +12 -3
- package/src/nodes/materials/MeshMatcapNodeMaterial.js +53 -0
- 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 +26 -8
- package/{examples/jsm → src}/nodes/materials/MeshStandardNodeMaterial.js +14 -3
- package/src/nodes/materials/MeshToonNodeMaterial.js +34 -0
- package/{examples/jsm → src}/nodes/materials/NodeMaterial.js +97 -24
- 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/src/nodes/materials/VolumeNodeMaterial.js +106 -0
- 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/HashNode.js +2 -2
- 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 +57 -33
- package/{examples/jsm → src}/nodes/utils/ArrayElementNode.js +1 -1
- 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/MatcapUVNode.js +1 -1
- 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/{examples/jsm → src}/nodes/utils/TimerNode.js +1 -1
- package/src/objects/BatchedMesh.js +232 -162
- package/src/objects/InstancedMesh.js +1 -1
- package/src/renderers/WebGLRenderer.js +312 -68
- package/{examples/jsm → src}/renderers/common/Attributes.js +4 -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 +54 -22
- package/src/renderers/common/ChainMap.js +59 -0
- package/{examples/jsm → src}/renderers/common/ClippingContext.js +8 -6
- 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/{examples/jsm → src}/renderers/common/Pipelines.js +2 -2
- package/src/renderers/common/PostProcessing.js +87 -0
- package/{examples/jsm/objects → src/renderers/common}/QuadMesh.js +6 -3
- package/src/renderers/common/RenderBundle.js +18 -0
- package/src/renderers/common/RenderBundles.js +38 -0
- 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/RenderList.js +9 -0
- package/{examples/jsm → src}/renderers/common/RenderObject.js +50 -11
- package/{examples/jsm → src}/renderers/common/Renderer.js +220 -40
- 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 +10 -5
- 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 +19 -4
- package/{examples/jsm → src}/renderers/common/nodes/NodeSampler.js +8 -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 +31 -1
- package/src/renderers/shaders/ShaderChunk/batching_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/color_vertex.glsl.js +9 -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/lights_pars_begin.glsl.js +8 -22
- package/src/renderers/shaders/ShaderChunk/morphcolor_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/morphinstance_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/morphnormal_vertex.glsl.js +3 -14
- package/src/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl.js +10 -31
- package/src/renderers/shaders/ShaderChunk/morphtarget_vertex.glsl.js +3 -23
- 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/WebGLBackground.js +6 -0
- package/src/renderers/webgl/WebGLBufferRenderer.js +6 -19
- package/src/renderers/webgl/WebGLExtensions.js +3 -1
- package/src/renderers/webgl/WebGLIndexedBufferRenderer.js +6 -18
- package/src/renderers/webgl/WebGLLights.js +15 -12
- package/src/renderers/webgl/WebGLMaterials.js +1 -5
- package/src/renderers/webgl/WebGLMorphtargets.js +1 -2
- package/src/renderers/webgl/WebGLProgram.js +28 -31
- package/src/renderers/webgl/WebGLPrograms.js +15 -15
- package/src/renderers/webgl/WebGLRenderStates.js +2 -2
- package/src/renderers/webgl/WebGLTextures.js +100 -70
- 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 +188 -41
- 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 +126 -7
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLUtils.js +1 -1
- package/{examples/jsm → src}/renderers/webgpu/WebGPUBackend.js +212 -78
- package/{examples/jsm → src}/renderers/webgpu/WebGPURenderer.js +2 -2
- package/{examples/jsm → src}/renderers/webgpu/nodes/WGSLNodeBuilder.js +245 -49
- 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 +30 -14
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUConstants.js +9 -1
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUPipelineUtils.js +74 -24
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUTextureUtils.js +101 -25
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUUtils.js +24 -3
- package/src/renderers/webxr/WebXRDepthSensing.js +9 -3
- package/src/renderers/webxr/WebXRManager.js +12 -2
- package/src/textures/CompressedArrayTexture.js +14 -0
- package/src/textures/DataArrayTexture.js +14 -0
- package/src/textures/DepthTexture.js +1 -3
- package/src/utils.js +30 -1
- package/examples/jsm/nodes/accessors/BitangentNode.js +0 -89
- package/examples/jsm/nodes/accessors/CameraNode.js +0 -119
- package/examples/jsm/nodes/accessors/InstanceNode.js +0 -94
- package/examples/jsm/nodes/accessors/NormalNode.js +0 -106
- package/examples/jsm/nodes/accessors/PositionNode.js +0 -104
- package/examples/jsm/nodes/accessors/ReflectVectorNode.js +0 -35
- package/examples/jsm/nodes/accessors/TangentNode.js +0 -109
- package/examples/jsm/nodes/accessors/UVNode.js +0 -47
- package/examples/jsm/nodes/core/NodeCache.js +0 -26
- package/examples/jsm/nodes/core/VaryingNode.js +0 -65
- package/examples/jsm/nodes/display/PassNode.js +0 -199
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +0 -255
- package/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js +0 -28
- package/examples/jsm/renderers/common/ChainMap.js +0 -89
- 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/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/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/TextureBicubicNode.js +0 -0
- /package/{examples/jsm → src}/nodes/accessors/TextureSizeNode.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/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/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/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/MeshSSSNodeMaterial.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/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/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/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/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/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/ProgrammableStage.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
|
@@ -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';
|
|
@@ -77,40 +79,42 @@ export * from './shadernode/ShaderNode.js';
|
|
|
77
79
|
// accessors
|
|
78
80
|
export { TBNViewMatrix, parallaxDirection, parallaxUV, transformedBentNormalView } from './accessors/AccessorsUtils.js';
|
|
79
81
|
export { default as UniformsNode, uniforms } from './accessors/UniformsNode.js';
|
|
80
|
-
export
|
|
82
|
+
export * from './accessors/BitangentNode.js';
|
|
81
83
|
export { default as BufferAttributeNode, bufferAttribute, dynamicBufferAttribute, instancedBufferAttribute, instancedDynamicBufferAttribute } from './accessors/BufferAttributeNode.js';
|
|
82
84
|
export { default as BufferNode, buffer } from './accessors/BufferNode.js';
|
|
83
|
-
export
|
|
85
|
+
export * from './accessors/CameraNode.js';
|
|
84
86
|
export { default as VertexColorNode, vertexColor } from './accessors/VertexColorNode.js';
|
|
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 } 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';
|
|
92
94
|
export { default as TextureBicubicNode, textureBicubic } from './accessors/TextureBicubicNode.js';
|
|
93
|
-
export { default as ModelNode, modelDirection, modelViewMatrix, modelNormalMatrix, modelWorldMatrix, modelPosition, modelViewPosition, modelScale } from './accessors/ModelNode.js';
|
|
95
|
+
export { default as ModelNode, modelDirection, modelViewMatrix, modelNormalMatrix, modelWorldMatrix, modelPosition, modelViewPosition, modelScale, modelWorldMatrixInverse } from './accessors/ModelNode.js';
|
|
94
96
|
export { default as ModelViewProjectionNode, modelViewProjection } from './accessors/ModelViewProjectionNode.js';
|
|
95
|
-
export
|
|
97
|
+
export * from './accessors/NormalNode.js';
|
|
96
98
|
export { default as Object3DNode, objectDirection, objectViewMatrix, objectNormalMatrix, objectWorldMatrix, objectPosition, objectScale, objectViewPosition } from './accessors/Object3DNode.js';
|
|
97
99
|
export { default as PointUVNode, pointUV } from './accessors/PointUVNode.js';
|
|
98
|
-
export
|
|
100
|
+
export * from './accessors/PositionNode.js';
|
|
99
101
|
export { default as ReferenceNode, reference, referenceBuffer } from './accessors/ReferenceNode.js';
|
|
100
|
-
export
|
|
101
|
-
export { default as SkinningNode, skinning } from './accessors/SkinningNode.js';
|
|
102
|
+
export * from './accessors/ReflectVectorNode.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
|
-
export
|
|
106
|
+
export * from './accessors/TangentNode.js';
|
|
105
107
|
export { default as TextureNode, texture, textureLoad, /*textureLevel,*/ sampler } from './accessors/TextureNode.js';
|
|
106
|
-
export { default as
|
|
107
|
-
export { default as
|
|
108
|
+
export { default as TextureSizeNode, textureSize } from './accessors/TextureSizeNode.js';
|
|
109
|
+
export { default as StorageTextureNode, storageTexture, textureStore } from './accessors/StorageTextureNode.js';
|
|
110
|
+
export { default as Texture3DNode, texture3D } from './accessors/Texture3DNode.js';
|
|
111
|
+
export * from './accessors/UVNode.js';
|
|
108
112
|
export { default as UserDataNode, userData } from './accessors/UserDataNode.js';
|
|
109
113
|
|
|
110
114
|
// display
|
|
111
115
|
export { default as BlendModeNode, burn, dodge, overlay, screen } from './display/BlendModeNode.js';
|
|
112
116
|
export { default as BumpMapNode, bumpMap } from './display/BumpMapNode.js';
|
|
113
|
-
export { default as ColorAdjustmentNode, saturation, vibrance, hue,
|
|
117
|
+
export { default as ColorAdjustmentNode, saturation, vibrance, hue, luminance, threshold } from './display/ColorAdjustmentNode.js';
|
|
114
118
|
export { default as ColorSpaceNode, linearToColorSpace, colorSpaceToLinear, linearTosRGB, sRGBToLinear } from './display/ColorSpaceNode.js';
|
|
115
119
|
export { default as FrontFacingNode, frontFacing, faceDirection } from './display/FrontFacingNode.js';
|
|
116
120
|
export { default as NormalMapNode, normalMap } from './display/NormalMapNode.js';
|
|
@@ -120,12 +124,25 @@ export { default as ViewportNode, viewport, viewportCoordinate, viewportResoluti
|
|
|
120
124
|
export { default as ViewportTextureNode, viewportTexture, viewportMipTexture } from './display/ViewportTextureNode.js';
|
|
121
125
|
export { default as ViewportSharedTextureNode, viewportSharedTexture } from './display/ViewportSharedTextureNode.js';
|
|
122
126
|
export { default as ViewportDepthTextureNode, viewportDepthTexture } from './display/ViewportDepthTextureNode.js';
|
|
123
|
-
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';
|
|
124
128
|
export { default as GaussianBlurNode, gaussianBlur } from './display/GaussianBlurNode.js';
|
|
125
129
|
export { default as AfterImageNode, afterImage } from './display/AfterImageNode.js';
|
|
126
130
|
export { default as AnamorphicNode, anamorphic } from './display/AnamorphicNode.js';
|
|
127
|
-
|
|
128
|
-
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';
|
|
129
146
|
|
|
130
147
|
// code
|
|
131
148
|
export { default as ExpressionNode, expression } from './code/ExpressionNode.js';
|
|
@@ -150,6 +167,7 @@ export { default as ComputeNode, compute } from './gpgpu/ComputeNode.js';
|
|
|
150
167
|
export { default as LightNode, lightTargetDirection } from './lighting/LightNode.js';
|
|
151
168
|
export { default as PointLightNode } from './lighting/PointLightNode.js';
|
|
152
169
|
export { default as DirectionalLightNode } from './lighting/DirectionalLightNode.js';
|
|
170
|
+
export { default as RectAreaLightNode } from './lighting/RectAreaLightNode.js';
|
|
153
171
|
export { default as SpotLightNode } from './lighting/SpotLightNode.js';
|
|
154
172
|
export { default as IESSpotLightNode } from './lighting/IESSpotLightNode.js';
|
|
155
173
|
export { default as AmbientLightNode } from './lighting/AmbientLightNode.js';
|
|
@@ -158,13 +176,14 @@ export { default as LightingNode /* @TODO: lighting (abstract), light */ } from
|
|
|
158
176
|
export { default as LightingContextNode, lightingContext } from './lighting/LightingContextNode.js';
|
|
159
177
|
export { default as HemisphereLightNode } from './lighting/HemisphereLightNode.js';
|
|
160
178
|
export { default as EnvironmentNode } from './lighting/EnvironmentNode.js';
|
|
179
|
+
export { default as BasicEnvironmentNode } from './lighting/BasicEnvironmentNode.js';
|
|
161
180
|
export { default as IrradianceNode } from './lighting/IrradianceNode.js';
|
|
162
181
|
export { default as AONode } from './lighting/AONode.js';
|
|
163
182
|
export { default as AnalyticLightNode } from './lighting/AnalyticLightNode.js';
|
|
164
183
|
|
|
165
184
|
// pmrem
|
|
166
185
|
export { default as PMREMNode, pmremTexture } from './pmrem/PMREMNode.js';
|
|
167
|
-
export *
|
|
186
|
+
export * from './pmrem/PMREMUtils.js';
|
|
168
187
|
|
|
169
188
|
// procedural
|
|
170
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
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { varying } from '../core/VaryingNode.js';
|
|
2
|
+
import { cameraViewMatrix } from './CameraNode.js';
|
|
3
|
+
import { normalGeometry, normalLocal, normalView, normalWorld, transformedNormalView } from './NormalNode.js';
|
|
4
|
+
import { tangentGeometry, tangentLocal, tangentView, tangentWorld, transformedTangentView } from './TangentNode.js';
|
|
5
|
+
|
|
6
|
+
const getBitangent = ( crossNormalTangent ) => crossNormalTangent.mul( tangentGeometry.w ).xyz;
|
|
7
|
+
|
|
8
|
+
export const bitangentGeometry = /*#__PURE__*/ varying( getBitangent( normalGeometry.cross( tangentGeometry ) ), 'v_bitangentGeometry' ).normalize().toVar( 'bitangentGeometry' );
|
|
9
|
+
export const bitangentLocal = /*#__PURE__*/ varying( getBitangent( normalLocal.cross( tangentLocal ) ), 'v_bitangentLocal' ).normalize().toVar( 'bitangentLocal' );
|
|
10
|
+
export const bitangentView = /*#__PURE__*/ varying( getBitangent( normalView.cross( tangentView ) ), 'v_bitangentView' ).normalize().toVar( 'bitangentView' );
|
|
11
|
+
export const bitangentWorld = /*#__PURE__*/ varying( getBitangent( normalWorld.cross( tangentWorld ) ), 'v_bitangentWorld' ).normalize().toVar( 'bitangentWorld' );
|
|
12
|
+
export const transformedBitangentView = /*#__PURE__*/ getBitangent( transformedNormalView.cross( transformedTangentView ) ).normalize().toVar( 'transformedBitangentView' );
|
|
13
|
+
export const transformedBitangentWorld = /*#__PURE__*/ transformedBitangentView.transformDirection( cameraViewMatrix ).normalize().toVar( 'transformedBitangentWorld' );
|
|
@@ -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
|
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import Node, { addNodeClass } from '../core/Node.js';
|
|
2
|
+
import { varyingProperty } from '../core/PropertyNode.js';
|
|
3
|
+
import { instancedBufferAttribute, instancedDynamicBufferAttribute } from './BufferAttributeNode.js';
|
|
4
|
+
import { normalLocal } from './NormalNode.js';
|
|
5
|
+
import { positionLocal } from './PositionNode.js';
|
|
6
|
+
import { nodeProxy, vec3, mat3, mat4 } from '../shadernode/ShaderNode.js';
|
|
7
|
+
import { NodeUpdateType } from '../core/constants.js';
|
|
8
|
+
import { buffer } from '../accessors/BufferNode.js';
|
|
9
|
+
import { instanceIndex } from '../core/IndexNode.js';
|
|
10
|
+
|
|
11
|
+
import { InstancedInterleavedBuffer } from '../../core/InstancedInterleavedBuffer.js';
|
|
12
|
+
import { InstancedBufferAttribute } from '../../core/InstancedBufferAttribute.js';
|
|
13
|
+
import { DynamicDrawUsage } from '../../constants.js';
|
|
14
|
+
|
|
15
|
+
class InstanceNode extends Node {
|
|
16
|
+
|
|
17
|
+
constructor( instanceMesh ) {
|
|
18
|
+
|
|
19
|
+
super( 'void' );
|
|
20
|
+
|
|
21
|
+
this.instanceMesh = instanceMesh;
|
|
22
|
+
|
|
23
|
+
this.instanceMatrixNode = null;
|
|
24
|
+
|
|
25
|
+
this.instanceColorNode = null;
|
|
26
|
+
|
|
27
|
+
this.updateType = NodeUpdateType.FRAME;
|
|
28
|
+
|
|
29
|
+
this.buffer = null;
|
|
30
|
+
this.bufferColor = null;
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
setup( /*builder*/ ) {
|
|
35
|
+
|
|
36
|
+
let instanceMatrixNode = this.instanceMatrixNode;
|
|
37
|
+
let instanceColorNode = this.instanceColorNode;
|
|
38
|
+
|
|
39
|
+
const instanceMesh = this.instanceMesh;
|
|
40
|
+
|
|
41
|
+
if ( instanceMatrixNode === null ) {
|
|
42
|
+
|
|
43
|
+
const instanceAttribute = instanceMesh.instanceMatrix;
|
|
44
|
+
|
|
45
|
+
// Both WebGPU and WebGL backends have UBO max limited to 64kb. Matrix count number bigger than 1000 ( 16 * 4 * 1000 = 64kb ) will fallback to attribute.
|
|
46
|
+
|
|
47
|
+
if ( instanceMesh.count <= 1000 ) {
|
|
48
|
+
|
|
49
|
+
instanceMatrixNode = buffer( instanceAttribute.array, 'mat4', instanceMesh.count ).element( instanceIndex );
|
|
50
|
+
|
|
51
|
+
} else {
|
|
52
|
+
|
|
53
|
+
const buffer = new InstancedInterleavedBuffer( instanceAttribute.array, 16, 1 );
|
|
54
|
+
|
|
55
|
+
this.buffer = buffer;
|
|
56
|
+
|
|
57
|
+
const bufferFn = instanceAttribute.usage === DynamicDrawUsage ? instancedDynamicBufferAttribute : instancedBufferAttribute;
|
|
58
|
+
|
|
59
|
+
const instanceBuffers = [
|
|
60
|
+
// F.Signature -> bufferAttribute( array, type, stride, offset )
|
|
61
|
+
bufferFn( buffer, 'vec4', 16, 0 ),
|
|
62
|
+
bufferFn( buffer, 'vec4', 16, 4 ),
|
|
63
|
+
bufferFn( buffer, 'vec4', 16, 8 ),
|
|
64
|
+
bufferFn( buffer, 'vec4', 16, 12 )
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
instanceMatrixNode = mat4( ...instanceBuffers );
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
this.instanceMatrixNode = instanceMatrixNode;
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const instanceColorAttribute = instanceMesh.instanceColor;
|
|
76
|
+
|
|
77
|
+
if ( instanceColorAttribute && instanceColorNode === null ) {
|
|
78
|
+
|
|
79
|
+
const buffer = new InstancedBufferAttribute( instanceColorAttribute.array, 3 );
|
|
80
|
+
|
|
81
|
+
const bufferFn = instanceColorAttribute.usage === DynamicDrawUsage ? instancedDynamicBufferAttribute : instancedBufferAttribute;
|
|
82
|
+
|
|
83
|
+
this.bufferColor = buffer;
|
|
84
|
+
|
|
85
|
+
instanceColorNode = vec3( bufferFn( buffer, 'vec3', 3, 0 ) );
|
|
86
|
+
|
|
87
|
+
this.instanceColorNode = instanceColorNode;
|
|
88
|
+
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// POSITION
|
|
92
|
+
|
|
93
|
+
const instancePosition = instanceMatrixNode.mul( positionLocal ).xyz;
|
|
94
|
+
|
|
95
|
+
// NORMAL
|
|
96
|
+
|
|
97
|
+
const m = mat3( instanceMatrixNode );
|
|
98
|
+
|
|
99
|
+
const transformedNormal = normalLocal.div( vec3( m[ 0 ].dot( m[ 0 ] ), m[ 1 ].dot( m[ 1 ] ), m[ 2 ].dot( m[ 2 ] ) ) );
|
|
100
|
+
|
|
101
|
+
const instanceNormal = m.mul( transformedNormal ).xyz;
|
|
102
|
+
|
|
103
|
+
// ASSIGNS
|
|
104
|
+
|
|
105
|
+
positionLocal.assign( instancePosition );
|
|
106
|
+
normalLocal.assign( instanceNormal );
|
|
107
|
+
|
|
108
|
+
// COLOR
|
|
109
|
+
|
|
110
|
+
if ( this.instanceColorNode !== null ) {
|
|
111
|
+
|
|
112
|
+
varyingProperty( 'vec3', 'vInstanceColor' ).assign( this.instanceColorNode );
|
|
113
|
+
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
update( /*frame*/ ) {
|
|
119
|
+
|
|
120
|
+
if ( this.instanceMesh.instanceMatrix.usage !== DynamicDrawUsage && this.buffer != null && this.instanceMesh.instanceMatrix.version !== this.buffer.version ) {
|
|
121
|
+
|
|
122
|
+
this.buffer.version = this.instanceMesh.instanceMatrix.version;
|
|
123
|
+
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if ( this.instanceMesh.instanceColor && this.instanceMesh.instanceColor.usage !== DynamicDrawUsage && this.bufferColor != null && this.instanceMesh.instanceColor.version !== this.bufferColor.version ) {
|
|
127
|
+
|
|
128
|
+
this.bufferColor.version = this.instanceMesh.instanceColor.version;
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export default InstanceNode;
|
|
137
|
+
|
|
138
|
+
export const instance = nodeProxy( InstanceNode );
|
|
139
|
+
|
|
140
|
+
addNodeClass( 'InstanceNode', InstanceNode );
|
|
@@ -4,7 +4,8 @@ import { materialReference } from './MaterialReferenceNode.js';
|
|
|
4
4
|
import { normalView } from './NormalNode.js';
|
|
5
5
|
import { nodeImmutable, float, vec2, mat2 } from '../shadernode/ShaderNode.js';
|
|
6
6
|
import { uniform } from '../core/UniformNode.js';
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import { Vector2 } from '../../math/Vector2.js';
|
|
8
9
|
|
|
9
10
|
const _propertyCache = new Map();
|
|
10
11
|
|
|
@@ -157,7 +158,8 @@ class MaterialNode extends Node {
|
|
|
157
158
|
|
|
158
159
|
} else if ( scope === MaterialNode.EMISSIVE ) {
|
|
159
160
|
|
|
160
|
-
const
|
|
161
|
+
const emissiveIntensityNode = this.getFloat( 'emissiveIntensity' );
|
|
162
|
+
const emissiveNode = this.getColor( scope ).mul( emissiveIntensityNode );
|
|
161
163
|
|
|
162
164
|
if ( material.emissiveMap && material.emissiveMap.isTexture === true ) {
|
|
163
165
|
|
|
@@ -318,6 +320,18 @@ class MaterialNode extends Node {
|
|
|
318
320
|
|
|
319
321
|
node = this.getFloat( scope );
|
|
320
322
|
|
|
323
|
+
} else if ( scope === MaterialNode.REFRACTION_RATIO ) {
|
|
324
|
+
|
|
325
|
+
node = this.getFloat( scope );
|
|
326
|
+
|
|
327
|
+
} else if ( scope === MaterialNode.LIGHT_MAP ) {
|
|
328
|
+
|
|
329
|
+
node = this.getTexture( scope ).rgb.mul( this.getFloat( 'lightMapIntensity' ) );
|
|
330
|
+
|
|
331
|
+
} else if ( scope === MaterialNode.AO_MAP ) {
|
|
332
|
+
|
|
333
|
+
node = this.getTexture( scope ).r.sub( 1.0 ).mul( this.getFloat( 'aoMapIntensity' ) ).add( 1.0 );
|
|
334
|
+
|
|
321
335
|
} else {
|
|
322
336
|
|
|
323
337
|
const outputType = this.getNodeType( builder );
|
|
@@ -366,6 +380,10 @@ MaterialNode.LINE_GAP_SIZE = 'gapSize';
|
|
|
366
380
|
MaterialNode.LINE_WIDTH = 'linewidth';
|
|
367
381
|
MaterialNode.LINE_DASH_OFFSET = 'dashOffset';
|
|
368
382
|
MaterialNode.POINT_WIDTH = 'pointWidth';
|
|
383
|
+
MaterialNode.DISPERSION = 'dispersion';
|
|
384
|
+
MaterialNode.LIGHT_MAP = 'light';
|
|
385
|
+
MaterialNode.AO_MAP = 'ao';
|
|
386
|
+
MaterialNode.REFRACTION_RATIO = 'refractionRatio';
|
|
369
387
|
|
|
370
388
|
export default MaterialNode;
|
|
371
389
|
|
|
@@ -405,6 +423,10 @@ export const materialLineGapSize = nodeImmutable( MaterialNode, MaterialNode.LIN
|
|
|
405
423
|
export const materialLineWidth = nodeImmutable( MaterialNode, MaterialNode.LINE_WIDTH );
|
|
406
424
|
export const materialLineDashOffset = nodeImmutable( MaterialNode, MaterialNode.LINE_DASH_OFFSET );
|
|
407
425
|
export const materialPointWidth = nodeImmutable( MaterialNode, MaterialNode.POINT_WIDTH );
|
|
426
|
+
export const materialDispersion = nodeImmutable( MaterialNode, MaterialNode.DISPERSION );
|
|
427
|
+
export const materialLightMap = nodeImmutable( MaterialNode, MaterialNode.LIGHT_MAP );
|
|
428
|
+
export const materialAOMap = nodeImmutable( MaterialNode, MaterialNode.AO_MAP );
|
|
429
|
+
export const materialRefractionRatio = nodeImmutable( MaterialNode, MaterialNode.REFRACTION_RATIO );
|
|
408
430
|
export const materialAnisotropyVector = uniform( new Vector2() ).onReference( function ( frame ) {
|
|
409
431
|
|
|
410
432
|
return frame.material;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import Object3DNode from './Object3DNode.js';
|
|
2
2
|
import { addNodeClass } from '../core/Node.js';
|
|
3
3
|
import { nodeImmutable } from '../shadernode/ShaderNode.js';
|
|
4
|
+
import { uniform } from '../core/UniformNode.js';
|
|
5
|
+
|
|
6
|
+
import { Matrix4 } from '../../math/Matrix4.js';
|
|
4
7
|
|
|
5
8
|
class ModelNode extends Object3DNode {
|
|
6
9
|
|
|
@@ -29,5 +32,6 @@ export const modelWorldMatrix = nodeImmutable( ModelNode, ModelNode.WORLD_MATRIX
|
|
|
29
32
|
export const modelPosition = nodeImmutable( ModelNode, ModelNode.POSITION );
|
|
30
33
|
export const modelScale = nodeImmutable( ModelNode, ModelNode.SCALE );
|
|
31
34
|
export const modelViewPosition = nodeImmutable( ModelNode, ModelNode.VIEW_POSITION );
|
|
35
|
+
export const modelWorldMatrixInverse = uniform( new Matrix4() ).onObjectUpdate( ( { object }, self ) => self.value.copy( object.matrixWorld ).invert() );
|
|
32
36
|
|
|
33
37
|
addNodeClass( 'ModelNode', ModelNode );
|