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
|
@@ -11,7 +11,7 @@ import { reference } from '../accessors/ReferenceNode.js';
|
|
|
11
11
|
import { transformedBentNormalView } from '../accessors/AccessorsUtils.js';
|
|
12
12
|
import { pmremTexture } from '../pmrem/PMREMNode.js';
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const _envNodeCache = new WeakMap();
|
|
15
15
|
|
|
16
16
|
class EnvironmentNode extends LightingNode {
|
|
17
17
|
|
|
@@ -29,13 +29,13 @@ class EnvironmentNode extends LightingNode {
|
|
|
29
29
|
|
|
30
30
|
if ( envNode.isTextureNode ) {
|
|
31
31
|
|
|
32
|
-
let cacheEnvNode =
|
|
32
|
+
let cacheEnvNode = _envNodeCache.get( envNode.value );
|
|
33
33
|
|
|
34
34
|
if ( cacheEnvNode === undefined ) {
|
|
35
35
|
|
|
36
36
|
cacheEnvNode = pmremTexture( envNode.value );
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
_envNodeCache.set( envNode.value, cacheEnvNode );
|
|
39
39
|
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -57,12 +57,13 @@ class EnvironmentNode extends LightingNode {
|
|
|
57
57
|
const irradiance = context( envNode, createIrradianceContext( transformedNormalWorld ) ).mul( Math.PI ).mul( intensity );
|
|
58
58
|
|
|
59
59
|
const isolateRadiance = cache( radiance );
|
|
60
|
+
const isolateIrradiance = cache( irradiance );
|
|
60
61
|
|
|
61
62
|
//
|
|
62
63
|
|
|
63
64
|
builder.context.radiance.addAssign( isolateRadiance );
|
|
64
65
|
|
|
65
|
-
builder.context.iblIrradiance.addAssign(
|
|
66
|
+
builder.context.iblIrradiance.addAssign( isolateIrradiance );
|
|
66
67
|
|
|
67
68
|
//
|
|
68
69
|
|
|
@@ -6,7 +6,8 @@ import { normalView } from '../accessors/NormalNode.js';
|
|
|
6
6
|
import { objectPosition } from '../accessors/Object3DNode.js';
|
|
7
7
|
import { addNodeClass } from '../core/Node.js';
|
|
8
8
|
|
|
9
|
-
import { Color
|
|
9
|
+
import { Color } from '../../math/Color.js';
|
|
10
|
+
import { HemisphereLight } from '../../lights/HemisphereLight.js';
|
|
10
11
|
|
|
11
12
|
class HemisphereLightNode extends AnalyticLightNode {
|
|
12
13
|
|
|
@@ -4,7 +4,7 @@ import { texture } from '../accessors/TextureNode.js';
|
|
|
4
4
|
import { vec2 } from '../shadernode/ShaderNode.js';
|
|
5
5
|
import { addNodeClass } from '../core/Node.js';
|
|
6
6
|
|
|
7
|
-
import IESSpotLight from '../../lights/IESSpotLight.js';
|
|
7
|
+
import IESSpotLight from '../../lights/webgpu/IESSpotLight.js';
|
|
8
8
|
|
|
9
9
|
class IESSpotLightNode extends SpotLightNode {
|
|
10
10
|
|
|
@@ -99,9 +99,7 @@ class LightsNode extends Node {
|
|
|
99
99
|
|
|
100
100
|
//
|
|
101
101
|
|
|
102
|
-
lightingModel.
|
|
103
|
-
lightingModel.indirectSpecular( context, stack, builder );
|
|
104
|
-
lightingModel.ambientOcclusion( context, stack, builder );
|
|
102
|
+
lightingModel.indirect( context, stack, builder );
|
|
105
103
|
|
|
106
104
|
//
|
|
107
105
|
|
|
@@ -6,7 +6,7 @@ import { objectViewPosition } from '../accessors/Object3DNode.js';
|
|
|
6
6
|
import { positionView } from '../accessors/PositionNode.js';
|
|
7
7
|
import { addNodeClass } from '../core/Node.js';
|
|
8
8
|
|
|
9
|
-
import { PointLight } from '
|
|
9
|
+
import { PointLight } from '../../lights/PointLight.js';
|
|
10
10
|
|
|
11
11
|
class PointLightNode extends AnalyticLightNode {
|
|
12
12
|
|
|
@@ -54,8 +54,7 @@ class PointLightNode extends AnalyticLightNode {
|
|
|
54
54
|
lightingModel.direct( {
|
|
55
55
|
lightDirection,
|
|
56
56
|
lightColor,
|
|
57
|
-
reflectedLight
|
|
58
|
-
shadowMask: this.shadowMaskNode
|
|
57
|
+
reflectedLight
|
|
59
58
|
}, builder.stack, builder );
|
|
60
59
|
|
|
61
60
|
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import AnalyticLightNode from './AnalyticLightNode.js';
|
|
2
|
+
import { addLightNode } from './LightsNode.js';
|
|
3
|
+
import { texture } from '../accessors/TextureNode.js';
|
|
4
|
+
import { uniform } from '../core/UniformNode.js';
|
|
5
|
+
import { objectViewPosition } from '../accessors/Object3DNode.js';
|
|
6
|
+
import { addNodeClass } from '../core/Node.js';
|
|
7
|
+
|
|
8
|
+
import { RectAreaLight } from '../../lights/RectAreaLight.js';
|
|
9
|
+
import { Matrix4 } from '../../math/Matrix4.js';
|
|
10
|
+
import { Vector3 } from '../../math/Vector3.js';
|
|
11
|
+
|
|
12
|
+
const _matrix41 = /*@__PURE__*/ new Matrix4();
|
|
13
|
+
const _matrix42 = /*@__PURE__*/ new Matrix4();
|
|
14
|
+
|
|
15
|
+
let ltcLib = null;
|
|
16
|
+
|
|
17
|
+
class RectAreaLightNode extends AnalyticLightNode {
|
|
18
|
+
|
|
19
|
+
constructor( light = null ) {
|
|
20
|
+
|
|
21
|
+
super( light );
|
|
22
|
+
|
|
23
|
+
this.halfHeight = uniform( new Vector3() );
|
|
24
|
+
this.halfWidth = uniform( new Vector3() );
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
update( frame ) {
|
|
29
|
+
|
|
30
|
+
super.update( frame );
|
|
31
|
+
|
|
32
|
+
const { light } = this;
|
|
33
|
+
|
|
34
|
+
const viewMatrix = frame.camera.matrixWorldInverse;
|
|
35
|
+
|
|
36
|
+
_matrix42.identity();
|
|
37
|
+
_matrix41.copy( light.matrixWorld );
|
|
38
|
+
_matrix41.premultiply( viewMatrix );
|
|
39
|
+
_matrix42.extractRotation( _matrix41 );
|
|
40
|
+
|
|
41
|
+
this.halfWidth.value.set( light.width * 0.5, 0.0, 0.0 );
|
|
42
|
+
this.halfHeight.value.set( 0.0, light.height * 0.5, 0.0 );
|
|
43
|
+
|
|
44
|
+
this.halfWidth.value.applyMatrix4( _matrix42 );
|
|
45
|
+
this.halfHeight.value.applyMatrix4( _matrix42 );
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
setup( builder ) {
|
|
50
|
+
|
|
51
|
+
super.setup( builder );
|
|
52
|
+
|
|
53
|
+
let ltc_1, ltc_2;
|
|
54
|
+
|
|
55
|
+
if ( builder.isAvailable( 'float32Filterable' ) ) {
|
|
56
|
+
|
|
57
|
+
ltc_1 = texture( ltcLib.LTC_FLOAT_1 );
|
|
58
|
+
ltc_2 = texture( ltcLib.LTC_FLOAT_2 );
|
|
59
|
+
|
|
60
|
+
} else {
|
|
61
|
+
|
|
62
|
+
ltc_1 = texture( ltcLib.LTC_HALF_1 );
|
|
63
|
+
ltc_2 = texture( ltcLib.LTC_HALF_2 );
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const { colorNode, light } = this;
|
|
68
|
+
const lightingModel = builder.context.lightingModel;
|
|
69
|
+
|
|
70
|
+
const lightPosition = objectViewPosition( light );
|
|
71
|
+
const reflectedLight = builder.context.reflectedLight;
|
|
72
|
+
|
|
73
|
+
lightingModel.directRectArea( {
|
|
74
|
+
lightColor: colorNode,
|
|
75
|
+
lightPosition,
|
|
76
|
+
halfWidth: this.halfWidth,
|
|
77
|
+
halfHeight: this.halfHeight,
|
|
78
|
+
reflectedLight,
|
|
79
|
+
ltc_1,
|
|
80
|
+
ltc_2
|
|
81
|
+
}, builder.stack, builder );
|
|
82
|
+
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
static setLTC( ltc ) {
|
|
86
|
+
|
|
87
|
+
ltcLib = ltc;
|
|
88
|
+
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export default RectAreaLightNode;
|
|
94
|
+
|
|
95
|
+
addNodeClass( 'RectAreaLightNode', RectAreaLightNode );
|
|
96
|
+
|
|
97
|
+
addLightNode( RectAreaLight, RectAreaLightNode );
|
|
@@ -8,7 +8,7 @@ import { objectViewPosition } from '../accessors/Object3DNode.js';
|
|
|
8
8
|
import { positionView } from '../accessors/PositionNode.js';
|
|
9
9
|
import { addNodeClass } from '../core/Node.js';
|
|
10
10
|
|
|
11
|
-
import { SpotLight } from '
|
|
11
|
+
import { SpotLight } from '../../lights/SpotLight.js';
|
|
12
12
|
|
|
13
13
|
class SpotLightNode extends AnalyticLightNode {
|
|
14
14
|
|
|
@@ -75,8 +75,7 @@ class SpotLightNode extends AnalyticLightNode {
|
|
|
75
75
|
lightingModel.direct( {
|
|
76
76
|
lightDirection,
|
|
77
77
|
lightColor,
|
|
78
|
-
reflectedLight
|
|
79
|
-
shadowMask: this.shadowMaskNode
|
|
78
|
+
reflectedLight
|
|
80
79
|
}, builder.stack, builder );
|
|
81
80
|
|
|
82
81
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { createNodeFromType } from '../core/Node.js';
|
|
2
2
|
import { nodeObject } from '../shadernode/ShaderNode.js';
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import { Loader } from '../../loaders/Loader.js';
|
|
5
|
+
import { FileLoader } from '../../loaders/FileLoader.js';
|
|
4
6
|
|
|
5
7
|
class NodeLoader extends Loader {
|
|
6
8
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { MaterialLoader } from 'three';
|
|
2
1
|
import { createNodeMaterialFromType } from '../materials/Materials.js';
|
|
3
2
|
|
|
3
|
+
import { MaterialLoader } from '../../loaders/MaterialLoader.js';
|
|
4
|
+
|
|
4
5
|
const superFromTypeFunction = MaterialLoader.createMaterialFromType;
|
|
5
6
|
|
|
6
7
|
MaterialLoader.createMaterialFromType = function ( type ) {
|
|
@@ -11,9 +11,9 @@ import { tslFn, vec2, vec4 } from '../shadernode/ShaderNode.js';
|
|
|
11
11
|
import { uv } from '../accessors/UVNode.js';
|
|
12
12
|
import { viewport } from '../display/ViewportNode.js';
|
|
13
13
|
|
|
14
|
-
import { PointsMaterial } from '
|
|
14
|
+
import { PointsMaterial } from '../../materials/PointsMaterial.js';
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const _defaultValues = /*@__PURE__*/ new PointsMaterial();
|
|
17
17
|
|
|
18
18
|
class InstancedPointsNodeMaterial extends NodeMaterial {
|
|
19
19
|
|
|
@@ -33,7 +33,7 @@ class InstancedPointsNodeMaterial extends NodeMaterial {
|
|
|
33
33
|
|
|
34
34
|
this.pointColorNode = null;
|
|
35
35
|
|
|
36
|
-
this.setDefaultValues(
|
|
36
|
+
this.setDefaultValues( _defaultValues );
|
|
37
37
|
|
|
38
38
|
this.setupShaders();
|
|
39
39
|
|
|
@@ -13,9 +13,9 @@ import { uv } from '../accessors/UVNode.js';
|
|
|
13
13
|
import { viewport } from '../display/ViewportNode.js';
|
|
14
14
|
import { dashSize, gapSize } from '../core/PropertyNode.js';
|
|
15
15
|
|
|
16
|
-
import { LineDashedMaterial } from '
|
|
16
|
+
import { LineDashedMaterial } from '../../materials/LineDashedMaterial.js';
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const _defaultValues = /*@__PURE__*/ new LineDashedMaterial();
|
|
19
19
|
|
|
20
20
|
class Line2NodeMaterial extends NodeMaterial {
|
|
21
21
|
|
|
@@ -26,7 +26,7 @@ class Line2NodeMaterial extends NodeMaterial {
|
|
|
26
26
|
this.normals = false;
|
|
27
27
|
this.lights = false;
|
|
28
28
|
|
|
29
|
-
this.setDefaultValues(
|
|
29
|
+
this.setDefaultValues( _defaultValues );
|
|
30
30
|
|
|
31
31
|
this.useAlphaToCoverage = true;
|
|
32
32
|
this.useColor = params.vertexColors;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import NodeMaterial, { addNodeMaterial } from './NodeMaterial.js';
|
|
2
2
|
|
|
3
|
-
import { LineBasicMaterial } from '
|
|
3
|
+
import { LineBasicMaterial } from '../../materials/LineBasicMaterial.js';
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const _defaultValues = /*@__PURE__*/ new LineBasicMaterial();
|
|
6
6
|
|
|
7
7
|
class LineBasicNodeMaterial extends NodeMaterial {
|
|
8
8
|
|
|
@@ -15,7 +15,7 @@ class LineBasicNodeMaterial extends NodeMaterial {
|
|
|
15
15
|
this.lights = false;
|
|
16
16
|
this.normals = false;
|
|
17
17
|
|
|
18
|
-
this.setDefaultValues(
|
|
18
|
+
this.setDefaultValues( _defaultValues );
|
|
19
19
|
|
|
20
20
|
this.setValues( parameters );
|
|
21
21
|
|
|
@@ -4,9 +4,10 @@ import { varying } from '../core/VaryingNode.js';
|
|
|
4
4
|
import { materialLineDashSize, materialLineGapSize, materialLineScale } from '../accessors/MaterialNode.js';
|
|
5
5
|
import { dashSize, gapSize } from '../core/PropertyNode.js';
|
|
6
6
|
import { float } from '../shadernode/ShaderNode.js';
|
|
7
|
-
import { LineDashedMaterial } from 'three';
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
import { LineDashedMaterial } from '../../materials/LineDashedMaterial.js';
|
|
9
|
+
|
|
10
|
+
const _defaultValues = /*@__PURE__*/ new LineDashedMaterial();
|
|
10
11
|
|
|
11
12
|
class LineDashedNodeMaterial extends NodeMaterial {
|
|
12
13
|
|
|
@@ -19,7 +20,7 @@ class LineDashedNodeMaterial extends NodeMaterial {
|
|
|
19
20
|
this.lights = false;
|
|
20
21
|
this.normals = false;
|
|
21
22
|
|
|
22
|
-
this.setDefaultValues(
|
|
23
|
+
this.setDefaultValues( _defaultValues );
|
|
23
24
|
|
|
24
25
|
this.offsetNode = null;
|
|
25
26
|
this.dashScaleNode = null;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import NodeMaterial, { addNodeMaterial } from './NodeMaterial.js';
|
|
2
|
+
import { materialLightMap } from '../accessors/MaterialNode.js';
|
|
3
|
+
import { MeshBasicMaterial } from '../../materials/MeshBasicMaterial.js';
|
|
4
|
+
import BasicEnvironmentNode from '../lighting/BasicEnvironmentNode.js';
|
|
5
|
+
import BasicLightMapNode from '../lighting/BasicLightMapNode.js';
|
|
6
|
+
import BasicLightingModel from '../functions/BasicLightingModel.js';
|
|
7
|
+
import { transformedNormalView, normalView } from '../accessors/NormalNode.js';
|
|
8
|
+
import { diffuseColor } from '../core/PropertyNode.js';
|
|
9
|
+
|
|
10
|
+
const _defaultValues = /*@__PURE__*/ new MeshBasicMaterial();
|
|
11
|
+
|
|
12
|
+
class MeshBasicNodeMaterial extends NodeMaterial {
|
|
13
|
+
|
|
14
|
+
constructor( parameters ) {
|
|
15
|
+
|
|
16
|
+
super();
|
|
17
|
+
|
|
18
|
+
this.isMeshBasicNodeMaterial = true;
|
|
19
|
+
|
|
20
|
+
this.lights = true;
|
|
21
|
+
//this.normals = false; @TODO: normals usage by context
|
|
22
|
+
|
|
23
|
+
this.setDefaultValues( _defaultValues );
|
|
24
|
+
|
|
25
|
+
this.setValues( parameters );
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
setupNormal() {
|
|
30
|
+
|
|
31
|
+
transformedNormalView.assign( normalView ); // see #28839
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
setupEnvironment( builder ) {
|
|
36
|
+
|
|
37
|
+
const envNode = super.setupEnvironment( builder );
|
|
38
|
+
|
|
39
|
+
return envNode ? new BasicEnvironmentNode( envNode ) : null;
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
setupLightMap( builder ) {
|
|
44
|
+
|
|
45
|
+
let node = null;
|
|
46
|
+
|
|
47
|
+
if ( builder.material.lightMap ) {
|
|
48
|
+
|
|
49
|
+
node = new BasicLightMapNode( materialLightMap );
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return node;
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
setupOutgoingLight() {
|
|
58
|
+
|
|
59
|
+
return diffuseColor.rgb;
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
setupLightingModel() {
|
|
64
|
+
|
|
65
|
+
return new BasicLightingModel();
|
|
66
|
+
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default MeshBasicNodeMaterial;
|
|
72
|
+
|
|
73
|
+
addNodeMaterial( 'MeshBasicNodeMaterial', MeshBasicNodeMaterial );
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import NodeMaterial, { addNodeMaterial } from './NodeMaterial.js';
|
|
2
|
+
import BasicEnvironmentNode from '../lighting/BasicEnvironmentNode.js';
|
|
2
3
|
import PhongLightingModel from '../functions/PhongLightingModel.js';
|
|
3
4
|
|
|
4
|
-
import { MeshLambertMaterial } from '
|
|
5
|
+
import { MeshLambertMaterial } from '../../materials/MeshLambertMaterial.js';
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
+
const _defaultValues = /*@__PURE__*/ new MeshLambertMaterial();
|
|
7
8
|
|
|
8
9
|
class MeshLambertNodeMaterial extends NodeMaterial {
|
|
9
10
|
|
|
@@ -15,12 +16,20 @@ class MeshLambertNodeMaterial extends NodeMaterial {
|
|
|
15
16
|
|
|
16
17
|
this.lights = true;
|
|
17
18
|
|
|
18
|
-
this.setDefaultValues(
|
|
19
|
+
this.setDefaultValues( _defaultValues );
|
|
19
20
|
|
|
20
21
|
this.setValues( parameters );
|
|
21
22
|
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
setupEnvironment( builder ) {
|
|
26
|
+
|
|
27
|
+
const envNode = super.setupEnvironment( builder );
|
|
28
|
+
|
|
29
|
+
return envNode ? new BasicEnvironmentNode( envNode ) : null;
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
24
33
|
setupLightingModel( /*builder*/ ) {
|
|
25
34
|
|
|
26
35
|
return new PhongLightingModel( false ); // ( specular ) -> force lambert
|
|
@@ -2,11 +2,12 @@ import NodeMaterial, { addNodeMaterial } from './NodeMaterial.js';
|
|
|
2
2
|
import { materialReference } from '../accessors/MaterialReferenceNode.js';
|
|
3
3
|
import { diffuseColor } from '../core/PropertyNode.js';
|
|
4
4
|
import { vec3 } from '../shadernode/ShaderNode.js';
|
|
5
|
-
import { MeshMatcapMaterial } from 'three';
|
|
6
5
|
import { mix } from '../math/MathNode.js';
|
|
7
6
|
import { matcapUV } from '../utils/MatcapUVNode.js';
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
import { MeshMatcapMaterial } from '../../materials/MeshMatcapMaterial.js';
|
|
9
|
+
|
|
10
|
+
const _defaultValues = /*@__PURE__*/ new MeshMatcapMaterial();
|
|
10
11
|
|
|
11
12
|
class MeshMatcapNodeMaterial extends NodeMaterial {
|
|
12
13
|
|
|
@@ -14,11 +15,11 @@ class MeshMatcapNodeMaterial extends NodeMaterial {
|
|
|
14
15
|
|
|
15
16
|
super();
|
|
16
17
|
|
|
17
|
-
this.isMeshMatcapNodeMaterial = true;
|
|
18
|
-
|
|
19
18
|
this.lights = false;
|
|
20
19
|
|
|
21
|
-
this.
|
|
20
|
+
this.isMeshMatcapNodeMaterial = true;
|
|
21
|
+
|
|
22
|
+
this.setDefaultValues( _defaultValues );
|
|
22
23
|
|
|
23
24
|
this.setValues( parameters );
|
|
24
25
|
|
|
@@ -5,9 +5,9 @@ import { materialOpacity } from '../accessors/MaterialNode.js';
|
|
|
5
5
|
import { transformedNormalView } from '../accessors/NormalNode.js';
|
|
6
6
|
import { float, vec4 } from '../shadernode/ShaderNode.js';
|
|
7
7
|
|
|
8
|
-
import { MeshNormalMaterial } from '
|
|
8
|
+
import { MeshNormalMaterial } from '../../materials/MeshNormalMaterial.js';
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const _defaultValues = /*@__PURE__*/ new MeshNormalMaterial();
|
|
11
11
|
|
|
12
12
|
class MeshNormalNodeMaterial extends NodeMaterial {
|
|
13
13
|
|
|
@@ -15,9 +15,11 @@ class MeshNormalNodeMaterial extends NodeMaterial {
|
|
|
15
15
|
|
|
16
16
|
super();
|
|
17
17
|
|
|
18
|
+
this.lights = false;
|
|
19
|
+
|
|
18
20
|
this.isMeshNormalNodeMaterial = true;
|
|
19
21
|
|
|
20
|
-
this.setDefaultValues(
|
|
22
|
+
this.setDefaultValues( _defaultValues );
|
|
21
23
|
|
|
22
24
|
this.setValues( parameters );
|
|
23
25
|
|
|
@@ -2,11 +2,12 @@ import NodeMaterial, { addNodeMaterial } from './NodeMaterial.js';
|
|
|
2
2
|
import { shininess, specularColor } from '../core/PropertyNode.js';
|
|
3
3
|
import { materialShininess, materialSpecular } from '../accessors/MaterialNode.js';
|
|
4
4
|
import { float } from '../shadernode/ShaderNode.js';
|
|
5
|
+
import BasicEnvironmentNode from '../lighting/BasicEnvironmentNode.js';
|
|
5
6
|
import PhongLightingModel from '../functions/PhongLightingModel.js';
|
|
6
7
|
|
|
7
|
-
import { MeshPhongMaterial } from '
|
|
8
|
+
import { MeshPhongMaterial } from '../../materials/MeshPhongMaterial.js';
|
|
8
9
|
|
|
9
|
-
const
|
|
10
|
+
const _defaultValues = /*@__PURE__*/ new MeshPhongMaterial();
|
|
10
11
|
|
|
11
12
|
class MeshPhongNodeMaterial extends NodeMaterial {
|
|
12
13
|
|
|
@@ -21,12 +22,19 @@ class MeshPhongNodeMaterial extends NodeMaterial {
|
|
|
21
22
|
this.shininessNode = null;
|
|
22
23
|
this.specularNode = null;
|
|
23
24
|
|
|
24
|
-
this.setDefaultValues(
|
|
25
|
+
this.setDefaultValues( _defaultValues );
|
|
25
26
|
|
|
26
27
|
this.setValues( parameters );
|
|
27
28
|
|
|
28
29
|
}
|
|
29
30
|
|
|
31
|
+
setupEnvironment( builder ) {
|
|
32
|
+
|
|
33
|
+
const envNode = super.setupEnvironment( builder );
|
|
34
|
+
|
|
35
|
+
return envNode ? new BasicEnvironmentNode( envNode ) : null;
|
|
36
|
+
|
|
37
|
+
}
|
|
30
38
|
setupLightingModel( /*builder*/ ) {
|
|
31
39
|
|
|
32
40
|
return new PhongLightingModel();
|
|
@@ -8,9 +8,10 @@ import { TBNViewMatrix } from '../accessors/AccessorsUtils.js';
|
|
|
8
8
|
import PhysicalLightingModel from '../functions/PhysicalLightingModel.js';
|
|
9
9
|
import MeshStandardNodeMaterial from './MeshStandardNodeMaterial.js';
|
|
10
10
|
import { mix, pow2, min } from '../math/MathNode.js';
|
|
11
|
-
import { MeshPhysicalMaterial } from 'three';
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
import { MeshPhysicalMaterial } from '../../materials/MeshPhysicalMaterial.js';
|
|
13
|
+
|
|
14
|
+
const _defaultValues = /*@__PURE__*/ new MeshPhysicalMaterial();
|
|
14
15
|
|
|
15
16
|
class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
|
|
16
17
|
|
|
@@ -43,7 +44,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
|
|
|
43
44
|
|
|
44
45
|
this.anisotropyNode = null;
|
|
45
46
|
|
|
46
|
-
this.setDefaultValues(
|
|
47
|
+
this.setDefaultValues( _defaultValues );
|
|
47
48
|
|
|
48
49
|
this.setValues( parameters );
|
|
49
50
|
|
|
@@ -157,7 +158,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
|
|
|
157
158
|
|
|
158
159
|
} ).else( () => {
|
|
159
160
|
|
|
160
|
-
anisotropyV.divAssign( anisotropy );
|
|
161
|
+
anisotropyV.divAssign( vec2( anisotropy ) );
|
|
161
162
|
anisotropy.assign( anisotropy.saturate() );
|
|
162
163
|
|
|
163
164
|
} );
|
|
@@ -4,11 +4,12 @@ import { mix } from '../math/MathNode.js';
|
|
|
4
4
|
import { materialRoughness, materialMetalness } from '../accessors/MaterialNode.js';
|
|
5
5
|
import getRoughness from '../functions/material/getRoughness.js';
|
|
6
6
|
import PhysicalLightingModel from '../functions/PhysicalLightingModel.js';
|
|
7
|
+
import EnvironmentNode from '../lighting/EnvironmentNode.js';
|
|
7
8
|
import { float, vec3, vec4 } from '../shadernode/ShaderNode.js';
|
|
8
9
|
|
|
9
|
-
import { MeshStandardMaterial } from '
|
|
10
|
+
import { MeshStandardMaterial } from '../../materials/MeshStandardMaterial.js';
|
|
10
11
|
|
|
11
|
-
const
|
|
12
|
+
const _defaultValues = /*@__PURE__*/ new MeshStandardMaterial();
|
|
12
13
|
|
|
13
14
|
class MeshStandardNodeMaterial extends NodeMaterial {
|
|
14
15
|
|
|
@@ -18,17 +19,27 @@ class MeshStandardNodeMaterial extends NodeMaterial {
|
|
|
18
19
|
|
|
19
20
|
this.isMeshStandardNodeMaterial = true;
|
|
20
21
|
|
|
22
|
+
this.lights = true;
|
|
23
|
+
|
|
21
24
|
this.emissiveNode = null;
|
|
22
25
|
|
|
23
26
|
this.metalnessNode = null;
|
|
24
27
|
this.roughnessNode = null;
|
|
25
28
|
|
|
26
|
-
this.setDefaultValues(
|
|
29
|
+
this.setDefaultValues( _defaultValues );
|
|
27
30
|
|
|
28
31
|
this.setValues( parameters );
|
|
29
32
|
|
|
30
33
|
}
|
|
31
34
|
|
|
35
|
+
setupEnvironment( builder ) {
|
|
36
|
+
|
|
37
|
+
const envNode = super.setupEnvironment( builder );
|
|
38
|
+
|
|
39
|
+
return envNode ? new EnvironmentNode( envNode ) : null;
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
|
|
32
43
|
setupLightingModel( /*builder*/ ) {
|
|
33
44
|
|
|
34
45
|
return new PhysicalLightingModel();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import NodeMaterial, { addNodeMaterial } from './NodeMaterial.js';
|
|
2
2
|
import ToonLightingModel from '../functions/ToonLightingModel.js';
|
|
3
3
|
|
|
4
|
-
import { MeshToonMaterial } from '
|
|
4
|
+
import { MeshToonMaterial } from '../../materials/MeshToonMaterial.js';
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const _defaultValues = /*@__PURE__*/ new MeshToonMaterial();
|
|
7
7
|
|
|
8
8
|
class MeshToonNodeMaterial extends NodeMaterial {
|
|
9
9
|
|
|
@@ -15,7 +15,7 @@ class MeshToonNodeMaterial extends NodeMaterial {
|
|
|
15
15
|
|
|
16
16
|
this.lights = true;
|
|
17
17
|
|
|
18
|
-
this.setDefaultValues(
|
|
18
|
+
this.setDefaultValues( _defaultValues );
|
|
19
19
|
|
|
20
20
|
this.setValues( parameters );
|
|
21
21
|
|