super-three 0.165.0 → 0.168.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/three.cjs +854 -410
- package/build/three.module.js +849 -411
- package/build/three.module.min.js +1 -1
- package/build/three.webgpu.js +77755 -0
- package/build/three.webgpu.min.js +6 -0
- package/examples/jsm/Addons.js +5 -2
- package/examples/jsm/animation/AnimationClipCreator.js +1 -1
- package/examples/jsm/capabilities/WebGL.js +27 -21
- package/examples/jsm/controls/ArcballControls.js +174 -158
- package/examples/jsm/controls/DragControls.js +260 -132
- package/examples/jsm/controls/FirstPersonControls.js +175 -163
- package/examples/jsm/controls/FlyControls.js +194 -188
- package/examples/jsm/controls/OrbitControls.js +777 -786
- package/examples/jsm/controls/PointerLockControls.js +24 -15
- package/examples/jsm/controls/TrackballControls.js +453 -452
- package/examples/jsm/csm/CSMShader.js +4 -4
- package/examples/jsm/effects/AnaglyphEffect.js +6 -13
- package/examples/jsm/effects/ParallaxBarrierEffect.js +17 -11
- package/examples/jsm/effects/StereoEffect.js +6 -1
- package/examples/jsm/environments/RoomEnvironment.js +1 -1
- package/examples/jsm/exporters/GLTFExporter.js +13 -4
- package/examples/jsm/exporters/USDZExporter.js +29 -8
- package/examples/jsm/geometries/TeapotGeometry.js +1 -1
- package/examples/jsm/helpers/LightProbeHelper.js +42 -43
- 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/KTX2Loader.js +19 -7
- package/examples/jsm/loaders/MaterialXLoader.js +10 -10
- package/examples/jsm/loaders/PCDLoader.js +9 -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/objects/SkyMesh.js +188 -0
- package/examples/jsm/objects/Water2Mesh.js +159 -0
- package/examples/jsm/objects/WaterMesh.js +102 -0
- package/examples/jsm/physics/RapierPhysics.js +20 -0
- package/examples/jsm/postprocessing/OutlinePass.js +31 -46
- package/examples/jsm/postprocessing/RenderTransitionPass.js +13 -38
- package/examples/jsm/postprocessing/SSAARenderPass.js +3 -1
- package/examples/jsm/postprocessing/SSAOPass.js +6 -9
- package/examples/jsm/postprocessing/UnrealBloomPass.js +4 -4
- package/examples/jsm/shaders/BleachBypassShader.js +1 -2
- 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/shaders/OutputShader.js +1 -1
- package/examples/jsm/transpiler/GLSLDecoder.js +46 -4
- package/examples/jsm/transpiler/TSLEncoder.js +24 -22
- package/examples/jsm/utils/TextureUtils.js +1 -1
- package/package.json +8 -6
- package/src/Three.WebGPU.js +200 -0
- package/src/Three.js +3 -0
- package/src/constants.js +4 -1
- package/src/core/Object3D.js +22 -22
- package/src/extras/Controls.js +32 -0
- 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/{examples/jsm/nodes/loaders → src/loaders/nodes}/NodeLoader.js +6 -4
- package/{examples/jsm/nodes/loaders → src/loaders/nodes}/NodeMaterialLoader.js +2 -2
- package/{examples/jsm/nodes/loaders → src/loaders/nodes}/NodeObjectLoader.js +2 -1
- package/src/materials/Material.js +7 -1
- package/{examples/jsm/nodes/materials → src/materials/nodes}/InstancedPointsNodeMaterial.js +36 -27
- package/{examples/jsm/nodes/materials → src/materials/nodes}/Line2NodeMaterial.js +37 -40
- package/src/materials/nodes/LineBasicNodeMaterial.js +27 -0
- package/{examples/jsm/nodes/materials → src/materials/nodes}/LineDashedNodeMaterial.js +10 -11
- package/src/materials/nodes/MeshBasicNodeMaterial.js +73 -0
- package/src/materials/nodes/MeshLambertNodeMaterial.js +43 -0
- package/src/materials/nodes/MeshMatcapNodeMaterial.js +53 -0
- package/src/materials/nodes/MeshNormalNodeMaterial.js +40 -0
- package/src/materials/nodes/MeshPhongNodeMaterial.js +74 -0
- package/{examples/jsm/nodes/materials → src/materials/nodes}/MeshPhysicalNodeMaterial.js +22 -20
- package/{examples/jsm/nodes/materials → src/materials/nodes}/MeshSSSNodeMaterial.js +6 -6
- package/{examples/jsm/nodes/materials → src/materials/nodes}/MeshStandardNodeMaterial.js +28 -11
- package/src/materials/nodes/MeshToonNodeMaterial.js +34 -0
- package/{examples/jsm/nodes/materials → src/materials/nodes}/NodeMaterial.js +142 -96
- package/{examples/jsm/nodes/materials/Materials.js → src/materials/nodes/NodeMaterials.js} +1 -1
- package/{examples/jsm/nodes/materials → src/materials/nodes}/PointsNodeMaterial.js +5 -6
- package/src/materials/nodes/ShadowNodeMaterial.js +34 -0
- package/{examples/jsm/nodes/materials → src/materials/nodes}/SpriteNodeMaterial.js +13 -13
- package/{examples/jsm/nodes/materials → src/materials/nodes}/VolumeNodeMaterial.js +14 -16
- 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/src/nodes/Nodes.js +164 -0
- package/src/nodes/TSL.js +176 -0
- package/{examples/jsm → src}/nodes/accessors/AccessorsUtils.js +8 -8
- package/src/nodes/accessors/BatchNode.js +124 -0
- package/{examples/jsm/nodes/accessors/BitangentNode.js → src/nodes/accessors/Bitangent.js} +9 -9
- package/{examples/jsm → src}/nodes/accessors/BufferAttributeNode.js +41 -6
- package/{examples/jsm → src}/nodes/accessors/BufferNode.js +4 -4
- package/src/nodes/accessors/Camera.js +19 -0
- package/{examples/jsm → src}/nodes/accessors/ClippingNode.js +16 -14
- package/src/nodes/accessors/CubeTextureNode.js +76 -0
- package/src/nodes/accessors/InstanceNode.js +144 -0
- package/src/nodes/accessors/InstancedPointsMaterialNode.js +21 -0
- package/{examples/jsm → src}/nodes/accessors/MaterialNode.js +66 -49
- package/src/nodes/accessors/MaterialProperties.js +3 -0
- package/{examples/jsm → src}/nodes/accessors/MaterialReferenceNode.js +6 -4
- package/src/nodes/accessors/ModelNode.js +37 -0
- package/{examples/jsm → src}/nodes/accessors/ModelViewProjectionNode.js +6 -7
- package/{examples/jsm → src}/nodes/accessors/MorphNode.js +35 -31
- package/src/nodes/accessors/Normal.js +62 -0
- package/{examples/jsm → src}/nodes/accessors/Object3DNode.js +11 -11
- package/src/nodes/accessors/PointUVNode.js +26 -0
- package/src/nodes/accessors/Position.js +10 -0
- package/src/nodes/accessors/ReferenceBaseNode.js +143 -0
- package/{examples/jsm → src}/nodes/accessors/ReferenceNode.js +14 -8
- package/src/nodes/accessors/ReflectVector.js +10 -0
- package/{examples/jsm → src}/nodes/accessors/RendererReferenceNode.js +6 -6
- package/{examples/jsm → src}/nodes/accessors/SceneNode.js +5 -6
- package/src/nodes/accessors/SkinningNode.js +187 -0
- package/{examples/jsm → src}/nodes/accessors/StorageBufferNode.js +54 -6
- package/{examples/jsm → src}/nodes/accessors/StorageTextureNode.js +16 -7
- package/src/nodes/accessors/Tangent.js +22 -0
- package/{examples/jsm → src}/nodes/accessors/Texture3DNode.js +11 -11
- package/{examples/jsm/nodes/accessors/TextureBicubicNode.js → src/nodes/accessors/TextureBicubic.js} +3 -32
- package/{examples/jsm → src}/nodes/accessors/TextureNode.js +69 -37
- package/{examples/jsm → src}/nodes/accessors/TextureSizeNode.js +4 -6
- package/{examples/jsm/nodes/accessors/UniformsNode.js → src/nodes/accessors/UniformArrayNode.js} +24 -9
- package/{examples/jsm → src}/nodes/accessors/UserDataNode.js +4 -4
- package/src/nodes/accessors/VelocityNode.js +83 -0
- package/{examples/jsm → src}/nodes/accessors/VertexColorNode.js +6 -5
- package/{examples/jsm → src}/nodes/code/CodeNode.js +5 -5
- package/{examples/jsm → src}/nodes/code/ExpressionNode.js +4 -4
- package/{examples/jsm → src}/nodes/code/FunctionCallNode.js +5 -5
- package/{examples/jsm → src}/nodes/code/FunctionNode.js +5 -23
- package/{examples/jsm → src}/nodes/code/ScriptableNode.js +18 -6
- package/{examples/jsm → src}/nodes/code/ScriptableValueNode.js +6 -7
- package/{examples/jsm → src}/nodes/core/AssignNode.js +5 -5
- package/{examples/jsm → src}/nodes/core/AttributeNode.js +22 -21
- package/{examples/jsm → src}/nodes/core/BypassNode.js +5 -5
- package/src/nodes/core/CacheNode.js +46 -0
- package/{examples/jsm → src}/nodes/core/ConstNode.js +2 -2
- package/{examples/jsm → src}/nodes/core/ContextNode.js +17 -11
- package/{examples/jsm → src}/nodes/core/IndexNode.js +17 -6
- package/{examples/jsm → src}/nodes/core/InputNode.js +2 -2
- package/{examples/jsm → src}/nodes/core/LightingModel.js +2 -2
- package/src/nodes/core/MRTNode.js +82 -0
- package/{examples/jsm → src}/nodes/core/Node.js +57 -31
- package/{examples/jsm → src}/nodes/core/NodeBuilder.js +216 -65
- 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 +7 -1
- package/{examples/jsm → src}/nodes/core/OutputStructNode.js +4 -4
- package/{examples/jsm → src}/nodes/core/ParameterNode.js +4 -4
- package/src/nodes/core/PropertyNode.js +84 -0
- package/{examples/jsm → src}/nodes/core/StackNode.js +26 -10
- package/{examples/jsm → src}/nodes/core/StructTypeNode.js +2 -2
- package/{examples/jsm → src}/nodes/core/TempNode.js +4 -4
- package/src/nodes/core/UniformGroupNode.js +55 -0
- package/{examples/jsm → src}/nodes/core/UniformNode.js +14 -5
- package/{examples/jsm → src}/nodes/core/VarNode.js +8 -12
- package/{examples/jsm → src}/nodes/core/VaryingNode.js +13 -5
- package/{examples/jsm → src}/nodes/display/AfterImageNode.js +27 -35
- package/src/nodes/display/AnaglyphPassNode.js +61 -0
- package/{examples/jsm → src}/nodes/display/AnamorphicNode.js +27 -30
- package/src/nodes/display/BleachBypass.js +26 -0
- package/src/nodes/display/BlendMode.js +54 -0
- package/src/nodes/display/BloomNode.js +335 -0
- package/{examples/jsm → src}/nodes/display/BumpMapNode.js +7 -12
- package/src/nodes/display/ColorAdjustment.js +46 -0
- package/src/nodes/display/ColorSpaceFunctions.js +38 -0
- package/src/nodes/display/ColorSpaceNode.js +85 -0
- package/src/nodes/display/DenoiseNode.js +201 -0
- package/src/nodes/display/DepthOfFieldNode.js +121 -0
- package/src/nodes/display/DotScreenNode.js +63 -0
- package/src/nodes/display/FXAANode.js +329 -0
- package/src/nodes/display/FilmNode.js +53 -0
- package/src/nodes/display/FrontFacingNode.js +41 -0
- package/src/nodes/display/GTAONode.js +328 -0
- package/{examples/jsm → src}/nodes/display/GaussianBlurNode.js +44 -24
- package/src/nodes/display/Lut3DNode.js +54 -0
- package/src/nodes/display/MotionBlur.js +25 -0
- package/{examples/jsm → src}/nodes/display/NormalMapNode.js +9 -11
- package/src/nodes/display/ParallaxBarrierPassNode.js +55 -0
- package/src/nodes/display/PassNode.js +367 -0
- package/src/nodes/display/PixelationPassNode.js +206 -0
- package/{examples/jsm → src}/nodes/display/PosterizeNode.js +4 -6
- package/src/nodes/display/RGBShiftNode.js +50 -0
- package/src/nodes/display/RenderOutputNode.js +56 -0
- package/src/nodes/display/SSAAPassNode.js +284 -0
- package/src/nodes/display/Sepia.js +17 -0
- package/src/nodes/display/SobelOperatorNode.js +123 -0
- package/src/nodes/display/StereoCompositePassNode.js +107 -0
- package/src/nodes/display/StereoPassNode.js +80 -0
- package/src/nodes/display/ToneMappingFunctions.js +190 -0
- package/src/nodes/display/ToneMappingNode.js +66 -0
- package/src/nodes/display/TransitionNode.js +77 -0
- package/src/nodes/display/ViewportDepthNode.js +121 -0
- package/src/nodes/display/ViewportDepthTextureNode.js +30 -0
- package/{examples/jsm → src}/nodes/display/ViewportNode.js +28 -26
- package/src/nodes/display/ViewportSharedTextureNode.js +36 -0
- package/{examples/jsm → src}/nodes/display/ViewportTextureNode.js +12 -12
- package/{examples/jsm → src}/nodes/fog/FogExp2Node.js +4 -6
- package/{examples/jsm → src}/nodes/fog/FogNode.js +5 -7
- package/{examples/jsm → src}/nodes/fog/FogRangeNode.js +4 -6
- package/{examples/jsm → src}/nodes/functions/BSDF/BRDF_GGX.js +4 -4
- package/{examples/jsm → src}/nodes/functions/BSDF/BRDF_Lambert.js +2 -2
- package/{examples/jsm → src}/nodes/functions/BSDF/BRDF_Sheen.js +6 -6
- package/{examples/jsm → src}/nodes/functions/BSDF/DFGApprox.js +2 -2
- package/{examples/jsm → src}/nodes/functions/BSDF/D_GGX.js +2 -2
- package/{examples/jsm → src}/nodes/functions/BSDF/D_GGX_Anisotropic.js +3 -3
- package/{examples/jsm → src}/nodes/functions/BSDF/EnvironmentBRDF.js +2 -2
- package/{examples/jsm → src}/nodes/functions/BSDF/F_Schlick.js +2 -2
- package/src/nodes/functions/BSDF/LTC.js +131 -0
- package/{examples/jsm → src}/nodes/functions/BSDF/Schlick_to_F0.js +2 -2
- package/{examples/jsm → src}/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +2 -2
- package/{examples/jsm → src}/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +2 -2
- package/src/nodes/functions/BasicLightingModel.js +78 -0
- package/{examples/jsm → src}/nodes/functions/PhongLightingModel.js +10 -8
- package/{examples/jsm → src}/nodes/functions/PhysicalLightingModel.js +73 -31
- package/{examples/jsm → src}/nodes/functions/ShadowMaskModel.js +1 -1
- package/{examples/jsm → src}/nodes/functions/ToonLightingModel.js +6 -4
- package/src/nodes/functions/material/getGeometryRoughness.js +13 -0
- package/{examples/jsm → src}/nodes/functions/material/getRoughness.js +2 -2
- package/{examples/jsm → src}/nodes/geometry/RangeNode.js +23 -10
- package/{examples/jsm → src}/nodes/gpgpu/ComputeNode.js +5 -5
- package/src/nodes/lighting/AONode.js +24 -0
- package/{examples/jsm → src}/nodes/lighting/AmbientLightNode.js +2 -7
- package/src/nodes/lighting/AnalyticLightNode.js +354 -0
- package/src/nodes/lighting/BasicEnvironmentNode.js +27 -0
- package/src/nodes/lighting/BasicLightMapNode.js +29 -0
- package/{examples/jsm → src}/nodes/lighting/DirectionalLightNode.js +3 -9
- package/{examples/jsm → src}/nodes/lighting/EnvironmentNode.js +23 -21
- package/{examples/jsm → src}/nodes/lighting/HemisphereLightNode.js +4 -7
- package/{examples/jsm → src}/nodes/lighting/IESSpotLightNode.js +3 -8
- package/{examples/jsm → src}/nodes/lighting/IrradianceNode.js +2 -2
- package/{examples/jsm → src}/nodes/lighting/LightNode.js +5 -5
- package/src/nodes/lighting/LightProbeNode.js +76 -0
- package/{examples/jsm → src}/nodes/lighting/LightUtils.js +3 -3
- package/src/nodes/lighting/LightingContextNode.js +64 -0
- package/{examples/jsm → src}/nodes/lighting/LightingNode.js +4 -2
- package/src/nodes/lighting/LightsNode.js +231 -0
- package/{examples/jsm → src}/nodes/lighting/PointLightNode.js +4 -10
- package/src/nodes/lighting/RectAreaLightNode.js +93 -0
- package/{examples/jsm → src}/nodes/lighting/SpotLightNode.js +4 -10
- package/{examples/jsm → src}/nodes/materialx/MaterialXNodes.js +2 -2
- package/{examples/jsm → src}/nodes/materialx/lib/mx_hsv.js +43 -46
- package/{examples/jsm → src}/nodes/materialx/lib/mx_noise.js +500 -603
- package/{examples/jsm → src}/nodes/materialx/lib/mx_transform_color.js +3 -9
- package/{examples/jsm/nodes/math/CondNode.js → src/nodes/math/ConditionalNode.js} +31 -13
- package/src/nodes/math/Hash.js +13 -0
- package/src/nodes/math/MathNode.js +404 -0
- package/{examples/jsm → src}/nodes/math/MathUtils.js +0 -7
- package/{examples/jsm → src}/nodes/math/OperatorNode.js +100 -58
- package/{examples/jsm → src}/nodes/math/TriNoise3D.js +19 -29
- package/{examples/jsm → src}/nodes/parsers/GLSLNodeFunction.js +7 -7
- package/{examples/jsm → src}/nodes/pmrem/PMREMNode.js +60 -16
- package/{examples/jsm → src}/nodes/pmrem/PMREMUtils.js +46 -46
- package/src/nodes/procedural/Checker.js +14 -0
- package/src/nodes/tsl/TSLBase.js +30 -0
- package/{examples/jsm/nodes/shadernode/ShaderNode.js → src/nodes/tsl/TSLCore.js} +106 -96
- package/{examples/jsm → src}/nodes/utils/ArrayElementNode.js +2 -2
- package/{examples/jsm → src}/nodes/utils/ConvertNode.js +2 -2
- package/src/nodes/utils/CubeMapNode.js +157 -0
- package/src/nodes/utils/Discard.js +8 -0
- package/{examples/jsm → src}/nodes/utils/EquirectUVNode.js +5 -5
- package/src/nodes/utils/FlipNode.js +65 -0
- package/{examples/jsm → src}/nodes/utils/FunctionOverloadingNode.js +7 -5
- package/{examples/jsm → src}/nodes/utils/JoinNode.js +2 -2
- package/{examples/jsm → src}/nodes/utils/LoopNode.js +19 -12
- package/{examples/jsm → src}/nodes/utils/MatcapUVNode.js +6 -6
- package/{examples/jsm → src}/nodes/utils/MaxMipLevelNode.js +12 -6
- package/{examples/jsm → src}/nodes/utils/OscNode.js +7 -7
- package/src/nodes/utils/Packing.js +4 -0
- package/src/nodes/utils/RTTNode.js +130 -0
- package/{examples/jsm → src}/nodes/utils/ReflectorNode.js +17 -4
- package/{examples/jsm → src}/nodes/utils/RemapNode.js +7 -7
- package/{examples/jsm → src}/nodes/utils/RotateNode.js +4 -12
- package/{examples/jsm → src}/nodes/utils/SetNode.js +2 -2
- package/{examples/jsm → src}/nodes/utils/SplitNode.js +2 -2
- package/{examples/jsm → src}/nodes/utils/SpriteSheetUVNode.js +5 -5
- package/src/nodes/utils/SpriteUtils.js +47 -0
- package/{examples/jsm → src}/nodes/utils/StorageArrayElementNode.js +4 -6
- package/{examples/jsm → src}/nodes/utils/TimerNode.js +5 -5
- package/{examples/jsm → src}/nodes/utils/TriplanarTexturesNode.js +7 -9
- package/src/nodes/utils/UVUtils.js +19 -0
- package/src/nodes/utils/ViewportUtils.js +14 -0
- package/src/objects/BatchedMesh.js +169 -190
- package/src/objects/InstancedMesh.js +1 -1
- package/src/renderers/WebGLRenderer.js +60 -23
- 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 +12 -4
- package/src/renderers/common/BindGroup.js +18 -0
- package/{examples/jsm → src}/renderers/common/Bindings.js +45 -32
- package/{examples/jsm → src}/renderers/common/ClippingContext.js +18 -7
- package/{examples/jsm → src}/renderers/common/Color4.js +1 -1
- package/{examples/jsm → src}/renderers/common/CubeRenderTarget.js +16 -4
- 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 +90 -0
- package/{examples/jsm/objects → src/renderers/common}/QuadMesh.js +8 -3
- package/{examples/jsm → src}/renderers/common/RenderContext.js +25 -1
- package/{examples/jsm → src}/renderers/common/RenderContexts.js +1 -1
- package/{examples/jsm → src}/renderers/common/RenderList.js +1 -1
- package/{examples/jsm → src}/renderers/common/RenderObject.js +45 -12
- package/{examples/jsm → src}/renderers/common/Renderer.js +151 -73
- package/{examples/jsm → src}/renderers/common/SampledTexture.js +14 -5
- package/src/renderers/common/StandardRenderer.js +18 -0
- 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 +14 -14
- 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 +25 -25
- package/src/renderers/common/nodes/NodeBuilderState.js +58 -0
- package/src/renderers/common/nodes/NodeLibrary.js +118 -0
- package/{examples/jsm → src}/renderers/common/nodes/NodeSampledTexture.js +8 -7
- 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 +69 -21
- package/src/renderers/common/nodes/StandardNodeLibrary.js +105 -0
- 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/ShaderChunk/tonemapping_pars_fragment.glsl.js +2 -2
- 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 +27 -1
- package/src/renderers/webgl/WebGLPrograms.js +1 -1
- package/src/renderers/webgl/WebGLProperties.js +7 -0
- package/src/renderers/webgl/WebGLTextures.js +75 -57
- 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 +242 -120
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/nodes/GLSLNodeBuilder.js +227 -44
- 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 +22 -1
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLTextureUtils.js +62 -23
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLUtils.js +1 -1
- package/{examples/jsm → src}/renderers/webgpu/WebGPUBackend.js +242 -136
- package/{examples/jsm → src}/renderers/webgpu/WebGPURenderer.js +9 -9
- package/{examples/jsm → src}/renderers/webgpu/nodes/WGSLNodeBuilder.js +281 -107
- 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 +64 -33
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUConstants.js +4 -1
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUPipelineUtils.js +34 -36
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUTexturePassUtils.js +62 -5
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUTextureUtils.js +76 -44
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUUtils.js +42 -4
- package/src/renderers/webxr/WebXRDepthSensing.js +6 -0
- package/src/renderers/webxr/WebXRManager.js +37 -24
- package/src/textures/CompressedArrayTexture.js +1 -1
- package/examples/jsm/loaders/LogLuvLoader.js +0 -606
- package/examples/jsm/nodes/Nodes.js +0 -202
- package/examples/jsm/nodes/accessors/BatchNode.js +0 -78
- package/examples/jsm/nodes/accessors/CameraNode.js +0 -12
- package/examples/jsm/nodes/accessors/CubeTextureNode.js +0 -61
- package/examples/jsm/nodes/accessors/InstanceNode.js +0 -94
- package/examples/jsm/nodes/accessors/InstancedPointsMaterialNode.js +0 -21
- package/examples/jsm/nodes/accessors/ModelNode.js +0 -36
- package/examples/jsm/nodes/accessors/NormalNode.js +0 -14
- package/examples/jsm/nodes/accessors/PointUVNode.js +0 -26
- package/examples/jsm/nodes/accessors/PositionNode.js +0 -10
- package/examples/jsm/nodes/accessors/ReflectVectorNode.js +0 -6
- package/examples/jsm/nodes/accessors/SkinningNode.js +0 -124
- package/examples/jsm/nodes/accessors/TangentNode.js +0 -23
- package/examples/jsm/nodes/core/CacheNode.js +0 -49
- package/examples/jsm/nodes/core/NodeCache.js +0 -26
- package/examples/jsm/nodes/core/NodeKeywords.js +0 -80
- package/examples/jsm/nodes/core/PropertyNode.js +0 -83
- package/examples/jsm/nodes/core/UniformGroupNode.js +0 -36
- package/examples/jsm/nodes/display/BlendModeNode.js +0 -128
- package/examples/jsm/nodes/display/ColorAdjustmentNode.js +0 -99
- package/examples/jsm/nodes/display/ColorSpaceNode.js +0 -108
- package/examples/jsm/nodes/display/FrontFacingNode.js +0 -40
- package/examples/jsm/nodes/display/PassNode.js +0 -201
- package/examples/jsm/nodes/display/ToneMappingNode.js +0 -188
- package/examples/jsm/nodes/display/ViewportDepthNode.js +0 -97
- package/examples/jsm/nodes/display/ViewportDepthTextureNode.js +0 -31
- package/examples/jsm/nodes/display/ViewportSharedTextureNode.js +0 -37
- package/examples/jsm/nodes/functions/material/getGeometryRoughness.js +0 -13
- package/examples/jsm/nodes/lighting/AONode.js +0 -27
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +0 -256
- package/examples/jsm/nodes/lighting/LightingContextNode.js +0 -66
- package/examples/jsm/nodes/lighting/LightsNode.js +0 -215
- package/examples/jsm/nodes/materials/LineBasicNodeMaterial.js +0 -28
- package/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js +0 -28
- package/examples/jsm/nodes/materials/MeshLambertNodeMaterial.js +0 -34
- package/examples/jsm/nodes/materials/MeshMatcapNodeMaterial.js +0 -52
- package/examples/jsm/nodes/materials/MeshNormalNodeMaterial.js +0 -38
- package/examples/jsm/nodes/materials/MeshPhongNodeMaterial.js +0 -65
- package/examples/jsm/nodes/materials/MeshToonNodeMaterial.js +0 -34
- package/examples/jsm/nodes/materials/ShadowNodeMaterial.js +0 -34
- package/examples/jsm/nodes/math/HashNode.js +0 -34
- package/examples/jsm/nodes/math/MathNode.js +0 -391
- package/examples/jsm/nodes/procedural/CheckerNode.js +0 -42
- package/examples/jsm/nodes/utils/DiscardNode.js +0 -27
- package/examples/jsm/nodes/utils/PackingNode.js +0 -55
- package/examples/jsm/nodes/utils/RotateUVNode.js +0 -35
- 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/nodes/accessors/UVNode.js → src/nodes/accessors/UV.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/UniformGroup.js +0 -0
- /package/{examples/jsm → src}/nodes/core/constants.js +0 -0
- /package/{examples/jsm → src}/nodes/materialx/DISCLAIMER.md +0 -0
- /package/{examples/jsm → src}/nodes/parsers/GLSLNodeParser.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/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
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
// @TODO: We can simplify "export { default as SomeNode, other, exports } from '...'" to just "export * from '...'" if we will use only named exports
|
|
2
|
-
// this will also solve issues like "import TempNode from '../core/Node.js'"
|
|
3
|
-
|
|
4
|
-
// constants
|
|
5
|
-
export * from './core/constants.js';
|
|
6
|
-
|
|
7
|
-
// core
|
|
8
|
-
export { default as AssignNode, assign } from './core/AssignNode.js';
|
|
9
|
-
export { default as AttributeNode, attribute } from './core/AttributeNode.js';
|
|
10
|
-
export { default as BypassNode, bypass } from './core/BypassNode.js';
|
|
11
|
-
export { default as CacheNode, cache } from './core/CacheNode.js';
|
|
12
|
-
export { default as ConstNode } from './core/ConstNode.js';
|
|
13
|
-
export { default as ContextNode, context, label } from './core/ContextNode.js';
|
|
14
|
-
export { default as IndexNode, vertexIndex, instanceIndex } from './core/IndexNode.js';
|
|
15
|
-
export { default as LightingModel } from './core/LightingModel.js';
|
|
16
|
-
export { default as Node, addNodeClass, createNodeFromType } from './core/Node.js';
|
|
17
|
-
export { default as VarNode, temp } from './core/VarNode.js';
|
|
18
|
-
export { default as NodeAttribute } from './core/NodeAttribute.js';
|
|
19
|
-
export { default as NodeBuilder } from './core/NodeBuilder.js';
|
|
20
|
-
export { default as NodeCache } from './core/NodeCache.js';
|
|
21
|
-
export { default as NodeCode } from './core/NodeCode.js';
|
|
22
|
-
export { default as NodeFrame } from './core/NodeFrame.js';
|
|
23
|
-
export { default as NodeFunctionInput } from './core/NodeFunctionInput.js';
|
|
24
|
-
export { default as NodeKeywords } from './core/NodeKeywords.js';
|
|
25
|
-
export { default as NodeUniform } from './core/NodeUniform.js';
|
|
26
|
-
export { default as NodeVar } from './core/NodeVar.js';
|
|
27
|
-
export { default as NodeVarying } from './core/NodeVarying.js';
|
|
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';
|
|
30
|
-
export { default as StackNode, stack } from './core/StackNode.js';
|
|
31
|
-
export { default as TempNode } from './core/TempNode.js';
|
|
32
|
-
export { default as UniformGroupNode, uniformGroup, objectGroup, renderGroup, frameGroup } from './core/UniformGroupNode.js';
|
|
33
|
-
export { default as UniformNode, uniform } from './core/UniformNode.js';
|
|
34
|
-
export { default as VaryingNode, varying } from './core/VaryingNode.js';
|
|
35
|
-
export { default as OutputStructNode, outputStruct } from './core/OutputStructNode.js';
|
|
36
|
-
|
|
37
|
-
import * as NodeUtils from './core/NodeUtils.js';
|
|
38
|
-
export { NodeUtils };
|
|
39
|
-
|
|
40
|
-
// 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
|
-
|
|
43
|
-
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
|
-
export { default as CondNode, cond } from './math/CondNode.js';
|
|
45
|
-
export { default as HashNode, hash } from './math/HashNode.js';
|
|
46
|
-
|
|
47
|
-
// math utils
|
|
48
|
-
export { parabola, gain, pcurve, sinc } from './math/MathUtils.js';
|
|
49
|
-
export { triNoise3D } from './math/TriNoise3D.js';
|
|
50
|
-
|
|
51
|
-
// utils
|
|
52
|
-
export { default as ArrayElementNode } from './utils/ArrayElementNode.js';
|
|
53
|
-
export { default as ConvertNode } from './utils/ConvertNode.js';
|
|
54
|
-
export { default as DiscardNode, discard } from './utils/DiscardNode.js';
|
|
55
|
-
export { default as EquirectUVNode, equirectUV } from './utils/EquirectUVNode.js';
|
|
56
|
-
export { default as FunctionOverloadingNode, overloadingFn } from './utils/FunctionOverloadingNode.js';
|
|
57
|
-
export { default as JoinNode } from './utils/JoinNode.js';
|
|
58
|
-
export { default as LoopNode, loop, Continue, Break } from './utils/LoopNode.js';
|
|
59
|
-
export { default as MatcapUVNode, matcapUV } from './utils/MatcapUVNode.js';
|
|
60
|
-
export { default as MaxMipLevelNode, maxMipLevel } from './utils/MaxMipLevelNode.js';
|
|
61
|
-
export { default as OscNode, oscSine, oscSquare, oscTriangle, oscSawtooth } from './utils/OscNode.js';
|
|
62
|
-
export { default as PackingNode, directionToColor, colorToDirection } from './utils/PackingNode.js';
|
|
63
|
-
export { default as RemapNode, remap, remapClamp } from './utils/RemapNode.js';
|
|
64
|
-
export { default as RotateUVNode, rotateUV } from './utils/RotateUVNode.js';
|
|
65
|
-
export { default as RotateNode, rotate } from './utils/RotateNode.js';
|
|
66
|
-
export { default as SetNode } from './utils/SetNode.js';
|
|
67
|
-
export { default as SplitNode } from './utils/SplitNode.js';
|
|
68
|
-
export { default as SpriteSheetUVNode, spritesheetUV } from './utils/SpriteSheetUVNode.js';
|
|
69
|
-
export { default as StorageArrayElementNode } from './utils/StorageArrayElementNode.js';
|
|
70
|
-
export { default as TimerNode, timerLocal, timerGlobal, timerDelta, frameId } from './utils/TimerNode.js';
|
|
71
|
-
export { default as TriplanarTexturesNode, triplanarTextures, triplanarTexture } from './utils/TriplanarTexturesNode.js';
|
|
72
|
-
export { default as ReflectorNode, reflector } from './utils/ReflectorNode.js';
|
|
73
|
-
|
|
74
|
-
// shadernode
|
|
75
|
-
export * from './shadernode/ShaderNode.js';
|
|
76
|
-
|
|
77
|
-
// accessors
|
|
78
|
-
export { TBNViewMatrix, parallaxDirection, parallaxUV, transformedBentNormalView } from './accessors/AccessorsUtils.js';
|
|
79
|
-
export { default as UniformsNode, uniforms } from './accessors/UniformsNode.js';
|
|
80
|
-
export * from './accessors/BitangentNode.js';
|
|
81
|
-
export { default as BufferAttributeNode, bufferAttribute, dynamicBufferAttribute, instancedBufferAttribute, instancedDynamicBufferAttribute } from './accessors/BufferAttributeNode.js';
|
|
82
|
-
export { default as BufferNode, buffer } from './accessors/BufferNode.js';
|
|
83
|
-
export * from './accessors/CameraNode.js';
|
|
84
|
-
export { default as VertexColorNode, vertexColor } from './accessors/VertexColorNode.js';
|
|
85
|
-
export { default as CubeTextureNode, cubeTexture } from './accessors/CubeTextureNode.js';
|
|
86
|
-
export { default as InstanceNode, instance } from './accessors/InstanceNode.js';
|
|
87
|
-
export { default as BatchNode, batch } from './accessors/BatchNode.js';
|
|
88
|
-
export { default as MaterialNode, materialAlphaTest, materialColor, materialShininess, materialEmissive, materialOpacity, materialSpecular, materialSpecularStrength, materialReflectivity, materialRoughness, materialMetalness, materialNormal, materialClearcoat, materialClearcoatRoughness, materialClearcoatNormal, materialRotation, materialSheen, materialSheenRoughness, materialIridescence, materialIridescenceIOR, materialIridescenceThickness, materialLineScale, materialLineDashSize, materialLineGapSize, materialLineWidth, materialLineDashOffset, materialPointWidth, materialAnisotropy, materialAnisotropyVector, materialDispersion } from './accessors/MaterialNode.js';
|
|
89
|
-
export { default as MaterialReferenceNode, materialReference } from './accessors/MaterialReferenceNode.js';
|
|
90
|
-
export { default as RendererReferenceNode, rendererReference } from './accessors/RendererReferenceNode.js';
|
|
91
|
-
export { default as MorphNode, morphReference } from './accessors/MorphNode.js';
|
|
92
|
-
export { default as TextureBicubicNode, textureBicubic } from './accessors/TextureBicubicNode.js';
|
|
93
|
-
export { default as ModelNode, modelDirection, modelViewMatrix, modelNormalMatrix, modelWorldMatrix, modelPosition, modelViewPosition, modelScale, modelWorldMatrixInverse } from './accessors/ModelNode.js';
|
|
94
|
-
export { default as ModelViewProjectionNode, modelViewProjection } from './accessors/ModelViewProjectionNode.js';
|
|
95
|
-
export * from './accessors/NormalNode.js';
|
|
96
|
-
export { default as Object3DNode, objectDirection, objectViewMatrix, objectNormalMatrix, objectWorldMatrix, objectPosition, objectScale, objectViewPosition } from './accessors/Object3DNode.js';
|
|
97
|
-
export { default as PointUVNode, pointUV } from './accessors/PointUVNode.js';
|
|
98
|
-
export * from './accessors/PositionNode.js';
|
|
99
|
-
export { default as ReferenceNode, reference, referenceBuffer } from './accessors/ReferenceNode.js';
|
|
100
|
-
export * from './accessors/ReflectVectorNode.js';
|
|
101
|
-
export { default as SkinningNode, skinning } from './accessors/SkinningNode.js';
|
|
102
|
-
export { default as SceneNode, backgroundBlurriness, backgroundIntensity } from './accessors/SceneNode.js';
|
|
103
|
-
export { default as StorageBufferNode, storage, storageObject } from './accessors/StorageBufferNode.js';
|
|
104
|
-
export * from './accessors/TangentNode.js';
|
|
105
|
-
export { default as TextureNode, texture, textureLoad, /*textureLevel,*/ sampler } from './accessors/TextureNode.js';
|
|
106
|
-
export { default as StorageTextureNode, storageTexture, textureStore, storageTextureReadOnly, storageTextureReadWrite } from './accessors/StorageTextureNode.js';
|
|
107
|
-
export { default as Texture3DNode, texture3D } from './accessors/Texture3DNode.js';
|
|
108
|
-
export * from './accessors/UVNode.js';
|
|
109
|
-
export { default as UserDataNode, userData } from './accessors/UserDataNode.js';
|
|
110
|
-
|
|
111
|
-
// display
|
|
112
|
-
export { default as BlendModeNode, burn, dodge, overlay, screen } from './display/BlendModeNode.js';
|
|
113
|
-
export { default as BumpMapNode, bumpMap } from './display/BumpMapNode.js';
|
|
114
|
-
export { default as ColorAdjustmentNode, saturation, vibrance, hue, lumaCoeffs, luminance, threshold } from './display/ColorAdjustmentNode.js';
|
|
115
|
-
export { default as ColorSpaceNode, linearToColorSpace, colorSpaceToLinear, linearTosRGB, sRGBToLinear } from './display/ColorSpaceNode.js';
|
|
116
|
-
export { default as FrontFacingNode, frontFacing, faceDirection } from './display/FrontFacingNode.js';
|
|
117
|
-
export { default as NormalMapNode, normalMap } from './display/NormalMapNode.js';
|
|
118
|
-
export { default as PosterizeNode, posterize } from './display/PosterizeNode.js';
|
|
119
|
-
export { default as ToneMappingNode, toneMapping } from './display/ToneMappingNode.js';
|
|
120
|
-
export { default as ViewportNode, viewport, viewportCoordinate, viewportResolution, viewportTopLeft, viewportBottomLeft, viewportTopRight, viewportBottomRight } from './display/ViewportNode.js';
|
|
121
|
-
export { default as ViewportTextureNode, viewportTexture, viewportMipTexture } from './display/ViewportTextureNode.js';
|
|
122
|
-
export { default as ViewportSharedTextureNode, viewportSharedTexture } from './display/ViewportSharedTextureNode.js';
|
|
123
|
-
export { default as ViewportDepthTextureNode, viewportDepthTexture } from './display/ViewportDepthTextureNode.js';
|
|
124
|
-
export { default as ViewportDepthNode, viewZToOrthographicDepth, orthographicDepthToViewZ, viewZToPerspectiveDepth, perspectiveDepthToViewZ, depth, depthTexture, depthPixel } from './display/ViewportDepthNode.js';
|
|
125
|
-
export { default as GaussianBlurNode, gaussianBlur } from './display/GaussianBlurNode.js';
|
|
126
|
-
export { default as AfterImageNode, afterImage } from './display/AfterImageNode.js';
|
|
127
|
-
export { default as AnamorphicNode, anamorphic } from './display/AnamorphicNode.js';
|
|
128
|
-
|
|
129
|
-
export { default as PassNode, pass, texturePass, depthPass } from './display/PassNode.js';
|
|
130
|
-
|
|
131
|
-
// code
|
|
132
|
-
export { default as ExpressionNode, expression } from './code/ExpressionNode.js';
|
|
133
|
-
export { default as CodeNode, code, js, wgsl, glsl } from './code/CodeNode.js';
|
|
134
|
-
export { default as FunctionCallNode, call } from './code/FunctionCallNode.js';
|
|
135
|
-
export { default as FunctionNode, wgslFn, glslFn } from './code/FunctionNode.js';
|
|
136
|
-
export { default as ScriptableNode, scriptable, global } from './code/ScriptableNode.js';
|
|
137
|
-
export { default as ScriptableValueNode, scriptableValue } from './code/ScriptableValueNode.js';
|
|
138
|
-
|
|
139
|
-
// fog
|
|
140
|
-
export { default as FogNode, fog } from './fog/FogNode.js';
|
|
141
|
-
export { default as FogRangeNode, rangeFog } from './fog/FogRangeNode.js';
|
|
142
|
-
export { default as FogExp2Node, densityFog } from './fog/FogExp2Node.js';
|
|
143
|
-
|
|
144
|
-
// geometry
|
|
145
|
-
export { default as RangeNode, range } from './geometry/RangeNode.js';
|
|
146
|
-
|
|
147
|
-
// gpgpu
|
|
148
|
-
export { default as ComputeNode, compute } from './gpgpu/ComputeNode.js';
|
|
149
|
-
|
|
150
|
-
// lighting
|
|
151
|
-
export { default as LightNode, lightTargetDirection } from './lighting/LightNode.js';
|
|
152
|
-
export { default as PointLightNode } from './lighting/PointLightNode.js';
|
|
153
|
-
export { default as DirectionalLightNode } from './lighting/DirectionalLightNode.js';
|
|
154
|
-
export { default as SpotLightNode } from './lighting/SpotLightNode.js';
|
|
155
|
-
export { default as IESSpotLightNode } from './lighting/IESSpotLightNode.js';
|
|
156
|
-
export { default as AmbientLightNode } from './lighting/AmbientLightNode.js';
|
|
157
|
-
export { default as LightsNode, lights, lightsNode, addLightNode } from './lighting/LightsNode.js';
|
|
158
|
-
export { default as LightingNode /* @TODO: lighting (abstract), light */ } from './lighting/LightingNode.js';
|
|
159
|
-
export { default as LightingContextNode, lightingContext } from './lighting/LightingContextNode.js';
|
|
160
|
-
export { default as HemisphereLightNode } from './lighting/HemisphereLightNode.js';
|
|
161
|
-
export { default as EnvironmentNode } from './lighting/EnvironmentNode.js';
|
|
162
|
-
export { default as IrradianceNode } from './lighting/IrradianceNode.js';
|
|
163
|
-
export { default as AONode } from './lighting/AONode.js';
|
|
164
|
-
export { default as AnalyticLightNode } from './lighting/AnalyticLightNode.js';
|
|
165
|
-
|
|
166
|
-
// pmrem
|
|
167
|
-
export { default as PMREMNode, pmremTexture } from './pmrem/PMREMNode.js';
|
|
168
|
-
export * as PMREMUtils from './pmrem/PMREMUtils.js';
|
|
169
|
-
|
|
170
|
-
// procedural
|
|
171
|
-
export { default as CheckerNode, checker } from './procedural/CheckerNode.js';
|
|
172
|
-
|
|
173
|
-
// loaders
|
|
174
|
-
export { default as NodeLoader } from './loaders/NodeLoader.js';
|
|
175
|
-
export { default as NodeObjectLoader } from './loaders/NodeObjectLoader.js';
|
|
176
|
-
export { default as NodeMaterialLoader } from './loaders/NodeMaterialLoader.js';
|
|
177
|
-
|
|
178
|
-
// parsers
|
|
179
|
-
export { default as GLSLNodeParser } from './parsers/GLSLNodeParser.js'; // @TODO: Move to jsm/renderers/webgl.
|
|
180
|
-
|
|
181
|
-
// materials
|
|
182
|
-
export * from './materials/Materials.js';
|
|
183
|
-
|
|
184
|
-
// materialX
|
|
185
|
-
export * from './materialx/MaterialXNodes.js';
|
|
186
|
-
|
|
187
|
-
// functions
|
|
188
|
-
export { default as BRDF_GGX } from './functions/BSDF/BRDF_GGX.js';
|
|
189
|
-
export { default as BRDF_Lambert } from './functions/BSDF/BRDF_Lambert.js';
|
|
190
|
-
export { default as D_GGX } from './functions/BSDF/D_GGX.js';
|
|
191
|
-
export { default as DFGApprox } from './functions/BSDF/DFGApprox.js';
|
|
192
|
-
export { default as F_Schlick } from './functions/BSDF/F_Schlick.js';
|
|
193
|
-
export { default as Schlick_to_F0 } from './functions/BSDF/Schlick_to_F0.js';
|
|
194
|
-
export { default as V_GGX_SmithCorrelated } from './functions/BSDF/V_GGX_SmithCorrelated.js';
|
|
195
|
-
|
|
196
|
-
export { getDistanceAttenuation } from './lighting/LightUtils.js';
|
|
197
|
-
|
|
198
|
-
export { default as getGeometryRoughness } from './functions/material/getGeometryRoughness.js';
|
|
199
|
-
export { default as getRoughness } from './functions/material/getRoughness.js';
|
|
200
|
-
|
|
201
|
-
export { default as PhongLightingModel } from './functions/PhongLightingModel.js';
|
|
202
|
-
export { default as PhysicalLightingModel } from './functions/PhysicalLightingModel.js';
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import Node, { addNodeClass } from '../core/Node.js';
|
|
2
|
-
import { normalLocal } from './NormalNode.js';
|
|
3
|
-
import { positionLocal } from './PositionNode.js';
|
|
4
|
-
import { nodeProxy, vec3, mat3, mat4, int, ivec2, float } from '../shadernode/ShaderNode.js';
|
|
5
|
-
import { textureLoad } from './TextureNode.js';
|
|
6
|
-
import { textureSize } from './TextureSizeNode.js';
|
|
7
|
-
import { attribute } from '../core/AttributeNode.js';
|
|
8
|
-
import { tangentLocal } from './TangentNode.js';
|
|
9
|
-
|
|
10
|
-
class BatchNode extends Node {
|
|
11
|
-
|
|
12
|
-
constructor( batchMesh ) {
|
|
13
|
-
|
|
14
|
-
super( 'void' );
|
|
15
|
-
|
|
16
|
-
this.batchMesh = batchMesh;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
this.instanceColorNode = null;
|
|
20
|
-
|
|
21
|
-
this.batchingIdNode = null;
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
setup( builder ) {
|
|
26
|
-
|
|
27
|
-
// POSITION
|
|
28
|
-
|
|
29
|
-
if ( this.batchingIdNode === null ) {
|
|
30
|
-
|
|
31
|
-
this.batchingIdNode = attribute( 'batchId' );
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const matriceTexture = this.batchMesh._matricesTexture;
|
|
36
|
-
|
|
37
|
-
const size = textureSize( textureLoad( matriceTexture ), 0 );
|
|
38
|
-
const j = float( int( this.batchingIdNode ) ).mul( 4 ).toVar();
|
|
39
|
-
|
|
40
|
-
const x = int( j.mod( size ) );
|
|
41
|
-
const y = int( j ).div( int( size ) );
|
|
42
|
-
const batchingMatrix = mat4(
|
|
43
|
-
textureLoad( matriceTexture, ivec2( x, y ) ),
|
|
44
|
-
textureLoad( matriceTexture, ivec2( x.add( 1 ), y ) ),
|
|
45
|
-
textureLoad( matriceTexture, ivec2( x.add( 2 ), y ) ),
|
|
46
|
-
textureLoad( matriceTexture, ivec2( x.add( 3 ), y ) )
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const bm = mat3(
|
|
51
|
-
batchingMatrix[ 0 ].xyz,
|
|
52
|
-
batchingMatrix[ 1 ].xyz,
|
|
53
|
-
batchingMatrix[ 2 ].xyz
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
positionLocal.assign( batchingMatrix.mul( positionLocal ) );
|
|
57
|
-
|
|
58
|
-
const transformedNormal = normalLocal.div( vec3( bm[ 0 ].dot( bm[ 0 ] ), bm[ 1 ].dot( bm[ 1 ] ), bm[ 2 ].dot( bm[ 2 ] ) ) );
|
|
59
|
-
|
|
60
|
-
const batchingNormal = bm.mul( transformedNormal ).xyz;
|
|
61
|
-
|
|
62
|
-
normalLocal.assign( batchingNormal );
|
|
63
|
-
|
|
64
|
-
if ( builder.hasGeometryAttribute( 'tangent' ) ) {
|
|
65
|
-
|
|
66
|
-
tangentLocal.mulAssign( bm );
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export default BatchNode;
|
|
75
|
-
|
|
76
|
-
export const batch = nodeProxy( BatchNode );
|
|
77
|
-
|
|
78
|
-
addNodeClass( 'batch', BatchNode );
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { uniform } from '../core/UniformNode.js';
|
|
2
|
-
import { Vector3 } from 'three';
|
|
3
|
-
|
|
4
|
-
export const cameraNear = /*#__PURE__*/ uniform( 'float' ).onRenderUpdate( ( { camera } ) => camera.near );
|
|
5
|
-
export const cameraFar = /*#__PURE__*/ uniform( 'float' ).onRenderUpdate( ( { camera } ) => camera.far );
|
|
6
|
-
export const cameraLogDepth = /*#__PURE__*/ uniform( 'float' ).onRenderUpdate( ( { camera } ) => 2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) );
|
|
7
|
-
export const cameraProjectionMatrix = /*#__PURE__*/ uniform( 'mat4' ).onRenderUpdate( ( { camera } ) => camera.projectionMatrix );
|
|
8
|
-
export const cameraProjectionMatrixInverse = /*#__PURE__*/ uniform( 'mat4' ).onRenderUpdate( ( { camera } ) => camera.projectionMatrixInverse );
|
|
9
|
-
export const cameraViewMatrix = /*#__PURE__*/ uniform( 'mat4' ).onRenderUpdate( ( { camera } ) => camera.matrixWorldInverse );
|
|
10
|
-
export const cameraWorldMatrix = /*#__PURE__*/ uniform( 'mat4' ).onRenderUpdate( ( { camera } ) => camera.matrixWorld );
|
|
11
|
-
export const cameraNormalMatrix = /*#__PURE__*/ uniform( 'mat3' ).onRenderUpdate( ( { camera } ) => camera.normalMatrix );
|
|
12
|
-
export const cameraPosition = /*#__PURE__*/ uniform( new Vector3() ).onRenderUpdate( ( { camera }, self ) => self.value.setFromMatrixPosition( camera.matrixWorld ) );
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import TextureNode from './TextureNode.js';
|
|
2
|
-
import { reflectVector } from './ReflectVectorNode.js';
|
|
3
|
-
import { addNodeClass } from '../core/Node.js';
|
|
4
|
-
import { addNodeElement, nodeProxy, vec3 } from '../shadernode/ShaderNode.js';
|
|
5
|
-
import { WebGPUCoordinateSystem } from 'three';
|
|
6
|
-
|
|
7
|
-
class CubeTextureNode extends TextureNode {
|
|
8
|
-
|
|
9
|
-
constructor( value, uvNode = null, levelNode = null ) {
|
|
10
|
-
|
|
11
|
-
super( value, uvNode, levelNode );
|
|
12
|
-
|
|
13
|
-
this.isCubeTextureNode = true;
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
getInputType( /*builder*/ ) {
|
|
18
|
-
|
|
19
|
-
return 'cubeTexture';
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
getDefaultUV() {
|
|
24
|
-
|
|
25
|
-
return reflectVector;
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
setUpdateMatrix( /*updateMatrix*/ ) { } // Ignore .updateMatrix for CubeTextureNode
|
|
30
|
-
|
|
31
|
-
setupUV( builder, uvNode ) {
|
|
32
|
-
|
|
33
|
-
const texture = this.value;
|
|
34
|
-
|
|
35
|
-
if ( builder.renderer.coordinateSystem === WebGPUCoordinateSystem || ! texture.isRenderTargetTexture ) {
|
|
36
|
-
|
|
37
|
-
return vec3( uvNode.x.negate(), uvNode.yz );
|
|
38
|
-
|
|
39
|
-
} else {
|
|
40
|
-
|
|
41
|
-
return uvNode;
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
generateUV( builder, cubeUV ) {
|
|
48
|
-
|
|
49
|
-
return cubeUV.build( builder, 'vec3' );
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export default CubeTextureNode;
|
|
56
|
-
|
|
57
|
-
export const cubeTexture = nodeProxy( CubeTextureNode );
|
|
58
|
-
|
|
59
|
-
addNodeElement( 'cubeTexture', cubeTexture );
|
|
60
|
-
|
|
61
|
-
addNodeClass( 'CubeTextureNode', CubeTextureNode );
|
|
@@ -1,94 +0,0 @@
|
|
|
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 { DynamicDrawUsage, InstancedInterleavedBuffer, InstancedBufferAttribute } from 'three';
|
|
8
|
-
|
|
9
|
-
class InstanceNode extends Node {
|
|
10
|
-
|
|
11
|
-
constructor( instanceMesh ) {
|
|
12
|
-
|
|
13
|
-
super( 'void' );
|
|
14
|
-
|
|
15
|
-
this.instanceMesh = instanceMesh;
|
|
16
|
-
|
|
17
|
-
this.instanceMatrixNode = null;
|
|
18
|
-
|
|
19
|
-
this.instanceColorNode = null;
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
setup( /*builder*/ ) {
|
|
24
|
-
|
|
25
|
-
let instanceMatrixNode = this.instanceMatrixNode;
|
|
26
|
-
|
|
27
|
-
const instanceMesh = this.instanceMesh;
|
|
28
|
-
|
|
29
|
-
if ( instanceMatrixNode === null ) {
|
|
30
|
-
|
|
31
|
-
const instanceAttribute = instanceMesh.instanceMatrix;
|
|
32
|
-
const buffer = new InstancedInterleavedBuffer( instanceAttribute.array, 16, 1 );
|
|
33
|
-
|
|
34
|
-
const bufferFn = instanceAttribute.usage === DynamicDrawUsage ? instancedDynamicBufferAttribute : instancedBufferAttribute;
|
|
35
|
-
|
|
36
|
-
const instanceBuffers = [
|
|
37
|
-
// F.Signature -> bufferAttribute( array, type, stride, offset )
|
|
38
|
-
bufferFn( buffer, 'vec4', 16, 0 ),
|
|
39
|
-
bufferFn( buffer, 'vec4', 16, 4 ),
|
|
40
|
-
bufferFn( buffer, 'vec4', 16, 8 ),
|
|
41
|
-
bufferFn( buffer, 'vec4', 16, 12 )
|
|
42
|
-
];
|
|
43
|
-
|
|
44
|
-
instanceMatrixNode = mat4( ...instanceBuffers );
|
|
45
|
-
|
|
46
|
-
this.instanceMatrixNode = instanceMatrixNode;
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const instanceColorAttribute = instanceMesh.instanceColor;
|
|
51
|
-
|
|
52
|
-
if ( instanceColorAttribute && this.instanceColorNode === null ) {
|
|
53
|
-
|
|
54
|
-
const buffer = new InstancedBufferAttribute( instanceColorAttribute.array, 3 );
|
|
55
|
-
const bufferFn = instanceColorAttribute.usage === DynamicDrawUsage ? instancedDynamicBufferAttribute : instancedBufferAttribute;
|
|
56
|
-
|
|
57
|
-
this.instanceColorNode = vec3( bufferFn( buffer, 'vec3', 3, 0 ) );
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// POSITION
|
|
62
|
-
|
|
63
|
-
const instancePosition = instanceMatrixNode.mul( positionLocal ).xyz;
|
|
64
|
-
|
|
65
|
-
// NORMAL
|
|
66
|
-
|
|
67
|
-
const m = mat3( instanceMatrixNode[ 0 ].xyz, instanceMatrixNode[ 1 ].xyz, instanceMatrixNode[ 2 ].xyz );
|
|
68
|
-
|
|
69
|
-
const transformedNormal = normalLocal.div( vec3( m[ 0 ].dot( m[ 0 ] ), m[ 1 ].dot( m[ 1 ] ), m[ 2 ].dot( m[ 2 ] ) ) );
|
|
70
|
-
|
|
71
|
-
const instanceNormal = m.mul( transformedNormal ).xyz;
|
|
72
|
-
|
|
73
|
-
// ASSIGNS
|
|
74
|
-
|
|
75
|
-
positionLocal.assign( instancePosition );
|
|
76
|
-
normalLocal.assign( instanceNormal );
|
|
77
|
-
|
|
78
|
-
// COLOR
|
|
79
|
-
|
|
80
|
-
if ( this.instanceColorNode !== null ) {
|
|
81
|
-
|
|
82
|
-
varyingProperty( 'vec3', 'vInstanceColor' ).assign( this.instanceColorNode );
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export default InstanceNode;
|
|
91
|
-
|
|
92
|
-
export const instance = nodeProxy( InstanceNode );
|
|
93
|
-
|
|
94
|
-
addNodeClass( 'InstanceNode', InstanceNode );
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import MaterialNode from './MaterialNode.js';
|
|
2
|
-
import { addNodeClass } from '../core/Node.js';
|
|
3
|
-
import { nodeImmutable } from '../shadernode/ShaderNode.js';
|
|
4
|
-
|
|
5
|
-
class InstancedPointsMaterialNode extends MaterialNode {
|
|
6
|
-
|
|
7
|
-
setup( /*builder*/ ) {
|
|
8
|
-
|
|
9
|
-
return this.getFloat( this.scope );
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
InstancedPointsMaterialNode.POINT_WIDTH = 'pointWidth';
|
|
16
|
-
|
|
17
|
-
export default InstancedPointsMaterialNode;
|
|
18
|
-
|
|
19
|
-
export const materialPointWidth = nodeImmutable( InstancedPointsMaterialNode, InstancedPointsMaterialNode.POINT_WIDTH );
|
|
20
|
-
|
|
21
|
-
addNodeClass( 'InstancedPointsMaterialNode', InstancedPointsMaterialNode );
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import Object3DNode from './Object3DNode.js';
|
|
2
|
-
import { addNodeClass } from '../core/Node.js';
|
|
3
|
-
import { nodeImmutable } from '../shadernode/ShaderNode.js';
|
|
4
|
-
import { uniform } from '../core/UniformNode.js';
|
|
5
|
-
import { Matrix4 } from 'three';
|
|
6
|
-
|
|
7
|
-
class ModelNode extends Object3DNode {
|
|
8
|
-
|
|
9
|
-
constructor( scope = ModelNode.VIEW_MATRIX ) {
|
|
10
|
-
|
|
11
|
-
super( scope );
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
update( frame ) {
|
|
16
|
-
|
|
17
|
-
this.object3d = frame.object;
|
|
18
|
-
|
|
19
|
-
super.update( frame );
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default ModelNode;
|
|
26
|
-
|
|
27
|
-
export const modelDirection = nodeImmutable( ModelNode, ModelNode.DIRECTION );
|
|
28
|
-
export const modelViewMatrix = nodeImmutable( ModelNode, ModelNode.VIEW_MATRIX ).label( 'modelViewMatrix' ).temp( 'ModelViewMatrix' );
|
|
29
|
-
export const modelNormalMatrix = nodeImmutable( ModelNode, ModelNode.NORMAL_MATRIX );
|
|
30
|
-
export const modelWorldMatrix = nodeImmutable( ModelNode, ModelNode.WORLD_MATRIX );
|
|
31
|
-
export const modelPosition = nodeImmutable( ModelNode, ModelNode.POSITION );
|
|
32
|
-
export const modelScale = nodeImmutable( ModelNode, ModelNode.SCALE );
|
|
33
|
-
export const modelViewPosition = nodeImmutable( ModelNode, ModelNode.VIEW_POSITION );
|
|
34
|
-
export const modelWorldMatrixInverse = uniform( new Matrix4() ).onObjectUpdate( ( { object }, self ) => self.value.copy( object.matrixWorld ).invert() );
|
|
35
|
-
|
|
36
|
-
addNodeClass( 'ModelNode', ModelNode );
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { attribute } from '../core/AttributeNode.js';
|
|
2
|
-
import { varying } from '../core/VaryingNode.js';
|
|
3
|
-
import { property } from '../core/PropertyNode.js';
|
|
4
|
-
import { cameraViewMatrix } from './CameraNode.js';
|
|
5
|
-
import { modelNormalMatrix } from './ModelNode.js';
|
|
6
|
-
import { vec3 } from '../shadernode/ShaderNode.js';
|
|
7
|
-
|
|
8
|
-
export const normalGeometry = /*#__PURE__*/ attribute( 'normal', 'vec3', vec3( 0, 1, 0 ) );
|
|
9
|
-
export const normalLocal = /*#__PURE__*/ normalGeometry.toVar( 'normalLocal' );
|
|
10
|
-
export const normalView = /*#__PURE__*/ varying( modelNormalMatrix.mul( normalLocal ), 'v_normalView' ).normalize().toVar( 'normalView' );
|
|
11
|
-
export const normalWorld = /*#__PURE__*/ varying( normalView.transformDirection( cameraViewMatrix ), 'v_normalWorld' ).normalize().toVar( 'transformedNormalWorld' );
|
|
12
|
-
export const transformedNormalView = /*#__PURE__*/ property( 'vec3', 'transformedNormalView' );
|
|
13
|
-
export const transformedNormalWorld = /*#__PURE__*/ transformedNormalView.transformDirection( cameraViewMatrix ).normalize().toVar( 'transformedNormalWorld' );
|
|
14
|
-
export const transformedClearcoatNormalView = /*#__PURE__*/ property( 'vec3', 'transformedClearcoatNormalView' );
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import Node, { addNodeClass } from '../core/Node.js';
|
|
2
|
-
import { nodeImmutable } from '../shadernode/ShaderNode.js';
|
|
3
|
-
|
|
4
|
-
class PointUVNode extends Node {
|
|
5
|
-
|
|
6
|
-
constructor() {
|
|
7
|
-
|
|
8
|
-
super( 'vec2' );
|
|
9
|
-
|
|
10
|
-
this.isPointUVNode = true;
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
generate( /*builder*/ ) {
|
|
15
|
-
|
|
16
|
-
return 'vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y )';
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default PointUVNode;
|
|
23
|
-
|
|
24
|
-
export const pointUV = nodeImmutable( PointUVNode );
|
|
25
|
-
|
|
26
|
-
addNodeClass( 'PointUVNode', PointUVNode );
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { attribute } from '../core/AttributeNode.js';
|
|
2
|
-
import { varying } from '../core/VaryingNode.js';
|
|
3
|
-
import { modelWorldMatrix, modelViewMatrix } from './ModelNode.js';
|
|
4
|
-
|
|
5
|
-
export const positionGeometry = /*#__PURE__*/ attribute( 'position', 'vec3' );
|
|
6
|
-
export const positionLocal = /*#__PURE__*/ positionGeometry.toVar( 'positionLocal' );
|
|
7
|
-
export const positionWorld = /*#__PURE__*/ varying( modelWorldMatrix.mul( positionLocal ).xyz, 'v_positionWorld' );
|
|
8
|
-
export const positionWorldDirection = /*#__PURE__*/ varying( positionLocal.transformDirection( modelWorldMatrix ), 'v_positionWorldDirection' ).normalize().toVar( 'positionWorldDirection' );
|
|
9
|
-
export const positionView = /*#__PURE__*/ varying( modelViewMatrix.mul( positionLocal ).xyz, 'v_positionView' );
|
|
10
|
-
export const positionViewDirection = /*#__PURE__*/ varying( positionView.negate(), 'v_positionViewDirection' ).normalize().toVar( 'positionViewDirection' );
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { cameraViewMatrix } from './CameraNode.js';
|
|
2
|
-
import { transformedNormalView } from './NormalNode.js';
|
|
3
|
-
import { positionViewDirection } from './PositionNode.js';
|
|
4
|
-
|
|
5
|
-
export const reflectView = /*#__PURE__*/ positionViewDirection.negate().reflect( transformedNormalView );
|
|
6
|
-
export const reflectVector = /*#__PURE__*/ reflectView.transformDirection( cameraViewMatrix ).toVar( 'reflectVector' );
|