@needle-tools/three 0.162.12 → 0.169.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/build/three.cjs +29789 -1941
- package/build/three.module.js +29095 -1933
- package/build/three.module.min.js +2 -2
- package/build/three.webgpu.js +80003 -0
- package/build/three.webgpu.min.js +6 -0
- package/build/three.webgpu.nodes.js +79951 -0
- package/build/three.webgpu.nodes.min.js +6 -0
- package/examples/jsm/Addons.js +2 -5
- package/examples/jsm/animation/AnimationClipCreator.js +1 -1
- package/examples/jsm/animation/CCDIKSolver.js +4 -2
- 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 +790 -797
- package/examples/jsm/controls/PointerLockControls.js +24 -15
- package/examples/jsm/controls/TrackballControls.js +469 -448
- package/examples/jsm/controls/TransformControls.js +98 -63
- 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 +2 -6
- package/examples/jsm/exporters/DRACOExporter.js +4 -2
- package/examples/jsm/exporters/EXRExporter.js +19 -11
- package/examples/jsm/exporters/GLTFExporter.js +77 -8
- package/examples/jsm/exporters/KTX2Exporter.js +21 -13
- package/examples/jsm/exporters/OBJExporter.js +5 -1
- package/examples/jsm/exporters/PLYExporter.js +9 -7
- package/examples/jsm/exporters/USDZExporter.js +55 -11
- package/examples/jsm/geometries/DecalGeometry.js +4 -1
- package/examples/jsm/geometries/InstancedPointsGeometry.js +1 -1
- package/examples/jsm/geometries/TeapotGeometry.js +1 -1
- package/examples/jsm/geometries/TextGeometry.js +10 -2
- package/examples/jsm/helpers/LightProbeHelper.js +43 -44
- package/examples/jsm/helpers/LightProbeHelperGPU.js +65 -0
- package/examples/jsm/helpers/ViewHelper.js +75 -61
- package/examples/jsm/interactive/HTMLMesh.js +7 -9
- package/examples/jsm/libs/basis/basis_transcoder.js +8 -10
- package/examples/jsm/libs/basis/basis_transcoder.wasm +0 -0
- package/examples/jsm/libs/draco/README.md +2 -2
- package/examples/jsm/libs/fflate.module.js +694 -496
- package/examples/jsm/libs/ktx-parse.module.js +1 -1
- package/examples/jsm/lights/LightProbeGenerator.js +24 -10
- package/examples/jsm/lights/RectAreaLightTexturesLib.js +91 -0
- package/examples/jsm/lights/RectAreaLightUniformsLib.js +8 -63
- package/examples/jsm/lines/LineMaterial.js +1 -17
- package/examples/jsm/lines/LineSegments2.js +15 -0
- package/examples/jsm/lines/Wireframe.js +16 -1
- package/examples/jsm/lines/webgpu/Line2.js +20 -0
- package/examples/jsm/lines/webgpu/LineSegments2.js +376 -0
- package/examples/jsm/loaders/3MFLoader.js +2 -0
- package/examples/jsm/loaders/ColladaLoader.js +9 -6
- package/examples/jsm/loaders/DRACOLoader.js +4 -2
- package/examples/jsm/loaders/EXRLoader.js +351 -97
- package/examples/jsm/loaders/FBXLoader.js +77 -78
- package/examples/jsm/loaders/GLTFLoader.js +76 -14
- package/examples/jsm/loaders/KTX2Loader.js +30 -22
- package/examples/jsm/loaders/LDrawLoader.js +3 -2
- package/examples/jsm/loaders/LUT3dlLoader.js +0 -15
- package/examples/jsm/loaders/LUTCubeLoader.js +0 -14
- package/examples/jsm/loaders/LUTImageLoader.js +0 -14
- package/examples/jsm/loaders/MMDLoader.js +31 -12
- package/examples/jsm/loaders/MTLLoader.js +4 -3
- package/examples/jsm/loaders/MaterialXLoader.js +45 -21
- package/examples/jsm/loaders/OBJLoader.js +5 -3
- package/examples/jsm/loaders/PCDLoader.js +14 -13
- package/examples/jsm/loaders/PDBLoader.js +3 -2
- package/examples/jsm/loaders/PLYLoader.js +8 -5
- package/examples/jsm/loaders/RGBMLoader.js +16 -0
- package/examples/jsm/loaders/STLLoader.js +3 -2
- package/examples/jsm/loaders/USDZLoader.js +124 -76
- package/examples/jsm/loaders/UltraHDRLoader.js +583 -0
- package/examples/jsm/loaders/VRMLLoader.js +11 -11
- package/examples/jsm/loaders/VTKLoader.js +80 -6
- package/examples/jsm/loaders/XYZLoader.js +3 -2
- package/examples/jsm/loaders/lwo/IFFParser.js +8 -5
- package/examples/jsm/materials/MeshGouraudMaterial.js +7 -1
- package/examples/jsm/math/Octree.js +26 -20
- package/examples/jsm/misc/GPUComputationRenderer.js +9 -25
- package/examples/jsm/misc/Timer.js +1 -1
- package/examples/jsm/modifiers/CurveModifier.js +11 -9
- package/examples/jsm/modifiers/CurveModifierGPU.js +233 -0
- package/examples/jsm/modifiers/SimplifyModifier.js +2 -1
- package/examples/jsm/objects/InstancedPoints.js +2 -2
- package/examples/jsm/objects/Lensflare.js +2 -2
- package/examples/jsm/objects/LensflareMesh.js +322 -0
- package/examples/jsm/objects/SkyMesh.js +187 -0
- package/examples/jsm/objects/Water2Mesh.js +158 -0
- package/examples/jsm/objects/WaterMesh.js +101 -0
- package/examples/jsm/physics/JoltPhysics.js +281 -0
- package/examples/jsm/physics/RapierPhysics.js +25 -5
- package/examples/jsm/postprocessing/GlitchPass.js +0 -3
- package/examples/jsm/postprocessing/LUTPass.js +5 -71
- package/examples/jsm/postprocessing/OutlinePass.js +31 -46
- package/examples/jsm/postprocessing/RenderPass.js +1 -1
- package/examples/jsm/postprocessing/RenderTransitionPass.js +168 -0
- package/examples/jsm/postprocessing/SAOPass.js +0 -1
- package/examples/jsm/postprocessing/SSAARenderPass.js +3 -1
- package/examples/jsm/postprocessing/SSAOPass.js +6 -12
- package/examples/jsm/postprocessing/UnrealBloomPass.js +4 -4
- package/examples/jsm/renderers/CSS2DRenderer.js +25 -5
- package/examples/jsm/renderers/CSS3DRenderer.js +24 -3
- package/examples/jsm/renderers/webgl-legacy/nodes/GLSL1NodeBuilder.js +1 -3
- package/examples/jsm/renderers/webgl-legacy/nodes/SlotNode.js +1 -1
- package/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodeBuilder.js +7 -4
- package/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.js +19 -5
- 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 +47 -5
- package/examples/jsm/transpiler/ShaderToyDecoder.js +2 -2
- package/examples/jsm/transpiler/TSLEncoder.js +24 -22
- package/examples/jsm/utils/BufferGeometryUtils.js +18 -16
- package/examples/jsm/utils/GeometryCompressionUtils.js +37 -122
- package/examples/jsm/utils/SceneUtils.js +60 -1
- package/examples/jsm/utils/ShadowMapViewer.js +3 -8
- package/examples/jsm/utils/ShadowMapViewerGPU.js +201 -0
- package/examples/jsm/utils/SkeletonUtils.js +84 -66
- package/examples/jsm/utils/SortUtils.js +8 -5
- package/examples/jsm/utils/TextureUtils.js +3 -2
- package/examples/jsm/utils/TextureUtilsGPU.js +63 -0
- package/examples/jsm/webxr/OculusHandModel.js +3 -2
- package/examples/jsm/webxr/XRControllerModelFactory.js +1 -1
- package/examples/jsm/webxr/XRHandModelFactory.js +4 -2
- package/package.json +11 -8
- package/src/Three.WebGPU.Nodes.js +200 -0
- package/src/Three.WebGPU.js +201 -0
- package/src/Three.js +23 -1
- package/src/animation/AnimationClip.js +1 -1
- package/src/animation/tracks/BooleanKeyframeTrack.js +10 -1
- package/src/animation/tracks/QuaternionKeyframeTrack.js +1 -2
- package/src/animation/tracks/StringKeyframeTrack.js +10 -1
- package/src/audio/Audio.js +2 -2
- package/src/constants.js +6 -7
- package/src/core/BufferAttribute.js +0 -9
- package/src/core/Clock.js +1 -1
- package/src/core/InterleavedBuffer.js +0 -9
- package/src/core/Object3D.js +34 -29
- package/src/core/Raycaster.js +6 -2
- package/src/core/RenderTarget.js +8 -0
- package/src/extras/Controls.js +32 -0
- package/src/extras/PMREMGenerator.js +12 -11
- package/src/extras/TextureUtils.js +210 -0
- package/src/geometries/CylinderGeometry.js +11 -4
- package/src/lights/Light.js +1 -0
- package/src/lights/LightShadow.js +5 -0
- package/{examples/jsm/lights → src/lights/webgpu}/IESSpotLight.js +1 -1
- package/src/loaders/FileLoader.js +5 -1
- package/src/loaders/LoaderUtils.js +3 -1
- package/src/loaders/MaterialLoader.js +8 -1
- package/src/loaders/ObjectLoader.js +36 -2
- package/{examples/jsm/nodes/loaders → src/loaders/nodes}/NodeLoader.js +27 -5
- package/{examples/jsm/nodes/loaders → src/loaders/nodes}/NodeMaterialLoader.js +22 -18
- package/{examples/jsm/nodes/loaders → src/loaders/nodes}/NodeObjectLoader.js +21 -1
- package/src/materials/Material.js +4 -0
- package/src/materials/MeshPhysicalMaterial.js +20 -0
- package/src/materials/ShaderMaterial.js +0 -4
- package/src/materials/nodes/InstancedPointsNodeMaterial.js +156 -0
- package/{examples/jsm/nodes/materials → src/materials/nodes}/Line2NodeMaterial.js +69 -68
- package/src/materials/nodes/LineBasicNodeMaterial.js +31 -0
- package/{examples/jsm/nodes/materials → src/materials/nodes}/LineDashedNodeMaterial.js +15 -12
- package/src/materials/nodes/MeshBasicNodeMaterial.js +77 -0
- package/src/materials/nodes/MeshLambertNodeMaterial.js +47 -0
- package/src/materials/nodes/MeshMatcapNodeMaterial.js +57 -0
- package/src/materials/nodes/MeshNormalNodeMaterial.js +44 -0
- package/src/materials/nodes/MeshPhongNodeMaterial.js +78 -0
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +248 -0
- package/{examples/jsm/nodes/materials → src/materials/nodes}/MeshSSSNodeMaterial.js +10 -7
- package/src/materials/nodes/MeshStandardNodeMaterial.js +108 -0
- package/src/materials/nodes/MeshToonNodeMaterial.js +38 -0
- package/{examples/jsm/nodes/materials → src/materials/nodes}/NodeMaterial.js +198 -157
- package/{examples/jsm/nodes/materials/Materials.js → src/materials/nodes/NodeMaterials.js} +7 -1
- package/{examples/jsm/nodes/materials → src/materials/nodes}/PointsNodeMaterial.js +10 -7
- package/src/materials/nodes/ShadowNodeMaterial.js +38 -0
- package/src/materials/nodes/SpriteNodeMaterial.js +123 -0
- package/src/materials/nodes/VolumeNodeMaterial.js +108 -0
- package/src/materials/nodes/manager/NodeMaterialObserver.js +302 -0
- 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/Spherical.js +4 -5
- package/src/math/Triangle.js +24 -0
- package/src/math/Vector4.js +13 -0
- package/src/nodes/Nodes.js +164 -0
- package/src/nodes/TSL.js +179 -0
- package/src/nodes/accessors/AccessorsUtils.js +25 -0
- package/src/nodes/accessors/BatchNode.js +128 -0
- package/src/nodes/accessors/Bitangent.js +13 -0
- package/{examples/jsm → src}/nodes/accessors/BufferAttributeNode.js +44 -6
- package/{examples/jsm → src}/nodes/accessors/BufferNode.js +13 -4
- package/src/nodes/accessors/Camera.js +13 -0
- package/{examples/jsm → src}/nodes/accessors/ClippingNode.js +22 -15
- package/src/nodes/accessors/CubeTextureNode.js +79 -0
- package/src/nodes/accessors/InstanceNode.js +144 -0
- package/src/nodes/accessors/InstancedPointsMaterialNode.js +24 -0
- package/src/nodes/accessors/Lights.js +51 -0
- package/src/nodes/accessors/MaterialNode.js +441 -0
- package/src/nodes/accessors/MaterialProperties.js +3 -0
- package/{examples/jsm → src}/nodes/accessors/MaterialReferenceNode.js +10 -5
- package/src/nodes/accessors/ModelNode.js +72 -0
- package/src/nodes/accessors/ModelViewProjectionNode.js +42 -0
- package/{examples/jsm → src}/nodes/accessors/MorphNode.js +51 -33
- package/src/nodes/accessors/Normal.js +88 -0
- package/{examples/jsm → src}/nodes/accessors/Object3DNode.js +18 -34
- package/src/nodes/accessors/PointUVNode.js +30 -0
- package/src/nodes/accessors/Position.js +10 -0
- package/src/nodes/accessors/ReferenceBaseNode.js +171 -0
- package/{examples/jsm → src}/nodes/accessors/ReferenceNode.js +58 -9
- package/src/nodes/accessors/ReflectVector.js +10 -0
- package/src/nodes/accessors/RendererReferenceNode.js +35 -0
- package/{examples/jsm → src}/nodes/accessors/SceneNode.js +9 -6
- package/src/nodes/accessors/SkinningNode.js +191 -0
- package/src/nodes/accessors/StorageBufferNode.js +147 -0
- package/{examples/jsm/nodes/accessors/TextureStoreNode.js → src/nodes/accessors/StorageTextureNode.js} +35 -10
- package/src/nodes/accessors/Tangent.js +22 -0
- package/src/nodes/accessors/Texture3DNode.js +103 -0
- package/{examples/jsm/nodes/accessors/TextureBicubicNode.js → src/nodes/accessors/TextureBicubic.js} +3 -32
- package/{examples/jsm → src}/nodes/accessors/TextureNode.js +123 -39
- package/src/nodes/accessors/TextureSizeNode.js +36 -0
- package/src/nodes/accessors/UV.js +3 -0
- package/{examples/jsm/nodes/accessors/UniformsNode.js → src/nodes/accessors/UniformArrayNode.js} +33 -15
- package/{examples/jsm → src}/nodes/accessors/UserDataNode.js +10 -7
- package/src/nodes/accessors/VelocityNode.js +134 -0
- package/{examples/jsm → src}/nodes/accessors/VertexColorNode.js +9 -5
- package/{examples/jsm → src}/nodes/code/CodeNode.js +9 -5
- package/{examples/jsm → src}/nodes/code/ExpressionNode.js +10 -6
- package/{examples/jsm → src}/nodes/code/FunctionCallNode.js +8 -5
- package/{examples/jsm → src}/nodes/code/FunctionNode.js +8 -31
- package/{examples/jsm → src}/nodes/code/ScriptableNode.js +24 -7
- package/{examples/jsm → src}/nodes/code/ScriptableValueNode.js +11 -8
- package/{examples/jsm → src}/nodes/core/AssignNode.js +12 -9
- package/{examples/jsm → src}/nodes/core/AttributeNode.js +29 -12
- package/{examples/jsm → src}/nodes/core/BypassNode.js +11 -7
- package/src/nodes/core/CacheNode.js +50 -0
- package/{examples/jsm → src}/nodes/core/ConstNode.js +6 -3
- package/{examples/jsm → src}/nodes/core/ContextNode.js +27 -11
- package/src/nodes/core/IndexNode.js +99 -0
- package/{examples/jsm → src}/nodes/core/InputNode.js +7 -3
- package/{examples/jsm → src}/nodes/core/LightingModel.js +2 -2
- package/src/nodes/core/MRTNode.js +85 -0
- package/{examples/jsm → src}/nodes/core/Node.js +114 -57
- package/{examples/jsm → src}/nodes/core/NodeBuilder.js +327 -90
- package/src/nodes/core/NodeCache.js +36 -0
- package/{examples/jsm → src}/nodes/core/NodeFrame.js +52 -10
- 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 +56 -8
- package/{examples/jsm → src}/nodes/core/OutputStructNode.js +13 -12
- package/{examples/jsm → src}/nodes/core/ParameterNode.js +7 -4
- package/src/nodes/core/PropertyNode.js +88 -0
- package/{examples/jsm → src}/nodes/core/StackNode.js +31 -11
- package/{examples/jsm → src}/nodes/core/StructTypeNode.js +7 -3
- package/{examples/jsm → src}/nodes/core/TempNode.js +10 -6
- package/src/nodes/core/UniformGroupNode.js +59 -0
- package/{examples/jsm → src}/nodes/core/UniformNode.js +37 -5
- package/{examples/jsm → src}/nodes/core/VarNode.js +14 -14
- package/src/nodes/core/VaryingNode.js +108 -0
- package/{examples/jsm → src}/nodes/display/AfterImageNode.js +38 -28
- package/src/nodes/display/AnaglyphPassNode.js +67 -0
- package/{examples/jsm → src}/nodes/display/AnamorphicNode.js +33 -30
- package/src/nodes/display/BleachBypass.js +26 -0
- package/src/nodes/display/BlendMode.js +54 -0
- package/src/nodes/display/BloomNode.js +341 -0
- package/{examples/jsm → src}/nodes/display/BumpMapNode.js +20 -38
- package/src/nodes/display/ColorAdjustment.js +46 -0
- package/src/nodes/display/ColorSpaceFunctions.js +38 -0
- package/src/nodes/display/ColorSpaceNode.js +114 -0
- package/src/nodes/display/DenoiseNode.js +204 -0
- package/src/nodes/display/DepthOfFieldNode.js +124 -0
- package/src/nodes/display/DotScreenNode.js +66 -0
- package/src/nodes/display/FXAANode.js +332 -0
- package/src/nodes/display/FilmNode.js +56 -0
- package/src/nodes/display/FrontFacingNode.js +45 -0
- package/src/nodes/display/GTAONode.js +331 -0
- package/{examples/jsm → src}/nodes/display/GaussianBlurNode.js +47 -24
- package/src/nodes/display/Lut3DNode.js +57 -0
- package/src/nodes/display/MotionBlur.js +25 -0
- package/{examples/jsm → src}/nodes/display/NormalMapNode.js +14 -14
- package/src/nodes/display/ParallaxBarrierPassNode.js +58 -0
- package/src/nodes/display/PassNode.js +378 -0
- package/src/nodes/display/PixelationPassNode.js +213 -0
- package/{examples/jsm → src}/nodes/display/PosterizeNode.js +8 -7
- package/src/nodes/display/RGBShiftNode.js +53 -0
- package/src/nodes/display/RenderOutputNode.js +60 -0
- package/src/nodes/display/SSAAPassNode.js +287 -0
- package/src/nodes/display/ScreenNode.js +181 -0
- package/src/nodes/display/Sepia.js +17 -0
- package/src/nodes/display/SobelOperatorNode.js +126 -0
- package/src/nodes/display/StereoCompositePassNode.js +110 -0
- package/src/nodes/display/StereoPassNode.js +83 -0
- package/src/nodes/display/ToneMappingFunctions.js +190 -0
- package/src/nodes/display/ToneMappingNode.js +67 -0
- package/src/nodes/display/ToonOutlinePassNode.js +111 -0
- package/src/nodes/display/TransitionNode.js +80 -0
- package/src/nodes/display/ViewportDepthNode.js +125 -0
- package/src/nodes/display/ViewportDepthTextureNode.js +33 -0
- package/src/nodes/display/ViewportSharedTextureNode.js +39 -0
- package/{examples/jsm → src}/nodes/display/ViewportTextureNode.js +20 -14
- package/src/nodes/fog/FogExp2Node.js +35 -0
- package/src/nodes/fog/FogNode.js +50 -0
- package/src/nodes/fog/FogRangeNode.js +36 -0
- package/src/nodes/functions/BSDF/BRDF_GGX.js +59 -0
- 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/src/nodes/functions/BSDF/D_GGX_Anisotropic.js +28 -0
- 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 -4
- package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +29 -0
- package/src/nodes/functions/BasicLightingModel.js +78 -0
- package/{examples/jsm → src}/nodes/functions/PhongLightingModel.js +11 -9
- package/src/nodes/functions/PhysicalLightingModel.js +633 -0
- package/src/nodes/functions/ShadowMaskModel.js +31 -0
- package/src/nodes/functions/ToonLightingModel.js +51 -0
- package/src/nodes/functions/material/getGeometryRoughness.js +13 -0
- package/{examples/jsm → src}/nodes/functions/material/getRoughness.js +2 -2
- package/src/nodes/functions/material/getShIrradianceAt.js +28 -0
- package/{examples/jsm → src}/nodes/geometry/RangeNode.js +28 -11
- package/src/nodes/gpgpu/AtomicFunctionNode.js +99 -0
- package/src/nodes/gpgpu/BarrierNode.js +40 -0
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +98 -0
- package/{examples/jsm → src}/nodes/gpgpu/ComputeNode.js +10 -6
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +100 -0
- package/src/nodes/lighting/AONode.js +27 -0
- package/{examples/jsm → src}/nodes/lighting/AmbientLightNode.js +6 -8
- package/src/nodes/lighting/AnalyticLightNode.js +522 -0
- package/src/nodes/lighting/BasicEnvironmentNode.js +30 -0
- package/src/nodes/lighting/BasicLightMapNode.js +32 -0
- package/{examples/jsm → src}/nodes/lighting/DirectionalLightNode.js +7 -9
- package/src/nodes/lighting/EnvironmentNode.js +138 -0
- package/{examples/jsm → src}/nodes/lighting/HemisphereLightNode.js +12 -11
- package/{examples/jsm → src}/nodes/lighting/IESSpotLightNode.js +7 -9
- package/src/nodes/lighting/IrradianceNode.js +27 -0
- package/src/nodes/lighting/LightProbeNode.js +53 -0
- package/{examples/jsm → src}/nodes/lighting/LightUtils.js +3 -3
- package/src/nodes/lighting/LightingContextNode.js +67 -0
- package/{examples/jsm → src}/nodes/lighting/LightingNode.js +9 -3
- package/src/nodes/lighting/LightsNode.js +250 -0
- package/{examples/jsm → src}/nodes/lighting/PointLightNode.js +12 -13
- package/src/nodes/lighting/RectAreaLightNode.js +97 -0
- package/{examples/jsm → src}/nodes/lighting/SpotLightNode.js +14 -16
- package/{examples/jsm → src}/nodes/materialx/MaterialXNodes.js +2 -2
- package/src/nodes/materialx/lib/mx_hsv.js +127 -0
- 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} +48 -13
- package/src/nodes/math/Hash.js +13 -0
- package/src/nodes/math/MathNode.js +407 -0
- package/{examples/jsm → src}/nodes/math/MathUtils.js +0 -7
- package/src/nodes/math/OperatorNode.js +319 -0
- package/{examples/jsm → src}/nodes/math/TriNoise3D.js +19 -29
- package/{examples/jsm → src}/nodes/parsers/GLSLNodeFunction.js +7 -7
- package/src/nodes/pmrem/PMREMNode.js +240 -0
- package/src/nodes/pmrem/PMREMUtils.js +288 -0
- 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} +122 -96
- package/{examples/jsm → src}/nodes/utils/ArrayElementNode.js +9 -5
- package/{examples/jsm → src}/nodes/utils/ConvertNode.js +7 -3
- package/src/nodes/utils/CubeMapNode.js +160 -0
- package/src/nodes/utils/Discard.js +8 -0
- package/src/nodes/utils/EquirectUVNode.js +36 -0
- package/src/nodes/utils/FlipNode.js +68 -0
- package/{examples/jsm → src}/nodes/utils/FunctionOverloadingNode.js +11 -5
- package/{examples/jsm → src}/nodes/utils/JoinNode.js +6 -3
- package/{examples/jsm → src}/nodes/utils/LoopNode.js +23 -12
- package/src/nodes/utils/MatcapUVNode.js +33 -0
- package/{examples/jsm → src}/nodes/utils/MaxMipLevelNode.js +16 -7
- package/{examples/jsm → src}/nodes/utils/OscNode.js +12 -8
- package/src/nodes/utils/Packing.js +4 -0
- package/src/nodes/utils/RTTNode.js +133 -0
- package/{examples/jsm → src}/nodes/utils/ReflectorNode.js +21 -5
- package/{examples/jsm → src}/nodes/utils/RemapNode.js +12 -8
- package/{examples/jsm → src}/nodes/utils/RotateNode.js +8 -13
- package/{examples/jsm → src}/nodes/utils/SetNode.js +7 -4
- package/{examples/jsm → src}/nodes/utils/SplitNode.js +7 -3
- package/{examples/jsm → src}/nodes/utils/SpriteSheetUVNode.js +10 -6
- package/src/nodes/utils/SpriteUtils.js +47 -0
- package/{examples/jsm → src}/nodes/utils/StorageArrayElementNode.js +11 -12
- package/{examples/jsm → src}/nodes/utils/TimerNode.js +8 -5
- package/{examples/jsm → src}/nodes/utils/TriplanarTexturesNode.js +11 -9
- package/src/nodes/utils/UVUtils.js +19 -0
- package/src/nodes/utils/ViewportUtils.js +14 -0
- package/src/objects/BatchedMesh.js +302 -144
- package/src/objects/InstancedMesh.js +11 -1
- package/src/objects/LOD.js +21 -0
- package/src/objects/Line.js +67 -43
- package/src/objects/Mesh.js +7 -23
- package/src/objects/Points.js +2 -0
- package/src/renderers/WebGLRenderer.js +473 -224
- package/{examples/jsm → src}/renderers/common/Animation.js +3 -0
- package/{examples/jsm → src}/renderers/common/Attributes.js +4 -1
- package/{examples/jsm → src}/renderers/common/Backend.js +30 -27
- package/{examples/jsm → src}/renderers/common/Background.js +18 -10
- package/src/renderers/common/BindGroup.js +18 -0
- package/src/renderers/common/Bindings.js +203 -0
- package/src/renderers/common/BundleGroup.js +26 -0
- package/src/renderers/common/ChainMap.js +59 -0
- package/{examples/jsm → src}/renderers/common/ClippingContext.js +24 -12
- 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 +35 -15
- package/{examples/jsm → src}/renderers/common/Pipelines.js +2 -2
- package/src/renderers/common/PostProcessing.js +90 -0
- package/src/renderers/common/QuadMesh.js +55 -0
- package/src/renderers/common/RenderBundle.js +18 -0
- package/src/renderers/common/RenderBundles.js +38 -0
- package/{examples/jsm → src}/renderers/common/RenderContext.js +25 -2
- package/{examples/jsm → src}/renderers/common/RenderContexts.js +1 -1
- package/{examples/jsm → src}/renderers/common/RenderList.js +11 -2
- package/src/renderers/common/RenderObject.js +413 -0
- package/{examples/jsm → src}/renderers/common/RenderObjects.js +9 -2
- package/{examples/jsm → src}/renderers/common/Renderer.js +431 -83
- package/{examples/jsm → src}/renderers/common/SampledTexture.js +14 -5
- 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 +15 -15
- package/{examples/jsm → src}/renderers/common/Uniform.js +10 -5
- package/{examples/jsm → src}/renderers/common/UniformsGroup.js +69 -31
- package/src/renderers/common/extras/PMREMGenerator.js +771 -0
- package/src/renderers/common/nodes/NodeBuilderState.js +58 -0
- package/src/renderers/common/nodes/NodeLibrary.js +118 -0
- package/src/renderers/common/nodes/NodeSampledTexture.js +64 -0
- package/{examples/jsm → src}/renderers/common/nodes/NodeSampler.js +8 -1
- package/{examples/jsm → src}/renderers/common/nodes/NodeStorageBuffer.js +5 -1
- package/{examples/jsm → src}/renderers/common/nodes/NodeUniform.js +3 -3
- package/{examples/jsm → src}/renderers/common/nodes/NodeUniformBuffer.js +2 -1
- package/{examples/jsm → src}/renderers/common/nodes/NodeUniformsGroup.js +2 -8
- package/{examples/jsm → src}/renderers/common/nodes/Nodes.js +106 -68
- package/src/renderers/shaders/ShaderChunk/batching_pars_vertex.glsl.js +31 -1
- package/src/renderers/shaders/ShaderChunk/batching_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/color_vertex.glsl.js +9 -1
- package/src/renderers/shaders/ShaderChunk/colorspace_pars_fragment.glsl.js +0 -9
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +0 -10
- package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +3 -3
- package/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +8 -22
- package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +6 -0
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +1 -0
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl.js +2 -10
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl.js +2 -16
- package/src/renderers/shaders/ShaderChunk/morphcolor_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/morphinstance_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/morphnormal_vertex.glsl.js +3 -14
- package/src/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl.js +10 -31
- package/src/renderers/shaders/ShaderChunk/morphtarget_vertex.glsl.js +3 -23
- package/src/renderers/shaders/ShaderChunk/packing.glsl.js +45 -13
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +38 -25
- 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 +19 -11
- package/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js +47 -13
- package/src/renderers/shaders/ShaderChunk.js +0 -2
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +8 -0
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +4 -0
- package/src/renderers/shaders/ShaderLib/sprite.glsl.js +2 -4
- package/src/renderers/shaders/ShaderLib.js +2 -1
- package/src/renderers/shaders/UniformsLib.js +3 -0
- package/src/renderers/shaders/UniformsUtils.js +10 -1
- package/src/renderers/webgl/WebGLAttributes.js +42 -38
- package/src/renderers/webgl/WebGLBackground.js +24 -3
- package/src/renderers/webgl/WebGLBindingStates.js +14 -51
- package/src/renderers/webgl/WebGLBufferRenderer.js +23 -22
- package/src/renderers/webgl/WebGLCapabilities.js +44 -13
- package/src/renderers/webgl/WebGLCubeUVMaps.js +10 -6
- package/src/renderers/webgl/WebGLExtensions.js +7 -20
- package/src/renderers/webgl/WebGLIndexedBufferRenderer.js +23 -21
- package/src/renderers/webgl/WebGLLights.js +21 -44
- package/src/renderers/webgl/WebGLMaterials.js +9 -8
- package/src/renderers/webgl/WebGLMorphtargets.js +78 -217
- package/src/renderers/webgl/WebGLProgram.js +46 -78
- package/src/renderers/webgl/WebGLPrograms.js +37 -40
- package/src/renderers/webgl/WebGLProperties.js +7 -0
- package/src/renderers/webgl/WebGLRenderStates.js +15 -9
- package/src/renderers/webgl/WebGLShadowMap.js +25 -25
- package/src/renderers/webgl/WebGLState.js +35 -58
- package/src/renderers/webgl/WebGLTextures.js +313 -358
- package/src/renderers/webgl/WebGLUniforms.js +12 -2
- package/src/renderers/webgl/WebGLUniformsGroups.js +8 -8
- package/src/renderers/webgl/WebGLUtils.js +9 -78
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/WebGLBackend.js +389 -152
- package/src/renderers/webgl-fallback/WebGLBufferRenderer.js +145 -0
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/nodes/GLSLNodeBuilder.js +245 -44
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLAttributeUtils.js +7 -1
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLConstants.js +2 -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 +21 -3
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLTextureUtils.js +271 -43
- package/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/utils/WebGLUtils.js +6 -23
- package/{examples/jsm → src}/renderers/webgpu/WebGPUBackend.js +318 -141
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +42 -0
- package/{examples/jsm → src}/renderers/webgpu/WebGPURenderer.js +10 -7
- package/src/renderers/webgpu/nodes/BasicNodeLibrary.js +59 -0
- package/src/renderers/webgpu/nodes/StandardNodeLibrary.js +105 -0
- package/{examples/jsm → src}/renderers/webgpu/nodes/WGSLNodeBuilder.js +424 -95
- package/src/renderers/webgpu/nodes/WGSLNodeFunction.js +159 -0
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUAttributeUtils.js +37 -18
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUBindingUtils.js +86 -32
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUConstants.js +10 -1
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUPipelineUtils.js +68 -27
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUTexturePassUtils.js +62 -5
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUTextureUtils.js +235 -68
- package/{examples/jsm → src}/renderers/webgpu/utils/WebGPUUtils.js +43 -5
- package/src/renderers/webxr/WebXRDepthSensing.js +11 -6
- package/src/renderers/webxr/WebXRManager.js +53 -38
- package/src/scenes/Scene.js +7 -1
- package/src/textures/CompressedArrayTexture.js +14 -0
- package/src/textures/DataArrayTexture.js +14 -0
- package/src/textures/DepthTexture.js +1 -3
- package/src/textures/Texture.js +12 -2
- package/src/utils.js +62 -1
- package/examples/jsm/geometries/SDFGeometryGenerator.js +0 -144
- package/examples/jsm/loaders/LogLuvLoader.js +0 -606
- package/examples/jsm/loaders/TiltLoader.js +0 -520
- package/examples/jsm/nodes/Nodes.js +0 -195
- package/examples/jsm/nodes/accessors/AccessorsUtils.js +0 -10
- package/examples/jsm/nodes/accessors/BitangentNode.js +0 -89
- package/examples/jsm/nodes/accessors/CameraNode.js +0 -119
- package/examples/jsm/nodes/accessors/CubeTextureNode.js +0 -61
- package/examples/jsm/nodes/accessors/InstanceNode.js +0 -71
- package/examples/jsm/nodes/accessors/InstancedPointsMaterialNode.js +0 -21
- package/examples/jsm/nodes/accessors/MaterialNode.js +0 -314
- package/examples/jsm/nodes/accessors/ModelNode.js +0 -33
- package/examples/jsm/nodes/accessors/ModelViewProjectionNode.js +0 -39
- package/examples/jsm/nodes/accessors/NormalNode.js +0 -96
- package/examples/jsm/nodes/accessors/PointUVNode.js +0 -26
- package/examples/jsm/nodes/accessors/PositionNode.js +0 -104
- package/examples/jsm/nodes/accessors/ReflectVectorNode.js +0 -35
- package/examples/jsm/nodes/accessors/SkinningNode.js +0 -124
- package/examples/jsm/nodes/accessors/StorageBufferNode.js +0 -72
- package/examples/jsm/nodes/accessors/TangentNode.js +0 -109
- package/examples/jsm/nodes/accessors/TextureSizeNode.js +0 -35
- package/examples/jsm/nodes/accessors/UVNode.js +0 -47
- package/examples/jsm/nodes/core/CacheNode.js +0 -49
- package/examples/jsm/nodes/core/IndexNode.js +0 -66
- 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 -72
- package/examples/jsm/nodes/core/UniformGroupNode.js +0 -36
- package/examples/jsm/nodes/core/VaryingNode.js +0 -65
- 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 -27
- package/examples/jsm/nodes/display/PassNode.js +0 -183
- package/examples/jsm/nodes/display/ToneMappingNode.js +0 -184
- package/examples/jsm/nodes/display/ViewportDepthNode.js +0 -97
- package/examples/jsm/nodes/display/ViewportDepthTextureNode.js +0 -31
- package/examples/jsm/nodes/display/ViewportNode.js +0 -134
- package/examples/jsm/nodes/display/ViewportSharedTextureNode.js +0 -31
- package/examples/jsm/nodes/fog/FogExp2Node.js +0 -35
- package/examples/jsm/nodes/fog/FogNode.js +0 -38
- package/examples/jsm/nodes/fog/FogRangeNode.js +0 -34
- package/examples/jsm/nodes/functions/BSDF/BRDF_GGX.js +0 -40
- package/examples/jsm/nodes/functions/PhysicalLightingModel.js +0 -393
- 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 -241
- package/examples/jsm/nodes/lighting/EnvironmentNode.js +0 -181
- package/examples/jsm/nodes/lighting/LightNode.js +0 -57
- package/examples/jsm/nodes/lighting/LightingContextNode.js +0 -66
- package/examples/jsm/nodes/lighting/LightsNode.js +0 -188
- package/examples/jsm/nodes/materials/InstancedPointsNodeMaterial.js +0 -162
- 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/MeshNormalNodeMaterial.js +0 -40
- package/examples/jsm/nodes/materials/MeshPhongNodeMaterial.js +0 -65
- package/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js +0 -155
- package/examples/jsm/nodes/materials/MeshStandardNodeMaterial.js +0 -80
- package/examples/jsm/nodes/materials/SpriteNodeMaterial.js +0 -90
- package/examples/jsm/nodes/materialx/lib/mx_hsv.js +0 -130
- package/examples/jsm/nodes/math/HashNode.js +0 -34
- package/examples/jsm/nodes/math/MathNode.js +0 -391
- package/examples/jsm/nodes/math/OperatorNode.js +0 -274
- package/examples/jsm/nodes/procedural/CheckerNode.js +0 -42
- package/examples/jsm/nodes/utils/DiscardNode.js +0 -27
- package/examples/jsm/nodes/utils/EquirectUVNode.js +0 -33
- package/examples/jsm/nodes/utils/MatcapUVNode.js +0 -30
- package/examples/jsm/nodes/utils/PackingNode.js +0 -55
- package/examples/jsm/nodes/utils/RotateUVNode.js +0 -35
- package/examples/jsm/nodes/utils/SpecularMIPLevelNode.js +0 -37
- package/examples/jsm/objects/QuadMesh.js +0 -66
- package/examples/jsm/renderers/common/Bindings.js +0 -173
- package/examples/jsm/renderers/common/ChainMap.js +0 -89
- package/examples/jsm/renderers/common/PostProcessing.js +0 -25
- package/examples/jsm/renderers/common/RenderObject.js +0 -221
- package/examples/jsm/renderers/common/nodes/NodeBuilderState.js +0 -44
- package/examples/jsm/renderers/common/nodes/NodeSampledTexture.js +0 -49
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeFunction.js +0 -104
- package/examples/jsm/utils/GPUStatsPanel.js +0 -128
- package/examples/jsm/utils/PackedPhongMaterial.js +0 -178
- package/src/renderers/WebGL1Renderer.js +0 -7
- package/src/renderers/shaders/ShaderChunk/lightmap_fragment.glsl.js +0 -10
- /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/Binding.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Buffer.js +0 -0
- /package/{examples/jsm → src}/renderers/common/BufferUtils.js +0 -0
- /package/{examples/jsm → src}/renderers/common/ComputePipeline.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Constants.js +0 -0
- /package/{examples/jsm → src}/renderers/common/DataMap.js +0 -0
- /package/{examples/jsm → src}/renderers/common/Pipeline.js +0 -0
- /package/{examples/jsm → src}/renderers/common/ProgrammableStage.js +0 -0
- /package/{examples/jsm → src}/renderers/common/RenderLists.js +0 -0
- /package/{examples/jsm → src}/renderers/common/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}/utils/WebGLCapabilities.js +0 -0
- /package/{examples/jsm → src}/renderers/webgpu/nodes/WGSLNodeParser.js +0 -0
|
@@ -1,41 +1,63 @@
|
|
|
1
1
|
// Three.js Transpiler
|
|
2
2
|
// https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/libraries/stdlib/genglsl/lib/mx_noise.glsl
|
|
3
3
|
|
|
4
|
-
import { int, uint, float, vec3, bool, uvec3, vec2, vec4, If,
|
|
5
|
-
import {
|
|
4
|
+
import { int, uint, float, vec3, bool, uvec3, vec2, vec4, If, Fn } from '../../tsl/TSLBase.js';
|
|
5
|
+
import { select } from '../../math/ConditionalNode.js';
|
|
6
6
|
import { sub, mul } from '../../math/OperatorNode.js';
|
|
7
7
|
import { floor, abs, max, dot, min, sqrt } from '../../math/MathNode.js';
|
|
8
8
|
import { overloadingFn } from '../../utils/FunctionOverloadingNode.js';
|
|
9
|
-
import {
|
|
9
|
+
import { Loop } from '../../utils/LoopNode.js';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
export const mx_select = /*@__PURE__*/ Fn( ( [ b_immutable, t_immutable, f_immutable ] ) => {
|
|
12
13
|
|
|
13
14
|
const f = float( f_immutable ).toVar();
|
|
14
15
|
const t = float( t_immutable ).toVar();
|
|
15
16
|
const b = bool( b_immutable ).toVar();
|
|
16
17
|
|
|
17
|
-
return
|
|
18
|
+
return select( b, t, f );
|
|
18
19
|
|
|
20
|
+
} ).setLayout( {
|
|
21
|
+
name: 'mx_select',
|
|
22
|
+
type: 'float',
|
|
23
|
+
inputs: [
|
|
24
|
+
{ name: 'b', type: 'bool' },
|
|
25
|
+
{ name: 't', type: 'float' },
|
|
26
|
+
{ name: 'f', type: 'float' }
|
|
27
|
+
]
|
|
19
28
|
} );
|
|
20
29
|
|
|
21
|
-
const mx_negate_if =
|
|
30
|
+
export const mx_negate_if = /*@__PURE__*/ Fn( ( [ val_immutable, b_immutable ] ) => {
|
|
22
31
|
|
|
23
32
|
const b = bool( b_immutable ).toVar();
|
|
24
33
|
const val = float( val_immutable ).toVar();
|
|
25
34
|
|
|
26
|
-
return
|
|
35
|
+
return select( b, val.negate(), val );
|
|
27
36
|
|
|
37
|
+
} ).setLayout( {
|
|
38
|
+
name: 'mx_negate_if',
|
|
39
|
+
type: 'float',
|
|
40
|
+
inputs: [
|
|
41
|
+
{ name: 'val', type: 'float' },
|
|
42
|
+
{ name: 'b', type: 'bool' }
|
|
43
|
+
]
|
|
28
44
|
} );
|
|
29
45
|
|
|
30
|
-
const mx_floor =
|
|
46
|
+
export const mx_floor = /*@__PURE__*/ Fn( ( [ x_immutable ] ) => {
|
|
31
47
|
|
|
32
48
|
const x = float( x_immutable ).toVar();
|
|
33
49
|
|
|
34
50
|
return int( floor( x ) );
|
|
35
51
|
|
|
52
|
+
} ).setLayout( {
|
|
53
|
+
name: 'mx_floor',
|
|
54
|
+
type: 'int',
|
|
55
|
+
inputs: [
|
|
56
|
+
{ name: 'x', type: 'float' }
|
|
57
|
+
]
|
|
36
58
|
} );
|
|
37
59
|
|
|
38
|
-
const mx_floorfrac =
|
|
60
|
+
export const mx_floorfrac = /*@__PURE__*/ Fn( ( [ x_immutable, i ] ) => {
|
|
39
61
|
|
|
40
62
|
const x = float( x_immutable ).toVar();
|
|
41
63
|
i.assign( mx_floor( x ) );
|
|
@@ -44,7 +66,7 @@ const mx_floorfrac = tslFn( ( [ x_immutable, i ] ) => {
|
|
|
44
66
|
|
|
45
67
|
} );
|
|
46
68
|
|
|
47
|
-
const mx_bilerp_0 =
|
|
69
|
+
export const mx_bilerp_0 = /*@__PURE__*/ Fn( ( [ v0_immutable, v1_immutable, v2_immutable, v3_immutable, s_immutable, t_immutable ] ) => {
|
|
48
70
|
|
|
49
71
|
const t = float( t_immutable ).toVar();
|
|
50
72
|
const s = float( s_immutable ).toVar();
|
|
@@ -56,9 +78,20 @@ const mx_bilerp_0 = tslFn( ( [ v0_immutable, v1_immutable, v2_immutable, v3_immu
|
|
|
56
78
|
|
|
57
79
|
return sub( 1.0, t ).mul( v0.mul( s1 ).add( v1.mul( s ) ) ).add( t.mul( v2.mul( s1 ).add( v3.mul( s ) ) ) );
|
|
58
80
|
|
|
81
|
+
} ).setLayout( {
|
|
82
|
+
name: 'mx_bilerp_0',
|
|
83
|
+
type: 'float',
|
|
84
|
+
inputs: [
|
|
85
|
+
{ name: 'v0', type: 'float' },
|
|
86
|
+
{ name: 'v1', type: 'float' },
|
|
87
|
+
{ name: 'v2', type: 'float' },
|
|
88
|
+
{ name: 'v3', type: 'float' },
|
|
89
|
+
{ name: 's', type: 'float' },
|
|
90
|
+
{ name: 't', type: 'float' }
|
|
91
|
+
]
|
|
59
92
|
} );
|
|
60
93
|
|
|
61
|
-
const mx_bilerp_1 =
|
|
94
|
+
export const mx_bilerp_1 = /*@__PURE__*/ Fn( ( [ v0_immutable, v1_immutable, v2_immutable, v3_immutable, s_immutable, t_immutable ] ) => {
|
|
62
95
|
|
|
63
96
|
const t = float( t_immutable ).toVar();
|
|
64
97
|
const s = float( s_immutable ).toVar();
|
|
@@ -70,11 +103,22 @@ const mx_bilerp_1 = tslFn( ( [ v0_immutable, v1_immutable, v2_immutable, v3_immu
|
|
|
70
103
|
|
|
71
104
|
return sub( 1.0, t ).mul( v0.mul( s1 ).add( v1.mul( s ) ) ).add( t.mul( v2.mul( s1 ).add( v3.mul( s ) ) ) );
|
|
72
105
|
|
|
106
|
+
} ).setLayout( {
|
|
107
|
+
name: 'mx_bilerp_1',
|
|
108
|
+
type: 'vec3',
|
|
109
|
+
inputs: [
|
|
110
|
+
{ name: 'v0', type: 'vec3' },
|
|
111
|
+
{ name: 'v1', type: 'vec3' },
|
|
112
|
+
{ name: 'v2', type: 'vec3' },
|
|
113
|
+
{ name: 'v3', type: 'vec3' },
|
|
114
|
+
{ name: 's', type: 'float' },
|
|
115
|
+
{ name: 't', type: 'float' }
|
|
116
|
+
]
|
|
73
117
|
} );
|
|
74
118
|
|
|
75
|
-
const mx_bilerp = overloadingFn( [ mx_bilerp_0, mx_bilerp_1 ] );
|
|
119
|
+
export const mx_bilerp = /*@__PURE__*/ overloadingFn( [ mx_bilerp_0, mx_bilerp_1 ] );
|
|
76
120
|
|
|
77
|
-
const mx_trilerp_0 =
|
|
121
|
+
export const mx_trilerp_0 = /*@__PURE__*/ Fn( ( [ v0_immutable, v1_immutable, v2_immutable, v3_immutable, v4_immutable, v5_immutable, v6_immutable, v7_immutable, s_immutable, t_immutable, r_immutable ] ) => {
|
|
78
122
|
|
|
79
123
|
const r = float( r_immutable ).toVar();
|
|
80
124
|
const t = float( t_immutable ).toVar();
|
|
@@ -93,9 +137,25 @@ const mx_trilerp_0 = tslFn( ( [ v0_immutable, v1_immutable, v2_immutable, v3_imm
|
|
|
93
137
|
|
|
94
138
|
return r1.mul( t1.mul( v0.mul( s1 ).add( v1.mul( s ) ) ).add( t.mul( v2.mul( s1 ).add( v3.mul( s ) ) ) ) ).add( r.mul( t1.mul( v4.mul( s1 ).add( v5.mul( s ) ) ).add( t.mul( v6.mul( s1 ).add( v7.mul( s ) ) ) ) ) );
|
|
95
139
|
|
|
140
|
+
} ).setLayout( {
|
|
141
|
+
name: 'mx_trilerp_0',
|
|
142
|
+
type: 'float',
|
|
143
|
+
inputs: [
|
|
144
|
+
{ name: 'v0', type: 'float' },
|
|
145
|
+
{ name: 'v1', type: 'float' },
|
|
146
|
+
{ name: 'v2', type: 'float' },
|
|
147
|
+
{ name: 'v3', type: 'float' },
|
|
148
|
+
{ name: 'v4', type: 'float' },
|
|
149
|
+
{ name: 'v5', type: 'float' },
|
|
150
|
+
{ name: 'v6', type: 'float' },
|
|
151
|
+
{ name: 'v7', type: 'float' },
|
|
152
|
+
{ name: 's', type: 'float' },
|
|
153
|
+
{ name: 't', type: 'float' },
|
|
154
|
+
{ name: 'r', type: 'float' }
|
|
155
|
+
]
|
|
96
156
|
} );
|
|
97
157
|
|
|
98
|
-
const mx_trilerp_1 =
|
|
158
|
+
export const mx_trilerp_1 = /*@__PURE__*/ Fn( ( [ v0_immutable, v1_immutable, v2_immutable, v3_immutable, v4_immutable, v5_immutable, v6_immutable, v7_immutable, s_immutable, t_immutable, r_immutable ] ) => {
|
|
99
159
|
|
|
100
160
|
const r = float( r_immutable ).toVar();
|
|
101
161
|
const t = float( t_immutable ).toVar();
|
|
@@ -114,11 +174,27 @@ const mx_trilerp_1 = tslFn( ( [ v0_immutable, v1_immutable, v2_immutable, v3_imm
|
|
|
114
174
|
|
|
115
175
|
return r1.mul( t1.mul( v0.mul( s1 ).add( v1.mul( s ) ) ).add( t.mul( v2.mul( s1 ).add( v3.mul( s ) ) ) ) ).add( r.mul( t1.mul( v4.mul( s1 ).add( v5.mul( s ) ) ).add( t.mul( v6.mul( s1 ).add( v7.mul( s ) ) ) ) ) );
|
|
116
176
|
|
|
177
|
+
} ).setLayout( {
|
|
178
|
+
name: 'mx_trilerp_1',
|
|
179
|
+
type: 'vec3',
|
|
180
|
+
inputs: [
|
|
181
|
+
{ name: 'v0', type: 'vec3' },
|
|
182
|
+
{ name: 'v1', type: 'vec3' },
|
|
183
|
+
{ name: 'v2', type: 'vec3' },
|
|
184
|
+
{ name: 'v3', type: 'vec3' },
|
|
185
|
+
{ name: 'v4', type: 'vec3' },
|
|
186
|
+
{ name: 'v5', type: 'vec3' },
|
|
187
|
+
{ name: 'v6', type: 'vec3' },
|
|
188
|
+
{ name: 'v7', type: 'vec3' },
|
|
189
|
+
{ name: 's', type: 'float' },
|
|
190
|
+
{ name: 't', type: 'float' },
|
|
191
|
+
{ name: 'r', type: 'float' }
|
|
192
|
+
]
|
|
117
193
|
} );
|
|
118
194
|
|
|
119
|
-
const mx_trilerp = overloadingFn( [ mx_trilerp_0, mx_trilerp_1 ] );
|
|
195
|
+
export const mx_trilerp = /*@__PURE__*/ overloadingFn( [ mx_trilerp_0, mx_trilerp_1 ] );
|
|
120
196
|
|
|
121
|
-
const mx_gradient_float_0 =
|
|
197
|
+
export const mx_gradient_float_0 = /*@__PURE__*/ Fn( ( [ hash_immutable, x_immutable, y_immutable ] ) => {
|
|
122
198
|
|
|
123
199
|
const y = float( y_immutable ).toVar();
|
|
124
200
|
const x = float( x_immutable ).toVar();
|
|
@@ -129,9 +205,17 @@ const mx_gradient_float_0 = tslFn( ( [ hash_immutable, x_immutable, y_immutable
|
|
|
129
205
|
|
|
130
206
|
return mx_negate_if( u, bool( h.bitAnd( uint( 1 ) ) ) ).add( mx_negate_if( v, bool( h.bitAnd( uint( 2 ) ) ) ) );
|
|
131
207
|
|
|
208
|
+
} ).setLayout( {
|
|
209
|
+
name: 'mx_gradient_float_0',
|
|
210
|
+
type: 'float',
|
|
211
|
+
inputs: [
|
|
212
|
+
{ name: 'hash', type: 'uint' },
|
|
213
|
+
{ name: 'x', type: 'float' },
|
|
214
|
+
{ name: 'y', type: 'float' }
|
|
215
|
+
]
|
|
132
216
|
} );
|
|
133
217
|
|
|
134
|
-
const mx_gradient_float_1 =
|
|
218
|
+
export const mx_gradient_float_1 = /*@__PURE__*/ Fn( ( [ hash_immutable, x_immutable, y_immutable, z_immutable ] ) => {
|
|
135
219
|
|
|
136
220
|
const z = float( z_immutable ).toVar();
|
|
137
221
|
const y = float( y_immutable ).toVar();
|
|
@@ -143,11 +227,20 @@ const mx_gradient_float_1 = tslFn( ( [ hash_immutable, x_immutable, y_immutable,
|
|
|
143
227
|
|
|
144
228
|
return mx_negate_if( u, bool( h.bitAnd( uint( 1 ) ) ) ).add( mx_negate_if( v, bool( h.bitAnd( uint( 2 ) ) ) ) );
|
|
145
229
|
|
|
230
|
+
} ).setLayout( {
|
|
231
|
+
name: 'mx_gradient_float_1',
|
|
232
|
+
type: 'float',
|
|
233
|
+
inputs: [
|
|
234
|
+
{ name: 'hash', type: 'uint' },
|
|
235
|
+
{ name: 'x', type: 'float' },
|
|
236
|
+
{ name: 'y', type: 'float' },
|
|
237
|
+
{ name: 'z', type: 'float' }
|
|
238
|
+
]
|
|
146
239
|
} );
|
|
147
240
|
|
|
148
|
-
const mx_gradient_float = overloadingFn( [ mx_gradient_float_0, mx_gradient_float_1 ] );
|
|
241
|
+
export const mx_gradient_float = /*@__PURE__*/ overloadingFn( [ mx_gradient_float_0, mx_gradient_float_1 ] );
|
|
149
242
|
|
|
150
|
-
const mx_gradient_vec3_0 =
|
|
243
|
+
export const mx_gradient_vec3_0 = /*@__PURE__*/ Fn( ( [ hash_immutable, x_immutable, y_immutable ] ) => {
|
|
151
244
|
|
|
152
245
|
const y = float( y_immutable ).toVar();
|
|
153
246
|
const x = float( x_immutable ).toVar();
|
|
@@ -155,9 +248,17 @@ const mx_gradient_vec3_0 = tslFn( ( [ hash_immutable, x_immutable, y_immutable ]
|
|
|
155
248
|
|
|
156
249
|
return vec3( mx_gradient_float( hash.x, x, y ), mx_gradient_float( hash.y, x, y ), mx_gradient_float( hash.z, x, y ) );
|
|
157
250
|
|
|
251
|
+
} ).setLayout( {
|
|
252
|
+
name: 'mx_gradient_vec3_0',
|
|
253
|
+
type: 'vec3',
|
|
254
|
+
inputs: [
|
|
255
|
+
{ name: 'hash', type: 'uvec3' },
|
|
256
|
+
{ name: 'x', type: 'float' },
|
|
257
|
+
{ name: 'y', type: 'float' }
|
|
258
|
+
]
|
|
158
259
|
} );
|
|
159
260
|
|
|
160
|
-
const mx_gradient_vec3_1 =
|
|
261
|
+
export const mx_gradient_vec3_1 = /*@__PURE__*/ Fn( ( [ hash_immutable, x_immutable, y_immutable, z_immutable ] ) => {
|
|
161
262
|
|
|
162
263
|
const z = float( z_immutable ).toVar();
|
|
163
264
|
const y = float( y_immutable ).toVar();
|
|
@@ -166,56 +267,96 @@ const mx_gradient_vec3_1 = tslFn( ( [ hash_immutable, x_immutable, y_immutable,
|
|
|
166
267
|
|
|
167
268
|
return vec3( mx_gradient_float( hash.x, x, y, z ), mx_gradient_float( hash.y, x, y, z ), mx_gradient_float( hash.z, x, y, z ) );
|
|
168
269
|
|
|
270
|
+
} ).setLayout( {
|
|
271
|
+
name: 'mx_gradient_vec3_1',
|
|
272
|
+
type: 'vec3',
|
|
273
|
+
inputs: [
|
|
274
|
+
{ name: 'hash', type: 'uvec3' },
|
|
275
|
+
{ name: 'x', type: 'float' },
|
|
276
|
+
{ name: 'y', type: 'float' },
|
|
277
|
+
{ name: 'z', type: 'float' }
|
|
278
|
+
]
|
|
169
279
|
} );
|
|
170
280
|
|
|
171
|
-
const mx_gradient_vec3 = overloadingFn( [ mx_gradient_vec3_0, mx_gradient_vec3_1 ] );
|
|
281
|
+
export const mx_gradient_vec3 = /*@__PURE__*/ overloadingFn( [ mx_gradient_vec3_0, mx_gradient_vec3_1 ] );
|
|
172
282
|
|
|
173
|
-
const mx_gradient_scale2d_0 =
|
|
283
|
+
export const mx_gradient_scale2d_0 = /*@__PURE__*/ Fn( ( [ v_immutable ] ) => {
|
|
174
284
|
|
|
175
285
|
const v = float( v_immutable ).toVar();
|
|
176
286
|
|
|
177
287
|
return mul( 0.6616, v );
|
|
178
288
|
|
|
289
|
+
} ).setLayout( {
|
|
290
|
+
name: 'mx_gradient_scale2d_0',
|
|
291
|
+
type: 'float',
|
|
292
|
+
inputs: [
|
|
293
|
+
{ name: 'v', type: 'float' }
|
|
294
|
+
]
|
|
179
295
|
} );
|
|
180
296
|
|
|
181
|
-
const mx_gradient_scale3d_0 =
|
|
297
|
+
export const mx_gradient_scale3d_0 = /*@__PURE__*/ Fn( ( [ v_immutable ] ) => {
|
|
182
298
|
|
|
183
299
|
const v = float( v_immutable ).toVar();
|
|
184
300
|
|
|
185
301
|
return mul( 0.9820, v );
|
|
186
302
|
|
|
303
|
+
} ).setLayout( {
|
|
304
|
+
name: 'mx_gradient_scale3d_0',
|
|
305
|
+
type: 'float',
|
|
306
|
+
inputs: [
|
|
307
|
+
{ name: 'v', type: 'float' }
|
|
308
|
+
]
|
|
187
309
|
} );
|
|
188
310
|
|
|
189
|
-
const mx_gradient_scale2d_1 =
|
|
311
|
+
export const mx_gradient_scale2d_1 = /*@__PURE__*/ Fn( ( [ v_immutable ] ) => {
|
|
190
312
|
|
|
191
313
|
const v = vec3( v_immutable ).toVar();
|
|
192
314
|
|
|
193
315
|
return mul( 0.6616, v );
|
|
194
316
|
|
|
317
|
+
} ).setLayout( {
|
|
318
|
+
name: 'mx_gradient_scale2d_1',
|
|
319
|
+
type: 'vec3',
|
|
320
|
+
inputs: [
|
|
321
|
+
{ name: 'v', type: 'vec3' }
|
|
322
|
+
]
|
|
195
323
|
} );
|
|
196
324
|
|
|
197
|
-
const mx_gradient_scale2d = overloadingFn( [ mx_gradient_scale2d_0, mx_gradient_scale2d_1 ] );
|
|
325
|
+
export const mx_gradient_scale2d = /*@__PURE__*/ overloadingFn( [ mx_gradient_scale2d_0, mx_gradient_scale2d_1 ] );
|
|
198
326
|
|
|
199
|
-
const mx_gradient_scale3d_1 =
|
|
327
|
+
export const mx_gradient_scale3d_1 = /*@__PURE__*/ Fn( ( [ v_immutable ] ) => {
|
|
200
328
|
|
|
201
329
|
const v = vec3( v_immutable ).toVar();
|
|
202
330
|
|
|
203
331
|
return mul( 0.9820, v );
|
|
204
332
|
|
|
333
|
+
} ).setLayout( {
|
|
334
|
+
name: 'mx_gradient_scale3d_1',
|
|
335
|
+
type: 'vec3',
|
|
336
|
+
inputs: [
|
|
337
|
+
{ name: 'v', type: 'vec3' }
|
|
338
|
+
]
|
|
205
339
|
} );
|
|
206
340
|
|
|
207
|
-
const mx_gradient_scale3d = overloadingFn( [ mx_gradient_scale3d_0, mx_gradient_scale3d_1 ] );
|
|
341
|
+
export const mx_gradient_scale3d = /*@__PURE__*/ overloadingFn( [ mx_gradient_scale3d_0, mx_gradient_scale3d_1 ] );
|
|
208
342
|
|
|
209
|
-
const mx_rotl32 =
|
|
343
|
+
export const mx_rotl32 = /*@__PURE__*/ Fn( ( [ x_immutable, k_immutable ] ) => {
|
|
210
344
|
|
|
211
345
|
const k = int( k_immutable ).toVar();
|
|
212
346
|
const x = uint( x_immutable ).toVar();
|
|
213
347
|
|
|
214
348
|
return x.shiftLeft( k ).bitOr( x.shiftRight( int( 32 ).sub( k ) ) );
|
|
215
349
|
|
|
350
|
+
} ).setLayout( {
|
|
351
|
+
name: 'mx_rotl32',
|
|
352
|
+
type: 'uint',
|
|
353
|
+
inputs: [
|
|
354
|
+
{ name: 'x', type: 'uint' },
|
|
355
|
+
{ name: 'k', type: 'int' }
|
|
356
|
+
]
|
|
216
357
|
} );
|
|
217
358
|
|
|
218
|
-
const mx_bjmix =
|
|
359
|
+
export const mx_bjmix = /*@__PURE__*/ Fn( ( [ a, b, c ] ) => {
|
|
219
360
|
|
|
220
361
|
a.subAssign( c );
|
|
221
362
|
a.bitXorAssign( mx_rotl32( c, int( 4 ) ) );
|
|
@@ -238,7 +379,7 @@ const mx_bjmix = tslFn( ( [ a, b, c ] ) => {
|
|
|
238
379
|
|
|
239
380
|
} );
|
|
240
381
|
|
|
241
|
-
const mx_bjfinal =
|
|
382
|
+
export const mx_bjfinal = /*@__PURE__*/ Fn( ( [ a_immutable, b_immutable, c_immutable ] ) => {
|
|
242
383
|
|
|
243
384
|
const c = uint( c_immutable ).toVar();
|
|
244
385
|
const b = uint( b_immutable ).toVar();
|
|
@@ -260,65 +401,106 @@ const mx_bjfinal = tslFn( ( [ a_immutable, b_immutable, c_immutable ] ) => {
|
|
|
260
401
|
|
|
261
402
|
return c;
|
|
262
403
|
|
|
404
|
+
} ).setLayout( {
|
|
405
|
+
name: 'mx_bjfinal',
|
|
406
|
+
type: 'uint',
|
|
407
|
+
inputs: [
|
|
408
|
+
{ name: 'a', type: 'uint' },
|
|
409
|
+
{ name: 'b', type: 'uint' },
|
|
410
|
+
{ name: 'c', type: 'uint' }
|
|
411
|
+
]
|
|
263
412
|
} );
|
|
264
413
|
|
|
265
|
-
const mx_bits_to_01 =
|
|
414
|
+
export const mx_bits_to_01 = /*@__PURE__*/ Fn( ( [ bits_immutable ] ) => {
|
|
266
415
|
|
|
267
416
|
const bits = uint( bits_immutable ).toVar();
|
|
268
417
|
|
|
269
418
|
return float( bits ).div( float( uint( int( 0xffffffff ) ) ) );
|
|
270
419
|
|
|
420
|
+
} ).setLayout( {
|
|
421
|
+
name: 'mx_bits_to_01',
|
|
422
|
+
type: 'float',
|
|
423
|
+
inputs: [
|
|
424
|
+
{ name: 'bits', type: 'uint' }
|
|
425
|
+
]
|
|
271
426
|
} );
|
|
272
427
|
|
|
273
|
-
const mx_fade =
|
|
428
|
+
export const mx_fade = /*@__PURE__*/ Fn( ( [ t_immutable ] ) => {
|
|
274
429
|
|
|
275
430
|
const t = float( t_immutable ).toVar();
|
|
276
431
|
|
|
277
|
-
return t.mul( t.mul( t.mul( t.mul( t.mul( 6.0 ).sub( 15.0 ) ).add( 10.0 ) )
|
|
432
|
+
return t.mul( t ).mul( t ).mul( t.mul( t.mul( 6.0 ).sub( 15.0 ) ).add( 10.0 ) );
|
|
278
433
|
|
|
434
|
+
} ).setLayout( {
|
|
435
|
+
name: 'mx_fade',
|
|
436
|
+
type: 'float',
|
|
437
|
+
inputs: [
|
|
438
|
+
{ name: 't', type: 'float' }
|
|
439
|
+
]
|
|
279
440
|
} );
|
|
280
441
|
|
|
281
|
-
const mx_hash_int_0 =
|
|
442
|
+
export const mx_hash_int_0 = /*@__PURE__*/ Fn( ( [ x_immutable ] ) => {
|
|
282
443
|
|
|
283
444
|
const x = int( x_immutable ).toVar();
|
|
284
445
|
const len = uint( uint( 1 ) ).toVar();
|
|
285
|
-
const seed = uint( uint( int( 0xdeadbeef ) ).add( len.shiftLeft( uint( 2 ) ).add( uint( 13 ) ) )
|
|
446
|
+
const seed = uint( uint( int( 0xdeadbeef ) ).add( len.shiftLeft( uint( 2 ) ) ).add( uint( 13 ) ) ).toVar();
|
|
286
447
|
|
|
287
448
|
return mx_bjfinal( seed.add( uint( x ) ), seed, seed );
|
|
288
449
|
|
|
450
|
+
} ).setLayout( {
|
|
451
|
+
name: 'mx_hash_int_0',
|
|
452
|
+
type: 'uint',
|
|
453
|
+
inputs: [
|
|
454
|
+
{ name: 'x', type: 'int' }
|
|
455
|
+
]
|
|
289
456
|
} );
|
|
290
457
|
|
|
291
|
-
const mx_hash_int_1 =
|
|
458
|
+
export const mx_hash_int_1 = /*@__PURE__*/ Fn( ( [ x_immutable, y_immutable ] ) => {
|
|
292
459
|
|
|
293
460
|
const y = int( y_immutable ).toVar();
|
|
294
461
|
const x = int( x_immutable ).toVar();
|
|
295
462
|
const len = uint( uint( 2 ) ).toVar();
|
|
296
463
|
const a = uint().toVar(), b = uint().toVar(), c = uint().toVar();
|
|
297
|
-
a.assign( b.assign( c.assign( uint( int( 0xdeadbeef ) ).add( len.shiftLeft( uint( 2 ) ).add( uint( 13 ) ) ) ) )
|
|
464
|
+
a.assign( b.assign( c.assign( uint( int( 0xdeadbeef ) ).add( len.shiftLeft( uint( 2 ) ) ).add( uint( 13 ) ) ) ) );
|
|
298
465
|
a.addAssign( uint( x ) );
|
|
299
466
|
b.addAssign( uint( y ) );
|
|
300
467
|
|
|
301
468
|
return mx_bjfinal( a, b, c );
|
|
302
469
|
|
|
470
|
+
} ).setLayout( {
|
|
471
|
+
name: 'mx_hash_int_1',
|
|
472
|
+
type: 'uint',
|
|
473
|
+
inputs: [
|
|
474
|
+
{ name: 'x', type: 'int' },
|
|
475
|
+
{ name: 'y', type: 'int' }
|
|
476
|
+
]
|
|
303
477
|
} );
|
|
304
478
|
|
|
305
|
-
const mx_hash_int_2 =
|
|
479
|
+
export const mx_hash_int_2 = /*@__PURE__*/ Fn( ( [ x_immutable, y_immutable, z_immutable ] ) => {
|
|
306
480
|
|
|
307
481
|
const z = int( z_immutable ).toVar();
|
|
308
482
|
const y = int( y_immutable ).toVar();
|
|
309
483
|
const x = int( x_immutable ).toVar();
|
|
310
484
|
const len = uint( uint( 3 ) ).toVar();
|
|
311
485
|
const a = uint().toVar(), b = uint().toVar(), c = uint().toVar();
|
|
312
|
-
a.assign( b.assign( c.assign( uint( int( 0xdeadbeef ) ).add( len.shiftLeft( uint( 2 ) ).add( uint( 13 ) ) ) ) )
|
|
486
|
+
a.assign( b.assign( c.assign( uint( int( 0xdeadbeef ) ).add( len.shiftLeft( uint( 2 ) ) ).add( uint( 13 ) ) ) ) );
|
|
313
487
|
a.addAssign( uint( x ) );
|
|
314
488
|
b.addAssign( uint( y ) );
|
|
315
489
|
c.addAssign( uint( z ) );
|
|
316
490
|
|
|
317
491
|
return mx_bjfinal( a, b, c );
|
|
318
492
|
|
|
493
|
+
} ).setLayout( {
|
|
494
|
+
name: 'mx_hash_int_2',
|
|
495
|
+
type: 'uint',
|
|
496
|
+
inputs: [
|
|
497
|
+
{ name: 'x', type: 'int' },
|
|
498
|
+
{ name: 'y', type: 'int' },
|
|
499
|
+
{ name: 'z', type: 'int' }
|
|
500
|
+
]
|
|
319
501
|
} );
|
|
320
502
|
|
|
321
|
-
const mx_hash_int_3 =
|
|
503
|
+
export const mx_hash_int_3 = /*@__PURE__*/ Fn( ( [ x_immutable, y_immutable, z_immutable, xx_immutable ] ) => {
|
|
322
504
|
|
|
323
505
|
const xx = int( xx_immutable ).toVar();
|
|
324
506
|
const z = int( z_immutable ).toVar();
|
|
@@ -326,7 +508,7 @@ const mx_hash_int_3 = tslFn( ( [ x_immutable, y_immutable, z_immutable, xx_immut
|
|
|
326
508
|
const x = int( x_immutable ).toVar();
|
|
327
509
|
const len = uint( uint( 4 ) ).toVar();
|
|
328
510
|
const a = uint().toVar(), b = uint().toVar(), c = uint().toVar();
|
|
329
|
-
a.assign( b.assign( c.assign( uint( int( 0xdeadbeef ) ).add( len.shiftLeft( uint( 2 ) ).add( uint( 13 ) ) ) ) )
|
|
511
|
+
a.assign( b.assign( c.assign( uint( int( 0xdeadbeef ) ).add( len.shiftLeft( uint( 2 ) ) ).add( uint( 13 ) ) ) ) );
|
|
330
512
|
a.addAssign( uint( x ) );
|
|
331
513
|
b.addAssign( uint( y ) );
|
|
332
514
|
c.addAssign( uint( z ) );
|
|
@@ -335,9 +517,18 @@ const mx_hash_int_3 = tslFn( ( [ x_immutable, y_immutable, z_immutable, xx_immut
|
|
|
335
517
|
|
|
336
518
|
return mx_bjfinal( a, b, c );
|
|
337
519
|
|
|
520
|
+
} ).setLayout( {
|
|
521
|
+
name: 'mx_hash_int_3',
|
|
522
|
+
type: 'uint',
|
|
523
|
+
inputs: [
|
|
524
|
+
{ name: 'x', type: 'int' },
|
|
525
|
+
{ name: 'y', type: 'int' },
|
|
526
|
+
{ name: 'z', type: 'int' },
|
|
527
|
+
{ name: 'xx', type: 'int' }
|
|
528
|
+
]
|
|
338
529
|
} );
|
|
339
530
|
|
|
340
|
-
const mx_hash_int_4 =
|
|
531
|
+
export const mx_hash_int_4 = /*@__PURE__*/ Fn( ( [ x_immutable, y_immutable, z_immutable, xx_immutable, yy_immutable ] ) => {
|
|
341
532
|
|
|
342
533
|
const yy = int( yy_immutable ).toVar();
|
|
343
534
|
const xx = int( xx_immutable ).toVar();
|
|
@@ -346,7 +537,7 @@ const mx_hash_int_4 = tslFn( ( [ x_immutable, y_immutable, z_immutable, xx_immut
|
|
|
346
537
|
const x = int( x_immutable ).toVar();
|
|
347
538
|
const len = uint( uint( 5 ) ).toVar();
|
|
348
539
|
const a = uint().toVar(), b = uint().toVar(), c = uint().toVar();
|
|
349
|
-
a.assign( b.assign( c.assign( uint( int( 0xdeadbeef ) ).add( len.shiftLeft( uint( 2 ) ).add( uint( 13 ) ) ) ) )
|
|
540
|
+
a.assign( b.assign( c.assign( uint( int( 0xdeadbeef ) ).add( len.shiftLeft( uint( 2 ) ) ).add( uint( 13 ) ) ) ) );
|
|
350
541
|
a.addAssign( uint( x ) );
|
|
351
542
|
b.addAssign( uint( y ) );
|
|
352
543
|
c.addAssign( uint( z ) );
|
|
@@ -356,11 +547,21 @@ const mx_hash_int_4 = tslFn( ( [ x_immutable, y_immutable, z_immutable, xx_immut
|
|
|
356
547
|
|
|
357
548
|
return mx_bjfinal( a, b, c );
|
|
358
549
|
|
|
550
|
+
} ).setLayout( {
|
|
551
|
+
name: 'mx_hash_int_4',
|
|
552
|
+
type: 'uint',
|
|
553
|
+
inputs: [
|
|
554
|
+
{ name: 'x', type: 'int' },
|
|
555
|
+
{ name: 'y', type: 'int' },
|
|
556
|
+
{ name: 'z', type: 'int' },
|
|
557
|
+
{ name: 'xx', type: 'int' },
|
|
558
|
+
{ name: 'yy', type: 'int' }
|
|
559
|
+
]
|
|
359
560
|
} );
|
|
360
561
|
|
|
361
|
-
const mx_hash_int = overloadingFn( [ mx_hash_int_0, mx_hash_int_1, mx_hash_int_2, mx_hash_int_3, mx_hash_int_4 ] );
|
|
562
|
+
export const mx_hash_int = /*@__PURE__*/ overloadingFn( [ mx_hash_int_0, mx_hash_int_1, mx_hash_int_2, mx_hash_int_3, mx_hash_int_4 ] );
|
|
362
563
|
|
|
363
|
-
const mx_hash_vec3_0 =
|
|
564
|
+
export const mx_hash_vec3_0 = /*@__PURE__*/ Fn( ( [ x_immutable, y_immutable ] ) => {
|
|
364
565
|
|
|
365
566
|
const y = int( y_immutable ).toVar();
|
|
366
567
|
const x = int( x_immutable ).toVar();
|
|
@@ -372,9 +573,16 @@ const mx_hash_vec3_0 = tslFn( ( [ x_immutable, y_immutable ] ) => {
|
|
|
372
573
|
|
|
373
574
|
return result;
|
|
374
575
|
|
|
576
|
+
} ).setLayout( {
|
|
577
|
+
name: 'mx_hash_vec3_0',
|
|
578
|
+
type: 'uvec3',
|
|
579
|
+
inputs: [
|
|
580
|
+
{ name: 'x', type: 'int' },
|
|
581
|
+
{ name: 'y', type: 'int' }
|
|
582
|
+
]
|
|
375
583
|
} );
|
|
376
584
|
|
|
377
|
-
const mx_hash_vec3_1 =
|
|
585
|
+
export const mx_hash_vec3_1 = /*@__PURE__*/ Fn( ( [ x_immutable, y_immutable, z_immutable ] ) => {
|
|
378
586
|
|
|
379
587
|
const z = int( z_immutable ).toVar();
|
|
380
588
|
const y = int( y_immutable ).toVar();
|
|
@@ -387,11 +595,19 @@ const mx_hash_vec3_1 = tslFn( ( [ x_immutable, y_immutable, z_immutable ] ) => {
|
|
|
387
595
|
|
|
388
596
|
return result;
|
|
389
597
|
|
|
598
|
+
} ).setLayout( {
|
|
599
|
+
name: 'mx_hash_vec3_1',
|
|
600
|
+
type: 'uvec3',
|
|
601
|
+
inputs: [
|
|
602
|
+
{ name: 'x', type: 'int' },
|
|
603
|
+
{ name: 'y', type: 'int' },
|
|
604
|
+
{ name: 'z', type: 'int' }
|
|
605
|
+
]
|
|
390
606
|
} );
|
|
391
607
|
|
|
392
|
-
const mx_hash_vec3 = overloadingFn( [ mx_hash_vec3_0, mx_hash_vec3_1 ] );
|
|
608
|
+
export const mx_hash_vec3 = /*@__PURE__*/ overloadingFn( [ mx_hash_vec3_0, mx_hash_vec3_1 ] );
|
|
393
609
|
|
|
394
|
-
const mx_perlin_noise_float_0 =
|
|
610
|
+
export const mx_perlin_noise_float_0 = /*@__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
395
611
|
|
|
396
612
|
const p = vec2( p_immutable ).toVar();
|
|
397
613
|
const X = int().toVar(), Y = int().toVar();
|
|
@@ -403,9 +619,15 @@ const mx_perlin_noise_float_0 = tslFn( ( [ p_immutable ] ) => {
|
|
|
403
619
|
|
|
404
620
|
return mx_gradient_scale2d( result );
|
|
405
621
|
|
|
622
|
+
} ).setLayout( {
|
|
623
|
+
name: 'mx_perlin_noise_float_0',
|
|
624
|
+
type: 'float',
|
|
625
|
+
inputs: [
|
|
626
|
+
{ name: 'p', type: 'vec2' }
|
|
627
|
+
]
|
|
406
628
|
} );
|
|
407
629
|
|
|
408
|
-
const mx_perlin_noise_float_1 =
|
|
630
|
+
export const mx_perlin_noise_float_1 = /*@__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
409
631
|
|
|
410
632
|
const p = vec3( p_immutable ).toVar();
|
|
411
633
|
const X = int().toVar(), Y = int().toVar(), Z = int().toVar();
|
|
@@ -419,11 +641,17 @@ const mx_perlin_noise_float_1 = tslFn( ( [ p_immutable ] ) => {
|
|
|
419
641
|
|
|
420
642
|
return mx_gradient_scale3d( result );
|
|
421
643
|
|
|
644
|
+
} ).setLayout( {
|
|
645
|
+
name: 'mx_perlin_noise_float_1',
|
|
646
|
+
type: 'float',
|
|
647
|
+
inputs: [
|
|
648
|
+
{ name: 'p', type: 'vec3' }
|
|
649
|
+
]
|
|
422
650
|
} );
|
|
423
651
|
|
|
424
|
-
const mx_perlin_noise_float = overloadingFn( [ mx_perlin_noise_float_0, mx_perlin_noise_float_1 ] );
|
|
652
|
+
export const mx_perlin_noise_float = /*@__PURE__*/ overloadingFn( [ mx_perlin_noise_float_0, mx_perlin_noise_float_1 ] );
|
|
425
653
|
|
|
426
|
-
const mx_perlin_noise_vec3_0 =
|
|
654
|
+
export const mx_perlin_noise_vec3_0 = /*@__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
427
655
|
|
|
428
656
|
const p = vec2( p_immutable ).toVar();
|
|
429
657
|
const X = int().toVar(), Y = int().toVar();
|
|
@@ -435,9 +663,15 @@ const mx_perlin_noise_vec3_0 = tslFn( ( [ p_immutable ] ) => {
|
|
|
435
663
|
|
|
436
664
|
return mx_gradient_scale2d( result );
|
|
437
665
|
|
|
666
|
+
} ).setLayout( {
|
|
667
|
+
name: 'mx_perlin_noise_vec3_0',
|
|
668
|
+
type: 'vec3',
|
|
669
|
+
inputs: [
|
|
670
|
+
{ name: 'p', type: 'vec2' }
|
|
671
|
+
]
|
|
438
672
|
} );
|
|
439
673
|
|
|
440
|
-
const mx_perlin_noise_vec3_1 =
|
|
674
|
+
export const mx_perlin_noise_vec3_1 = /*@__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
441
675
|
|
|
442
676
|
const p = vec3( p_immutable ).toVar();
|
|
443
677
|
const X = int().toVar(), Y = int().toVar(), Z = int().toVar();
|
|
@@ -451,20 +685,32 @@ const mx_perlin_noise_vec3_1 = tslFn( ( [ p_immutable ] ) => {
|
|
|
451
685
|
|
|
452
686
|
return mx_gradient_scale3d( result );
|
|
453
687
|
|
|
688
|
+
} ).setLayout( {
|
|
689
|
+
name: 'mx_perlin_noise_vec3_1',
|
|
690
|
+
type: 'vec3',
|
|
691
|
+
inputs: [
|
|
692
|
+
{ name: 'p', type: 'vec3' }
|
|
693
|
+
]
|
|
454
694
|
} );
|
|
455
695
|
|
|
456
|
-
const mx_perlin_noise_vec3 = overloadingFn( [ mx_perlin_noise_vec3_0, mx_perlin_noise_vec3_1 ] );
|
|
696
|
+
export const mx_perlin_noise_vec3 = /*@__PURE__*/ overloadingFn( [ mx_perlin_noise_vec3_0, mx_perlin_noise_vec3_1 ] );
|
|
457
697
|
|
|
458
|
-
const mx_cell_noise_float_0 =
|
|
698
|
+
export const mx_cell_noise_float_0 = /*@__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
459
699
|
|
|
460
700
|
const p = float( p_immutable ).toVar();
|
|
461
701
|
const ix = int( mx_floor( p ) ).toVar();
|
|
462
702
|
|
|
463
703
|
return mx_bits_to_01( mx_hash_int( ix ) );
|
|
464
704
|
|
|
705
|
+
} ).setLayout( {
|
|
706
|
+
name: 'mx_cell_noise_float_0',
|
|
707
|
+
type: 'float',
|
|
708
|
+
inputs: [
|
|
709
|
+
{ name: 'p', type: 'float' }
|
|
710
|
+
]
|
|
465
711
|
} );
|
|
466
712
|
|
|
467
|
-
const mx_cell_noise_float_1 =
|
|
713
|
+
export const mx_cell_noise_float_1 = /*@__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
468
714
|
|
|
469
715
|
const p = vec2( p_immutable ).toVar();
|
|
470
716
|
const ix = int( mx_floor( p.x ) ).toVar();
|
|
@@ -472,9 +718,15 @@ const mx_cell_noise_float_1 = tslFn( ( [ p_immutable ] ) => {
|
|
|
472
718
|
|
|
473
719
|
return mx_bits_to_01( mx_hash_int( ix, iy ) );
|
|
474
720
|
|
|
721
|
+
} ).setLayout( {
|
|
722
|
+
name: 'mx_cell_noise_float_1',
|
|
723
|
+
type: 'float',
|
|
724
|
+
inputs: [
|
|
725
|
+
{ name: 'p', type: 'vec2' }
|
|
726
|
+
]
|
|
475
727
|
} );
|
|
476
728
|
|
|
477
|
-
const mx_cell_noise_float_2 =
|
|
729
|
+
export const mx_cell_noise_float_2 = /*@__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
478
730
|
|
|
479
731
|
const p = vec3( p_immutable ).toVar();
|
|
480
732
|
const ix = int( mx_floor( p.x ) ).toVar();
|
|
@@ -483,9 +735,15 @@ const mx_cell_noise_float_2 = tslFn( ( [ p_immutable ] ) => {
|
|
|
483
735
|
|
|
484
736
|
return mx_bits_to_01( mx_hash_int( ix, iy, iz ) );
|
|
485
737
|
|
|
738
|
+
} ).setLayout( {
|
|
739
|
+
name: 'mx_cell_noise_float_2',
|
|
740
|
+
type: 'float',
|
|
741
|
+
inputs: [
|
|
742
|
+
{ name: 'p', type: 'vec3' }
|
|
743
|
+
]
|
|
486
744
|
} );
|
|
487
745
|
|
|
488
|
-
const mx_cell_noise_float_3 =
|
|
746
|
+
export const mx_cell_noise_float_3 = /*@__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
489
747
|
|
|
490
748
|
const p = vec4( p_immutable ).toVar();
|
|
491
749
|
const ix = int( mx_floor( p.x ) ).toVar();
|
|
@@ -495,20 +753,32 @@ const mx_cell_noise_float_3 = tslFn( ( [ p_immutable ] ) => {
|
|
|
495
753
|
|
|
496
754
|
return mx_bits_to_01( mx_hash_int( ix, iy, iz, iw ) );
|
|
497
755
|
|
|
756
|
+
} ).setLayout( {
|
|
757
|
+
name: 'mx_cell_noise_float_3',
|
|
758
|
+
type: 'float',
|
|
759
|
+
inputs: [
|
|
760
|
+
{ name: 'p', type: 'vec4' }
|
|
761
|
+
]
|
|
498
762
|
} );
|
|
499
763
|
|
|
500
|
-
const mx_cell_noise_float = overloadingFn( [ mx_cell_noise_float_0, mx_cell_noise_float_1, mx_cell_noise_float_2, mx_cell_noise_float_3 ] );
|
|
764
|
+
export const mx_cell_noise_float = /*@__PURE__*/ overloadingFn( [ mx_cell_noise_float_0, mx_cell_noise_float_1, mx_cell_noise_float_2, mx_cell_noise_float_3 ] );
|
|
501
765
|
|
|
502
|
-
const mx_cell_noise_vec3_0 =
|
|
766
|
+
export const mx_cell_noise_vec3_0 = /*@__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
503
767
|
|
|
504
768
|
const p = float( p_immutable ).toVar();
|
|
505
769
|
const ix = int( mx_floor( p ) ).toVar();
|
|
506
770
|
|
|
507
771
|
return vec3( mx_bits_to_01( mx_hash_int( ix, int( 0 ) ) ), mx_bits_to_01( mx_hash_int( ix, int( 1 ) ) ), mx_bits_to_01( mx_hash_int( ix, int( 2 ) ) ) );
|
|
508
772
|
|
|
773
|
+
} ).setLayout( {
|
|
774
|
+
name: 'mx_cell_noise_vec3_0',
|
|
775
|
+
type: 'vec3',
|
|
776
|
+
inputs: [
|
|
777
|
+
{ name: 'p', type: 'float' }
|
|
778
|
+
]
|
|
509
779
|
} );
|
|
510
780
|
|
|
511
|
-
const mx_cell_noise_vec3_1 =
|
|
781
|
+
export const mx_cell_noise_vec3_1 = /*@__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
512
782
|
|
|
513
783
|
const p = vec2( p_immutable ).toVar();
|
|
514
784
|
const ix = int( mx_floor( p.x ) ).toVar();
|
|
@@ -516,9 +786,15 @@ const mx_cell_noise_vec3_1 = tslFn( ( [ p_immutable ] ) => {
|
|
|
516
786
|
|
|
517
787
|
return vec3( mx_bits_to_01( mx_hash_int( ix, iy, int( 0 ) ) ), mx_bits_to_01( mx_hash_int( ix, iy, int( 1 ) ) ), mx_bits_to_01( mx_hash_int( ix, iy, int( 2 ) ) ) );
|
|
518
788
|
|
|
789
|
+
} ).setLayout( {
|
|
790
|
+
name: 'mx_cell_noise_vec3_1',
|
|
791
|
+
type: 'vec3',
|
|
792
|
+
inputs: [
|
|
793
|
+
{ name: 'p', type: 'vec2' }
|
|
794
|
+
]
|
|
519
795
|
} );
|
|
520
796
|
|
|
521
|
-
const mx_cell_noise_vec3_2 =
|
|
797
|
+
export const mx_cell_noise_vec3_2 = /*@__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
522
798
|
|
|
523
799
|
const p = vec3( p_immutable ).toVar();
|
|
524
800
|
const ix = int( mx_floor( p.x ) ).toVar();
|
|
@@ -527,9 +803,15 @@ const mx_cell_noise_vec3_2 = tslFn( ( [ p_immutable ] ) => {
|
|
|
527
803
|
|
|
528
804
|
return vec3( mx_bits_to_01( mx_hash_int( ix, iy, iz, int( 0 ) ) ), mx_bits_to_01( mx_hash_int( ix, iy, iz, int( 1 ) ) ), mx_bits_to_01( mx_hash_int( ix, iy, iz, int( 2 ) ) ) );
|
|
529
805
|
|
|
806
|
+
} ).setLayout( {
|
|
807
|
+
name: 'mx_cell_noise_vec3_2',
|
|
808
|
+
type: 'vec3',
|
|
809
|
+
inputs: [
|
|
810
|
+
{ name: 'p', type: 'vec3' }
|
|
811
|
+
]
|
|
530
812
|
} );
|
|
531
813
|
|
|
532
|
-
const mx_cell_noise_vec3_3 =
|
|
814
|
+
export const mx_cell_noise_vec3_3 = /*@__PURE__*/ Fn( ( [ p_immutable ] ) => {
|
|
533
815
|
|
|
534
816
|
const p = vec4( p_immutable ).toVar();
|
|
535
817
|
const ix = int( mx_floor( p.x ) ).toVar();
|
|
@@ -539,11 +821,17 @@ const mx_cell_noise_vec3_3 = tslFn( ( [ p_immutable ] ) => {
|
|
|
539
821
|
|
|
540
822
|
return vec3( mx_bits_to_01( mx_hash_int( ix, iy, iz, iw, int( 0 ) ) ), mx_bits_to_01( mx_hash_int( ix, iy, iz, iw, int( 1 ) ) ), mx_bits_to_01( mx_hash_int( ix, iy, iz, iw, int( 2 ) ) ) );
|
|
541
823
|
|
|
824
|
+
} ).setLayout( {
|
|
825
|
+
name: 'mx_cell_noise_vec3_3',
|
|
826
|
+
type: 'vec3',
|
|
827
|
+
inputs: [
|
|
828
|
+
{ name: 'p', type: 'vec4' }
|
|
829
|
+
]
|
|
542
830
|
} );
|
|
543
831
|
|
|
544
|
-
const mx_cell_noise_vec3 = overloadingFn( [ mx_cell_noise_vec3_0, mx_cell_noise_vec3_1, mx_cell_noise_vec3_2, mx_cell_noise_vec3_3 ] );
|
|
832
|
+
export const mx_cell_noise_vec3 = /*@__PURE__*/ overloadingFn( [ mx_cell_noise_vec3_0, mx_cell_noise_vec3_1, mx_cell_noise_vec3_2, mx_cell_noise_vec3_3 ] );
|
|
545
833
|
|
|
546
|
-
const mx_fractal_noise_float =
|
|
834
|
+
export const mx_fractal_noise_float = /*@__PURE__*/ Fn( ( [ p_immutable, octaves_immutable, lacunarity_immutable, diminish_immutable ] ) => {
|
|
547
835
|
|
|
548
836
|
const diminish = float( diminish_immutable ).toVar();
|
|
549
837
|
const lacunarity = float( lacunarity_immutable ).toVar();
|
|
@@ -552,7 +840,7 @@ const mx_fractal_noise_float = tslFn( ( [ p_immutable, octaves_immutable, lacuna
|
|
|
552
840
|
const result = float( 0.0 ).toVar();
|
|
553
841
|
const amplitude = float( 1.0 ).toVar();
|
|
554
842
|
|
|
555
|
-
|
|
843
|
+
Loop( octaves, () => {
|
|
556
844
|
|
|
557
845
|
result.addAssign( amplitude.mul( mx_perlin_noise_float( p ) ) );
|
|
558
846
|
amplitude.mulAssign( diminish );
|
|
@@ -562,18 +850,27 @@ const mx_fractal_noise_float = tslFn( ( [ p_immutable, octaves_immutable, lacuna
|
|
|
562
850
|
|
|
563
851
|
return result;
|
|
564
852
|
|
|
565
|
-
} )
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
853
|
+
} ).setLayout( {
|
|
854
|
+
name: 'mx_fractal_noise_float',
|
|
855
|
+
type: 'float',
|
|
856
|
+
inputs: [
|
|
857
|
+
{ name: 'p', type: 'vec3' },
|
|
858
|
+
{ name: 'octaves', type: 'int' },
|
|
859
|
+
{ name: 'lacunarity', type: 'float' },
|
|
860
|
+
{ name: 'diminish', type: 'float' }
|
|
861
|
+
]
|
|
862
|
+
} );
|
|
863
|
+
|
|
864
|
+
export const mx_fractal_noise_vec3 = /*@__PURE__*/ Fn( ( [ p_immutable, octaves_immutable, lacunarity_immutable, diminish_immutable ] ) => {
|
|
865
|
+
|
|
866
|
+
const diminish = float( diminish_immutable ).toVar();
|
|
867
|
+
const lacunarity = float( lacunarity_immutable ).toVar();
|
|
868
|
+
const octaves = int( octaves_immutable ).toVar();
|
|
572
869
|
const p = vec3( p_immutable ).toVar();
|
|
573
870
|
const result = vec3( 0.0 ).toVar();
|
|
574
871
|
const amplitude = float( 1.0 ).toVar();
|
|
575
872
|
|
|
576
|
-
|
|
873
|
+
Loop( octaves, () => {
|
|
577
874
|
|
|
578
875
|
result.addAssign( amplitude.mul( mx_perlin_noise_vec3( p ) ) );
|
|
579
876
|
amplitude.mulAssign( diminish );
|
|
@@ -583,9 +880,18 @@ const mx_fractal_noise_vec3 = tslFn( ( [ p_immutable, octaves_immutable, lacunar
|
|
|
583
880
|
|
|
584
881
|
return result;
|
|
585
882
|
|
|
883
|
+
} ).setLayout( {
|
|
884
|
+
name: 'mx_fractal_noise_vec3',
|
|
885
|
+
type: 'vec3',
|
|
886
|
+
inputs: [
|
|
887
|
+
{ name: 'p', type: 'vec3' },
|
|
888
|
+
{ name: 'octaves', type: 'int' },
|
|
889
|
+
{ name: 'lacunarity', type: 'float' },
|
|
890
|
+
{ name: 'diminish', type: 'float' }
|
|
891
|
+
]
|
|
586
892
|
} );
|
|
587
893
|
|
|
588
|
-
const mx_fractal_noise_vec2 =
|
|
894
|
+
export const mx_fractal_noise_vec2 = /*@__PURE__*/ Fn( ( [ p_immutable, octaves_immutable, lacunarity_immutable, diminish_immutable ] ) => {
|
|
589
895
|
|
|
590
896
|
const diminish = float( diminish_immutable ).toVar();
|
|
591
897
|
const lacunarity = float( lacunarity_immutable ).toVar();
|
|
@@ -594,9 +900,18 @@ const mx_fractal_noise_vec2 = tslFn( ( [ p_immutable, octaves_immutable, lacunar
|
|
|
594
900
|
|
|
595
901
|
return vec2( mx_fractal_noise_float( p, octaves, lacunarity, diminish ), mx_fractal_noise_float( p.add( vec3( int( 19 ), int( 193 ), int( 17 ) ) ), octaves, lacunarity, diminish ) );
|
|
596
902
|
|
|
903
|
+
} ).setLayout( {
|
|
904
|
+
name: 'mx_fractal_noise_vec2',
|
|
905
|
+
type: 'vec2',
|
|
906
|
+
inputs: [
|
|
907
|
+
{ name: 'p', type: 'vec3' },
|
|
908
|
+
{ name: 'octaves', type: 'int' },
|
|
909
|
+
{ name: 'lacunarity', type: 'float' },
|
|
910
|
+
{ name: 'diminish', type: 'float' }
|
|
911
|
+
]
|
|
597
912
|
} );
|
|
598
913
|
|
|
599
|
-
const mx_fractal_noise_vec4 =
|
|
914
|
+
export const mx_fractal_noise_vec4 = /*@__PURE__*/ Fn( ( [ p_immutable, octaves_immutable, lacunarity_immutable, diminish_immutable ] ) => {
|
|
600
915
|
|
|
601
916
|
const diminish = float( diminish_immutable ).toVar();
|
|
602
917
|
const lacunarity = float( lacunarity_immutable ).toVar();
|
|
@@ -607,9 +922,18 @@ const mx_fractal_noise_vec4 = tslFn( ( [ p_immutable, octaves_immutable, lacunar
|
|
|
607
922
|
|
|
608
923
|
return vec4( c, f );
|
|
609
924
|
|
|
925
|
+
} ).setLayout( {
|
|
926
|
+
name: 'mx_fractal_noise_vec4',
|
|
927
|
+
type: 'vec4',
|
|
928
|
+
inputs: [
|
|
929
|
+
{ name: 'p', type: 'vec3' },
|
|
930
|
+
{ name: 'octaves', type: 'int' },
|
|
931
|
+
{ name: 'lacunarity', type: 'float' },
|
|
932
|
+
{ name: 'diminish', type: 'float' }
|
|
933
|
+
]
|
|
610
934
|
} );
|
|
611
935
|
|
|
612
|
-
const mx_worley_distance_0 =
|
|
936
|
+
export const mx_worley_distance_0 = /*@__PURE__*/ Fn( ( [ p_immutable, x_immutable, y_immutable, xoff_immutable, yoff_immutable, jitter_immutable, metric_immutable ] ) => {
|
|
613
937
|
|
|
614
938
|
const metric = int( metric_immutable ).toVar();
|
|
615
939
|
const jitter = float( jitter_immutable ).toVar();
|
|
@@ -640,9 +964,21 @@ const mx_worley_distance_0 = tslFn( ( [ p_immutable, x_immutable, y_immutable, x
|
|
|
640
964
|
|
|
641
965
|
return dot( diff, diff );
|
|
642
966
|
|
|
967
|
+
} ).setLayout( {
|
|
968
|
+
name: 'mx_worley_distance_0',
|
|
969
|
+
type: 'float',
|
|
970
|
+
inputs: [
|
|
971
|
+
{ name: 'p', type: 'vec2' },
|
|
972
|
+
{ name: 'x', type: 'int' },
|
|
973
|
+
{ name: 'y', type: 'int' },
|
|
974
|
+
{ name: 'xoff', type: 'int' },
|
|
975
|
+
{ name: 'yoff', type: 'int' },
|
|
976
|
+
{ name: 'jitter', type: 'float' },
|
|
977
|
+
{ name: 'metric', type: 'int' }
|
|
978
|
+
]
|
|
643
979
|
} );
|
|
644
980
|
|
|
645
|
-
const mx_worley_distance_1 =
|
|
981
|
+
export const mx_worley_distance_1 = /*@__PURE__*/ Fn( ( [ p_immutable, x_immutable, y_immutable, z_immutable, xoff_immutable, yoff_immutable, zoff_immutable, jitter_immutable, metric_immutable ] ) => {
|
|
646
982
|
|
|
647
983
|
const metric = int( metric_immutable ).toVar();
|
|
648
984
|
const jitter = float( jitter_immutable ).toVar();
|
|
@@ -662,7 +998,7 @@ const mx_worley_distance_1 = tslFn( ( [ p_immutable, x_immutable, y_immutable, z
|
|
|
662
998
|
|
|
663
999
|
If( metric.equal( int( 2 ) ), () => {
|
|
664
1000
|
|
|
665
|
-
return abs( diff.x ).add( abs( diff.y ).add( abs( diff.z ) )
|
|
1001
|
+
return abs( diff.x ).add( abs( diff.y ) ).add( abs( diff.z ) );
|
|
666
1002
|
|
|
667
1003
|
} );
|
|
668
1004
|
|
|
@@ -674,11 +1010,25 @@ const mx_worley_distance_1 = tslFn( ( [ p_immutable, x_immutable, y_immutable, z
|
|
|
674
1010
|
|
|
675
1011
|
return dot( diff, diff );
|
|
676
1012
|
|
|
1013
|
+
} ).setLayout( {
|
|
1014
|
+
name: 'mx_worley_distance_1',
|
|
1015
|
+
type: 'float',
|
|
1016
|
+
inputs: [
|
|
1017
|
+
{ name: 'p', type: 'vec3' },
|
|
1018
|
+
{ name: 'x', type: 'int' },
|
|
1019
|
+
{ name: 'y', type: 'int' },
|
|
1020
|
+
{ name: 'z', type: 'int' },
|
|
1021
|
+
{ name: 'xoff', type: 'int' },
|
|
1022
|
+
{ name: 'yoff', type: 'int' },
|
|
1023
|
+
{ name: 'zoff', type: 'int' },
|
|
1024
|
+
{ name: 'jitter', type: 'float' },
|
|
1025
|
+
{ name: 'metric', type: 'int' }
|
|
1026
|
+
]
|
|
677
1027
|
} );
|
|
678
1028
|
|
|
679
|
-
const mx_worley_distance = overloadingFn( [ mx_worley_distance_0, mx_worley_distance_1 ] );
|
|
1029
|
+
export const mx_worley_distance = /*@__PURE__*/ overloadingFn( [ mx_worley_distance_0, mx_worley_distance_1 ] );
|
|
680
1030
|
|
|
681
|
-
const mx_worley_noise_float_0 =
|
|
1031
|
+
export const mx_worley_noise_float_0 = /*@__PURE__*/ Fn( ( [ p_immutable, jitter_immutable, metric_immutable ] ) => {
|
|
682
1032
|
|
|
683
1033
|
const metric = int( metric_immutable ).toVar();
|
|
684
1034
|
const jitter = float( jitter_immutable ).toVar();
|
|
@@ -687,9 +1037,9 @@ const mx_worley_noise_float_0 = tslFn( ( [ p_immutable, jitter_immutable, metric
|
|
|
687
1037
|
const localpos = vec2( mx_floorfrac( p.x, X ), mx_floorfrac( p.y, Y ) ).toVar();
|
|
688
1038
|
const sqdist = float( 1e6 ).toVar();
|
|
689
1039
|
|
|
690
|
-
|
|
1040
|
+
Loop( { start: - 1, end: int( 1 ), name: 'x', condition: '<=' }, ( { x } ) => {
|
|
691
1041
|
|
|
692
|
-
|
|
1042
|
+
Loop( { start: - 1, end: int( 1 ), name: 'y', condition: '<=' }, ( { y } ) => {
|
|
693
1043
|
|
|
694
1044
|
const dist = float( mx_worley_distance( localpos, x, y, X, Y, jitter, metric ) ).toVar();
|
|
695
1045
|
sqdist.assign( min( sqdist, dist ) );
|
|
@@ -706,9 +1056,17 @@ const mx_worley_noise_float_0 = tslFn( ( [ p_immutable, jitter_immutable, metric
|
|
|
706
1056
|
|
|
707
1057
|
return sqdist;
|
|
708
1058
|
|
|
1059
|
+
} ).setLayout( {
|
|
1060
|
+
name: 'mx_worley_noise_float_0',
|
|
1061
|
+
type: 'float',
|
|
1062
|
+
inputs: [
|
|
1063
|
+
{ name: 'p', type: 'vec2' },
|
|
1064
|
+
{ name: 'jitter', type: 'float' },
|
|
1065
|
+
{ name: 'metric', type: 'int' }
|
|
1066
|
+
]
|
|
709
1067
|
} );
|
|
710
1068
|
|
|
711
|
-
const mx_worley_noise_vec2_0 =
|
|
1069
|
+
export const mx_worley_noise_vec2_0 = /*@__PURE__*/ Fn( ( [ p_immutable, jitter_immutable, metric_immutable ] ) => {
|
|
712
1070
|
|
|
713
1071
|
const metric = int( metric_immutable ).toVar();
|
|
714
1072
|
const jitter = float( jitter_immutable ).toVar();
|
|
@@ -717,9 +1075,9 @@ const mx_worley_noise_vec2_0 = tslFn( ( [ p_immutable, jitter_immutable, metric_
|
|
|
717
1075
|
const localpos = vec2( mx_floorfrac( p.x, X ), mx_floorfrac( p.y, Y ) ).toVar();
|
|
718
1076
|
const sqdist = vec2( 1e6, 1e6 ).toVar();
|
|
719
1077
|
|
|
720
|
-
|
|
1078
|
+
Loop( { start: - 1, end: int( 1 ), name: 'x', condition: '<=' }, ( { x } ) => {
|
|
721
1079
|
|
|
722
|
-
|
|
1080
|
+
Loop( { start: - 1, end: int( 1 ), name: 'y', condition: '<=' }, ( { y } ) => {
|
|
723
1081
|
|
|
724
1082
|
const dist = float( mx_worley_distance( localpos, x, y, X, Y, jitter, metric ) ).toVar();
|
|
725
1083
|
|
|
@@ -728,7 +1086,7 @@ const mx_worley_noise_vec2_0 = tslFn( ( [ p_immutable, jitter_immutable, metric_
|
|
|
728
1086
|
sqdist.y.assign( sqdist.x );
|
|
729
1087
|
sqdist.x.assign( dist );
|
|
730
1088
|
|
|
731
|
-
} ).
|
|
1089
|
+
} ).ElseIf( dist.lessThan( sqdist.y ), () => {
|
|
732
1090
|
|
|
733
1091
|
sqdist.y.assign( dist );
|
|
734
1092
|
|
|
@@ -746,9 +1104,17 @@ const mx_worley_noise_vec2_0 = tslFn( ( [ p_immutable, jitter_immutable, metric_
|
|
|
746
1104
|
|
|
747
1105
|
return sqdist;
|
|
748
1106
|
|
|
1107
|
+
} ).setLayout( {
|
|
1108
|
+
name: 'mx_worley_noise_vec2_0',
|
|
1109
|
+
type: 'vec2',
|
|
1110
|
+
inputs: [
|
|
1111
|
+
{ name: 'p', type: 'vec2' },
|
|
1112
|
+
{ name: 'jitter', type: 'float' },
|
|
1113
|
+
{ name: 'metric', type: 'int' }
|
|
1114
|
+
]
|
|
749
1115
|
} );
|
|
750
1116
|
|
|
751
|
-
const mx_worley_noise_vec3_0 =
|
|
1117
|
+
export const mx_worley_noise_vec3_0 = /*@__PURE__*/ Fn( ( [ p_immutable, jitter_immutable, metric_immutable ] ) => {
|
|
752
1118
|
|
|
753
1119
|
const metric = int( metric_immutable ).toVar();
|
|
754
1120
|
const jitter = float( jitter_immutable ).toVar();
|
|
@@ -757,9 +1123,9 @@ const mx_worley_noise_vec3_0 = tslFn( ( [ p_immutable, jitter_immutable, metric_
|
|
|
757
1123
|
const localpos = vec2( mx_floorfrac( p.x, X ), mx_floorfrac( p.y, Y ) ).toVar();
|
|
758
1124
|
const sqdist = vec3( 1e6, 1e6, 1e6 ).toVar();
|
|
759
1125
|
|
|
760
|
-
|
|
1126
|
+
Loop( { start: - 1, end: int( 1 ), name: 'x', condition: '<=' }, ( { x } ) => {
|
|
761
1127
|
|
|
762
|
-
|
|
1128
|
+
Loop( { start: - 1, end: int( 1 ), name: 'y', condition: '<=' }, ( { y } ) => {
|
|
763
1129
|
|
|
764
1130
|
const dist = float( mx_worley_distance( localpos, x, y, X, Y, jitter, metric ) ).toVar();
|
|
765
1131
|
|
|
@@ -769,12 +1135,12 @@ const mx_worley_noise_vec3_0 = tslFn( ( [ p_immutable, jitter_immutable, metric_
|
|
|
769
1135
|
sqdist.y.assign( sqdist.x );
|
|
770
1136
|
sqdist.x.assign( dist );
|
|
771
1137
|
|
|
772
|
-
} ).
|
|
1138
|
+
} ).ElseIf( dist.lessThan( sqdist.y ), () => {
|
|
773
1139
|
|
|
774
1140
|
sqdist.z.assign( sqdist.y );
|
|
775
1141
|
sqdist.y.assign( dist );
|
|
776
1142
|
|
|
777
|
-
} ).
|
|
1143
|
+
} ).ElseIf( dist.lessThan( sqdist.z ), () => {
|
|
778
1144
|
|
|
779
1145
|
sqdist.z.assign( dist );
|
|
780
1146
|
|
|
@@ -792,9 +1158,17 @@ const mx_worley_noise_vec3_0 = tslFn( ( [ p_immutable, jitter_immutable, metric_
|
|
|
792
1158
|
|
|
793
1159
|
return sqdist;
|
|
794
1160
|
|
|
1161
|
+
} ).setLayout( {
|
|
1162
|
+
name: 'mx_worley_noise_vec3_0',
|
|
1163
|
+
type: 'vec3',
|
|
1164
|
+
inputs: [
|
|
1165
|
+
{ name: 'p', type: 'vec2' },
|
|
1166
|
+
{ name: 'jitter', type: 'float' },
|
|
1167
|
+
{ name: 'metric', type: 'int' }
|
|
1168
|
+
]
|
|
795
1169
|
} );
|
|
796
1170
|
|
|
797
|
-
const mx_worley_noise_float_1 =
|
|
1171
|
+
export const mx_worley_noise_float_1 = /*@__PURE__*/ Fn( ( [ p_immutable, jitter_immutable, metric_immutable ] ) => {
|
|
798
1172
|
|
|
799
1173
|
const metric = int( metric_immutable ).toVar();
|
|
800
1174
|
const jitter = float( jitter_immutable ).toVar();
|
|
@@ -803,11 +1177,11 @@ const mx_worley_noise_float_1 = tslFn( ( [ p_immutable, jitter_immutable, metric
|
|
|
803
1177
|
const localpos = vec3( mx_floorfrac( p.x, X ), mx_floorfrac( p.y, Y ), mx_floorfrac( p.z, Z ) ).toVar();
|
|
804
1178
|
const sqdist = float( 1e6 ).toVar();
|
|
805
1179
|
|
|
806
|
-
|
|
1180
|
+
Loop( { start: - 1, end: int( 1 ), name: 'x', condition: '<=' }, ( { x } ) => {
|
|
807
1181
|
|
|
808
|
-
|
|
1182
|
+
Loop( { start: - 1, end: int( 1 ), name: 'y', condition: '<=' }, ( { y } ) => {
|
|
809
1183
|
|
|
810
|
-
|
|
1184
|
+
Loop( { start: - 1, end: int( 1 ), name: 'z', condition: '<=' }, ( { z } ) => {
|
|
811
1185
|
|
|
812
1186
|
const dist = float( mx_worley_distance( localpos, x, y, z, X, Y, Z, jitter, metric ) ).toVar();
|
|
813
1187
|
sqdist.assign( min( sqdist, dist ) );
|
|
@@ -826,11 +1200,19 @@ const mx_worley_noise_float_1 = tslFn( ( [ p_immutable, jitter_immutable, metric
|
|
|
826
1200
|
|
|
827
1201
|
return sqdist;
|
|
828
1202
|
|
|
1203
|
+
} ).setLayout( {
|
|
1204
|
+
name: 'mx_worley_noise_float_1',
|
|
1205
|
+
type: 'float',
|
|
1206
|
+
inputs: [
|
|
1207
|
+
{ name: 'p', type: 'vec3' },
|
|
1208
|
+
{ name: 'jitter', type: 'float' },
|
|
1209
|
+
{ name: 'metric', type: 'int' }
|
|
1210
|
+
]
|
|
829
1211
|
} );
|
|
830
1212
|
|
|
831
|
-
const mx_worley_noise_float = overloadingFn( [ mx_worley_noise_float_0, mx_worley_noise_float_1 ] );
|
|
1213
|
+
export const mx_worley_noise_float = /*@__PURE__*/ overloadingFn( [ mx_worley_noise_float_0, mx_worley_noise_float_1 ] );
|
|
832
1214
|
|
|
833
|
-
const mx_worley_noise_vec2_1 =
|
|
1215
|
+
export const mx_worley_noise_vec2_1 = /*@__PURE__*/ Fn( ( [ p_immutable, jitter_immutable, metric_immutable ] ) => {
|
|
834
1216
|
|
|
835
1217
|
const metric = int( metric_immutable ).toVar();
|
|
836
1218
|
const jitter = float( jitter_immutable ).toVar();
|
|
@@ -839,11 +1221,11 @@ const mx_worley_noise_vec2_1 = tslFn( ( [ p_immutable, jitter_immutable, metric_
|
|
|
839
1221
|
const localpos = vec3( mx_floorfrac( p.x, X ), mx_floorfrac( p.y, Y ), mx_floorfrac( p.z, Z ) ).toVar();
|
|
840
1222
|
const sqdist = vec2( 1e6, 1e6 ).toVar();
|
|
841
1223
|
|
|
842
|
-
|
|
1224
|
+
Loop( { start: - 1, end: int( 1 ), name: 'x', condition: '<=' }, ( { x } ) => {
|
|
843
1225
|
|
|
844
|
-
|
|
1226
|
+
Loop( { start: - 1, end: int( 1 ), name: 'y', condition: '<=' }, ( { y } ) => {
|
|
845
1227
|
|
|
846
|
-
|
|
1228
|
+
Loop( { start: - 1, end: int( 1 ), name: 'z', condition: '<=' }, ( { z } ) => {
|
|
847
1229
|
|
|
848
1230
|
const dist = float( mx_worley_distance( localpos, x, y, z, X, Y, Z, jitter, metric ) ).toVar();
|
|
849
1231
|
|
|
@@ -852,7 +1234,7 @@ const mx_worley_noise_vec2_1 = tslFn( ( [ p_immutable, jitter_immutable, metric_
|
|
|
852
1234
|
sqdist.y.assign( sqdist.x );
|
|
853
1235
|
sqdist.x.assign( dist );
|
|
854
1236
|
|
|
855
|
-
} ).
|
|
1237
|
+
} ).ElseIf( dist.lessThan( sqdist.y ), () => {
|
|
856
1238
|
|
|
857
1239
|
sqdist.y.assign( dist );
|
|
858
1240
|
|
|
@@ -872,11 +1254,19 @@ const mx_worley_noise_vec2_1 = tslFn( ( [ p_immutable, jitter_immutable, metric_
|
|
|
872
1254
|
|
|
873
1255
|
return sqdist;
|
|
874
1256
|
|
|
1257
|
+
} ).setLayout( {
|
|
1258
|
+
name: 'mx_worley_noise_vec2_1',
|
|
1259
|
+
type: 'vec2',
|
|
1260
|
+
inputs: [
|
|
1261
|
+
{ name: 'p', type: 'vec3' },
|
|
1262
|
+
{ name: 'jitter', type: 'float' },
|
|
1263
|
+
{ name: 'metric', type: 'int' }
|
|
1264
|
+
]
|
|
875
1265
|
} );
|
|
876
1266
|
|
|
877
|
-
const mx_worley_noise_vec2 = overloadingFn( [ mx_worley_noise_vec2_0, mx_worley_noise_vec2_1 ] );
|
|
1267
|
+
export const mx_worley_noise_vec2 = /*@__PURE__*/ overloadingFn( [ mx_worley_noise_vec2_0, mx_worley_noise_vec2_1 ] );
|
|
878
1268
|
|
|
879
|
-
const mx_worley_noise_vec3_1 =
|
|
1269
|
+
export const mx_worley_noise_vec3_1 = /*@__PURE__*/ Fn( ( [ p_immutable, jitter_immutable, metric_immutable ] ) => {
|
|
880
1270
|
|
|
881
1271
|
const metric = int( metric_immutable ).toVar();
|
|
882
1272
|
const jitter = float( jitter_immutable ).toVar();
|
|
@@ -885,11 +1275,11 @@ const mx_worley_noise_vec3_1 = tslFn( ( [ p_immutable, jitter_immutable, metric_
|
|
|
885
1275
|
const localpos = vec3( mx_floorfrac( p.x, X ), mx_floorfrac( p.y, Y ), mx_floorfrac( p.z, Z ) ).toVar();
|
|
886
1276
|
const sqdist = vec3( 1e6, 1e6, 1e6 ).toVar();
|
|
887
1277
|
|
|
888
|
-
|
|
1278
|
+
Loop( { start: - 1, end: int( 1 ), name: 'x', condition: '<=' }, ( { x } ) => {
|
|
889
1279
|
|
|
890
|
-
|
|
1280
|
+
Loop( { start: - 1, end: int( 1 ), name: 'y', condition: '<=' }, ( { y } ) => {
|
|
891
1281
|
|
|
892
|
-
|
|
1282
|
+
Loop( { start: - 1, end: int( 1 ), name: 'z', condition: '<=' }, ( { z } ) => {
|
|
893
1283
|
|
|
894
1284
|
const dist = float( mx_worley_distance( localpos, x, y, z, X, Y, Z, jitter, metric ) ).toVar();
|
|
895
1285
|
|
|
@@ -899,12 +1289,12 @@ const mx_worley_noise_vec3_1 = tslFn( ( [ p_immutable, jitter_immutable, metric_
|
|
|
899
1289
|
sqdist.y.assign( sqdist.x );
|
|
900
1290
|
sqdist.x.assign( dist );
|
|
901
1291
|
|
|
902
|
-
} ).
|
|
1292
|
+
} ).ElseIf( dist.lessThan( sqdist.y ), () => {
|
|
903
1293
|
|
|
904
1294
|
sqdist.z.assign( sqdist.y );
|
|
905
1295
|
sqdist.y.assign( dist );
|
|
906
1296
|
|
|
907
|
-
} ).
|
|
1297
|
+
} ).ElseIf( dist.lessThan( sqdist.z ), () => {
|
|
908
1298
|
|
|
909
1299
|
sqdist.z.assign( dist );
|
|
910
1300
|
|
|
@@ -924,500 +1314,7 @@ const mx_worley_noise_vec3_1 = tslFn( ( [ p_immutable, jitter_immutable, metric_
|
|
|
924
1314
|
|
|
925
1315
|
return sqdist;
|
|
926
1316
|
|
|
927
|
-
} )
|
|
928
|
-
|
|
929
|
-
const mx_worley_noise_vec3 = overloadingFn( [ mx_worley_noise_vec3_0, mx_worley_noise_vec3_1 ] );
|
|
930
|
-
|
|
931
|
-
// layouts
|
|
932
|
-
|
|
933
|
-
mx_select.setLayout( {
|
|
934
|
-
name: 'mx_select',
|
|
935
|
-
type: 'float',
|
|
936
|
-
inputs: [
|
|
937
|
-
{ name: 'b', type: 'bool' },
|
|
938
|
-
{ name: 't', type: 'float' },
|
|
939
|
-
{ name: 'f', type: 'float' }
|
|
940
|
-
]
|
|
941
|
-
} );
|
|
942
|
-
|
|
943
|
-
mx_negate_if.setLayout( {
|
|
944
|
-
name: 'mx_negate_if',
|
|
945
|
-
type: 'float',
|
|
946
|
-
inputs: [
|
|
947
|
-
{ name: 'val', type: 'float' },
|
|
948
|
-
{ name: 'b', type: 'bool' }
|
|
949
|
-
]
|
|
950
|
-
} );
|
|
951
|
-
|
|
952
|
-
mx_floor.setLayout( {
|
|
953
|
-
name: 'mx_floor',
|
|
954
|
-
type: 'int',
|
|
955
|
-
inputs: [
|
|
956
|
-
{ name: 'x', type: 'float' }
|
|
957
|
-
]
|
|
958
|
-
} );
|
|
959
|
-
|
|
960
|
-
mx_bilerp_0.setLayout( {
|
|
961
|
-
name: 'mx_bilerp_0',
|
|
962
|
-
type: 'float',
|
|
963
|
-
inputs: [
|
|
964
|
-
{ name: 'v0', type: 'float' },
|
|
965
|
-
{ name: 'v1', type: 'float' },
|
|
966
|
-
{ name: 'v2', type: 'float' },
|
|
967
|
-
{ name: 'v3', type: 'float' },
|
|
968
|
-
{ name: 's', type: 'float' },
|
|
969
|
-
{ name: 't', type: 'float' }
|
|
970
|
-
]
|
|
971
|
-
} );
|
|
972
|
-
|
|
973
|
-
mx_bilerp_1.setLayout( {
|
|
974
|
-
name: 'mx_bilerp_1',
|
|
975
|
-
type: 'vec3',
|
|
976
|
-
inputs: [
|
|
977
|
-
{ name: 'v0', type: 'vec3' },
|
|
978
|
-
{ name: 'v1', type: 'vec3' },
|
|
979
|
-
{ name: 'v2', type: 'vec3' },
|
|
980
|
-
{ name: 'v3', type: 'vec3' },
|
|
981
|
-
{ name: 's', type: 'float' },
|
|
982
|
-
{ name: 't', type: 'float' }
|
|
983
|
-
]
|
|
984
|
-
} );
|
|
985
|
-
|
|
986
|
-
mx_trilerp_0.setLayout( {
|
|
987
|
-
name: 'mx_trilerp_0',
|
|
988
|
-
type: 'float',
|
|
989
|
-
inputs: [
|
|
990
|
-
{ name: 'v0', type: 'float' },
|
|
991
|
-
{ name: 'v1', type: 'float' },
|
|
992
|
-
{ name: 'v2', type: 'float' },
|
|
993
|
-
{ name: 'v3', type: 'float' },
|
|
994
|
-
{ name: 'v4', type: 'float' },
|
|
995
|
-
{ name: 'v5', type: 'float' },
|
|
996
|
-
{ name: 'v6', type: 'float' },
|
|
997
|
-
{ name: 'v7', type: 'float' },
|
|
998
|
-
{ name: 's', type: 'float' },
|
|
999
|
-
{ name: 't', type: 'float' },
|
|
1000
|
-
{ name: 'r', type: 'float' }
|
|
1001
|
-
]
|
|
1002
|
-
} );
|
|
1003
|
-
|
|
1004
|
-
mx_trilerp_1.setLayout( {
|
|
1005
|
-
name: 'mx_trilerp_1',
|
|
1006
|
-
type: 'vec3',
|
|
1007
|
-
inputs: [
|
|
1008
|
-
{ name: 'v0', type: 'vec3' },
|
|
1009
|
-
{ name: 'v1', type: 'vec3' },
|
|
1010
|
-
{ name: 'v2', type: 'vec3' },
|
|
1011
|
-
{ name: 'v3', type: 'vec3' },
|
|
1012
|
-
{ name: 'v4', type: 'vec3' },
|
|
1013
|
-
{ name: 'v5', type: 'vec3' },
|
|
1014
|
-
{ name: 'v6', type: 'vec3' },
|
|
1015
|
-
{ name: 'v7', type: 'vec3' },
|
|
1016
|
-
{ name: 's', type: 'float' },
|
|
1017
|
-
{ name: 't', type: 'float' },
|
|
1018
|
-
{ name: 'r', type: 'float' }
|
|
1019
|
-
]
|
|
1020
|
-
} );
|
|
1021
|
-
|
|
1022
|
-
mx_gradient_float_0.setLayout( {
|
|
1023
|
-
name: 'mx_gradient_float_0',
|
|
1024
|
-
type: 'float',
|
|
1025
|
-
inputs: [
|
|
1026
|
-
{ name: 'hash', type: 'uint' },
|
|
1027
|
-
{ name: 'x', type: 'float' },
|
|
1028
|
-
{ name: 'y', type: 'float' }
|
|
1029
|
-
]
|
|
1030
|
-
} );
|
|
1031
|
-
|
|
1032
|
-
mx_gradient_float_1.setLayout( {
|
|
1033
|
-
name: 'mx_gradient_float_1',
|
|
1034
|
-
type: 'float',
|
|
1035
|
-
inputs: [
|
|
1036
|
-
{ name: 'hash', type: 'uint' },
|
|
1037
|
-
{ name: 'x', type: 'float' },
|
|
1038
|
-
{ name: 'y', type: 'float' },
|
|
1039
|
-
{ name: 'z', type: 'float' }
|
|
1040
|
-
]
|
|
1041
|
-
} );
|
|
1042
|
-
|
|
1043
|
-
mx_gradient_vec3_0.setLayout( {
|
|
1044
|
-
name: 'mx_gradient_vec3_0',
|
|
1045
|
-
type: 'vec3',
|
|
1046
|
-
inputs: [
|
|
1047
|
-
{ name: 'hash', type: 'uvec3' },
|
|
1048
|
-
{ name: 'x', type: 'float' },
|
|
1049
|
-
{ name: 'y', type: 'float' }
|
|
1050
|
-
]
|
|
1051
|
-
} );
|
|
1052
|
-
|
|
1053
|
-
mx_gradient_vec3_1.setLayout( {
|
|
1054
|
-
name: 'mx_gradient_vec3_1',
|
|
1055
|
-
type: 'vec3',
|
|
1056
|
-
inputs: [
|
|
1057
|
-
{ name: 'hash', type: 'uvec3' },
|
|
1058
|
-
{ name: 'x', type: 'float' },
|
|
1059
|
-
{ name: 'y', type: 'float' },
|
|
1060
|
-
{ name: 'z', type: 'float' }
|
|
1061
|
-
]
|
|
1062
|
-
} );
|
|
1063
|
-
|
|
1064
|
-
mx_gradient_scale2d_0.setLayout( {
|
|
1065
|
-
name: 'mx_gradient_scale2d_0',
|
|
1066
|
-
type: 'float',
|
|
1067
|
-
inputs: [
|
|
1068
|
-
{ name: 'v', type: 'float' }
|
|
1069
|
-
]
|
|
1070
|
-
} );
|
|
1071
|
-
|
|
1072
|
-
mx_gradient_scale3d_0.setLayout( {
|
|
1073
|
-
name: 'mx_gradient_scale3d_0',
|
|
1074
|
-
type: 'float',
|
|
1075
|
-
inputs: [
|
|
1076
|
-
{ name: 'v', type: 'float' }
|
|
1077
|
-
]
|
|
1078
|
-
} );
|
|
1079
|
-
|
|
1080
|
-
mx_gradient_scale2d_1.setLayout( {
|
|
1081
|
-
name: 'mx_gradient_scale2d_1',
|
|
1082
|
-
type: 'vec3',
|
|
1083
|
-
inputs: [
|
|
1084
|
-
{ name: 'v', type: 'vec3' }
|
|
1085
|
-
]
|
|
1086
|
-
} );
|
|
1087
|
-
|
|
1088
|
-
mx_gradient_scale3d_1.setLayout( {
|
|
1089
|
-
name: 'mx_gradient_scale3d_1',
|
|
1090
|
-
type: 'vec3',
|
|
1091
|
-
inputs: [
|
|
1092
|
-
{ name: 'v', type: 'vec3' }
|
|
1093
|
-
]
|
|
1094
|
-
} );
|
|
1095
|
-
|
|
1096
|
-
mx_rotl32.setLayout( {
|
|
1097
|
-
name: 'mx_rotl32',
|
|
1098
|
-
type: 'uint',
|
|
1099
|
-
inputs: [
|
|
1100
|
-
{ name: 'x', type: 'uint' },
|
|
1101
|
-
{ name: 'k', type: 'int' }
|
|
1102
|
-
]
|
|
1103
|
-
} );
|
|
1104
|
-
|
|
1105
|
-
mx_bjfinal.setLayout( {
|
|
1106
|
-
name: 'mx_bjfinal',
|
|
1107
|
-
type: 'uint',
|
|
1108
|
-
inputs: [
|
|
1109
|
-
{ name: 'a', type: 'uint' },
|
|
1110
|
-
{ name: 'b', type: 'uint' },
|
|
1111
|
-
{ name: 'c', type: 'uint' }
|
|
1112
|
-
]
|
|
1113
|
-
} );
|
|
1114
|
-
|
|
1115
|
-
mx_bits_to_01.setLayout( {
|
|
1116
|
-
name: 'mx_bits_to_01',
|
|
1117
|
-
type: 'float',
|
|
1118
|
-
inputs: [
|
|
1119
|
-
{ name: 'bits', type: 'uint' }
|
|
1120
|
-
]
|
|
1121
|
-
} );
|
|
1122
|
-
|
|
1123
|
-
mx_fade.setLayout( {
|
|
1124
|
-
name: 'mx_fade',
|
|
1125
|
-
type: 'float',
|
|
1126
|
-
inputs: [
|
|
1127
|
-
{ name: 't', type: 'float' }
|
|
1128
|
-
]
|
|
1129
|
-
} );
|
|
1130
|
-
|
|
1131
|
-
mx_hash_int_0.setLayout( {
|
|
1132
|
-
name: 'mx_hash_int_0',
|
|
1133
|
-
type: 'uint',
|
|
1134
|
-
inputs: [
|
|
1135
|
-
{ name: 'x', type: 'int' }
|
|
1136
|
-
]
|
|
1137
|
-
} );
|
|
1138
|
-
|
|
1139
|
-
mx_hash_int_1.setLayout( {
|
|
1140
|
-
name: 'mx_hash_int_1',
|
|
1141
|
-
type: 'uint',
|
|
1142
|
-
inputs: [
|
|
1143
|
-
{ name: 'x', type: 'int' },
|
|
1144
|
-
{ name: 'y', type: 'int' }
|
|
1145
|
-
]
|
|
1146
|
-
} );
|
|
1147
|
-
|
|
1148
|
-
mx_hash_int_2.setLayout( {
|
|
1149
|
-
name: 'mx_hash_int_2',
|
|
1150
|
-
type: 'uint',
|
|
1151
|
-
inputs: [
|
|
1152
|
-
{ name: 'x', type: 'int' },
|
|
1153
|
-
{ name: 'y', type: 'int' },
|
|
1154
|
-
{ name: 'z', type: 'int' }
|
|
1155
|
-
]
|
|
1156
|
-
} );
|
|
1157
|
-
|
|
1158
|
-
mx_hash_int_3.setLayout( {
|
|
1159
|
-
name: 'mx_hash_int_3',
|
|
1160
|
-
type: 'uint',
|
|
1161
|
-
inputs: [
|
|
1162
|
-
{ name: 'x', type: 'int' },
|
|
1163
|
-
{ name: 'y', type: 'int' },
|
|
1164
|
-
{ name: 'z', type: 'int' },
|
|
1165
|
-
{ name: 'xx', type: 'int' }
|
|
1166
|
-
]
|
|
1167
|
-
} );
|
|
1168
|
-
|
|
1169
|
-
mx_hash_int_4.setLayout( {
|
|
1170
|
-
name: 'mx_hash_int_4',
|
|
1171
|
-
type: 'uint',
|
|
1172
|
-
inputs: [
|
|
1173
|
-
{ name: 'x', type: 'int' },
|
|
1174
|
-
{ name: 'y', type: 'int' },
|
|
1175
|
-
{ name: 'z', type: 'int' },
|
|
1176
|
-
{ name: 'xx', type: 'int' },
|
|
1177
|
-
{ name: 'yy', type: 'int' }
|
|
1178
|
-
]
|
|
1179
|
-
} );
|
|
1180
|
-
|
|
1181
|
-
mx_hash_vec3_0.setLayout( {
|
|
1182
|
-
name: 'mx_hash_vec3_0',
|
|
1183
|
-
type: 'uvec3',
|
|
1184
|
-
inputs: [
|
|
1185
|
-
{ name: 'x', type: 'int' },
|
|
1186
|
-
{ name: 'y', type: 'int' }
|
|
1187
|
-
]
|
|
1188
|
-
} );
|
|
1189
|
-
|
|
1190
|
-
mx_hash_vec3_1.setLayout( {
|
|
1191
|
-
name: 'mx_hash_vec3_1',
|
|
1192
|
-
type: 'uvec3',
|
|
1193
|
-
inputs: [
|
|
1194
|
-
{ name: 'x', type: 'int' },
|
|
1195
|
-
{ name: 'y', type: 'int' },
|
|
1196
|
-
{ name: 'z', type: 'int' }
|
|
1197
|
-
]
|
|
1198
|
-
} );
|
|
1199
|
-
|
|
1200
|
-
mx_perlin_noise_float_0.setLayout( {
|
|
1201
|
-
name: 'mx_perlin_noise_float_0',
|
|
1202
|
-
type: 'float',
|
|
1203
|
-
inputs: [
|
|
1204
|
-
{ name: 'p', type: 'vec2' }
|
|
1205
|
-
]
|
|
1206
|
-
} );
|
|
1207
|
-
|
|
1208
|
-
mx_perlin_noise_float_1.setLayout( {
|
|
1209
|
-
name: 'mx_perlin_noise_float_1',
|
|
1210
|
-
type: 'float',
|
|
1211
|
-
inputs: [
|
|
1212
|
-
{ name: 'p', type: 'vec3' }
|
|
1213
|
-
]
|
|
1214
|
-
} );
|
|
1215
|
-
|
|
1216
|
-
mx_perlin_noise_vec3_0.setLayout( {
|
|
1217
|
-
name: 'mx_perlin_noise_vec3_0',
|
|
1218
|
-
type: 'vec3',
|
|
1219
|
-
inputs: [
|
|
1220
|
-
{ name: 'p', type: 'vec2' }
|
|
1221
|
-
]
|
|
1222
|
-
} );
|
|
1223
|
-
|
|
1224
|
-
mx_perlin_noise_vec3_1.setLayout( {
|
|
1225
|
-
name: 'mx_perlin_noise_vec3_1',
|
|
1226
|
-
type: 'vec3',
|
|
1227
|
-
inputs: [
|
|
1228
|
-
{ name: 'p', type: 'vec3' }
|
|
1229
|
-
]
|
|
1230
|
-
} );
|
|
1231
|
-
|
|
1232
|
-
mx_cell_noise_float_0.setLayout( {
|
|
1233
|
-
name: 'mx_cell_noise_float_0',
|
|
1234
|
-
type: 'float',
|
|
1235
|
-
inputs: [
|
|
1236
|
-
{ name: 'p', type: 'float' }
|
|
1237
|
-
]
|
|
1238
|
-
} );
|
|
1239
|
-
|
|
1240
|
-
mx_cell_noise_float_1.setLayout( {
|
|
1241
|
-
name: 'mx_cell_noise_float_1',
|
|
1242
|
-
type: 'float',
|
|
1243
|
-
inputs: [
|
|
1244
|
-
{ name: 'p', type: 'vec2' }
|
|
1245
|
-
]
|
|
1246
|
-
} );
|
|
1247
|
-
|
|
1248
|
-
mx_cell_noise_float_2.setLayout( {
|
|
1249
|
-
name: 'mx_cell_noise_float_2',
|
|
1250
|
-
type: 'float',
|
|
1251
|
-
inputs: [
|
|
1252
|
-
{ name: 'p', type: 'vec3' }
|
|
1253
|
-
]
|
|
1254
|
-
} );
|
|
1255
|
-
|
|
1256
|
-
mx_cell_noise_float_3.setLayout( {
|
|
1257
|
-
name: 'mx_cell_noise_float_3',
|
|
1258
|
-
type: 'float',
|
|
1259
|
-
inputs: [
|
|
1260
|
-
{ name: 'p', type: 'vec4' }
|
|
1261
|
-
]
|
|
1262
|
-
} );
|
|
1263
|
-
|
|
1264
|
-
mx_cell_noise_vec3_0.setLayout( {
|
|
1265
|
-
name: 'mx_cell_noise_vec3_0',
|
|
1266
|
-
type: 'vec3',
|
|
1267
|
-
inputs: [
|
|
1268
|
-
{ name: 'p', type: 'float' }
|
|
1269
|
-
]
|
|
1270
|
-
} );
|
|
1271
|
-
|
|
1272
|
-
mx_cell_noise_vec3_1.setLayout( {
|
|
1273
|
-
name: 'mx_cell_noise_vec3_1',
|
|
1274
|
-
type: 'vec3',
|
|
1275
|
-
inputs: [
|
|
1276
|
-
{ name: 'p', type: 'vec2' }
|
|
1277
|
-
]
|
|
1278
|
-
} );
|
|
1279
|
-
|
|
1280
|
-
mx_cell_noise_vec3_2.setLayout( {
|
|
1281
|
-
name: 'mx_cell_noise_vec3_2',
|
|
1282
|
-
type: 'vec3',
|
|
1283
|
-
inputs: [
|
|
1284
|
-
{ name: 'p', type: 'vec3' }
|
|
1285
|
-
]
|
|
1286
|
-
} );
|
|
1287
|
-
|
|
1288
|
-
mx_cell_noise_vec3_3.setLayout( {
|
|
1289
|
-
name: 'mx_cell_noise_vec3_3',
|
|
1290
|
-
type: 'vec3',
|
|
1291
|
-
inputs: [
|
|
1292
|
-
{ name: 'p', type: 'vec4' }
|
|
1293
|
-
]
|
|
1294
|
-
} );
|
|
1295
|
-
|
|
1296
|
-
mx_fractal_noise_float.setLayout( {
|
|
1297
|
-
name: 'mx_fractal_noise_float',
|
|
1298
|
-
type: 'float',
|
|
1299
|
-
inputs: [
|
|
1300
|
-
{ name: 'p', type: 'vec3' },
|
|
1301
|
-
{ name: 'octaves', type: 'int' },
|
|
1302
|
-
{ name: 'lacunarity', type: 'float' },
|
|
1303
|
-
{ name: 'diminish', type: 'float' }
|
|
1304
|
-
]
|
|
1305
|
-
} );
|
|
1306
|
-
|
|
1307
|
-
mx_fractal_noise_vec3.setLayout( {
|
|
1308
|
-
name: 'mx_fractal_noise_vec3',
|
|
1309
|
-
type: 'vec3',
|
|
1310
|
-
inputs: [
|
|
1311
|
-
{ name: 'p', type: 'vec3' },
|
|
1312
|
-
{ name: 'octaves', type: 'int' },
|
|
1313
|
-
{ name: 'lacunarity', type: 'float' },
|
|
1314
|
-
{ name: 'diminish', type: 'float' }
|
|
1315
|
-
]
|
|
1316
|
-
} );
|
|
1317
|
-
|
|
1318
|
-
mx_fractal_noise_vec2.setLayout( {
|
|
1319
|
-
name: 'mx_fractal_noise_vec2',
|
|
1320
|
-
type: 'vec2',
|
|
1321
|
-
inputs: [
|
|
1322
|
-
{ name: 'p', type: 'vec3' },
|
|
1323
|
-
{ name: 'octaves', type: 'int' },
|
|
1324
|
-
{ name: 'lacunarity', type: 'float' },
|
|
1325
|
-
{ name: 'diminish', type: 'float' }
|
|
1326
|
-
]
|
|
1327
|
-
} );
|
|
1328
|
-
|
|
1329
|
-
mx_fractal_noise_vec4.setLayout( {
|
|
1330
|
-
name: 'mx_fractal_noise_vec4',
|
|
1331
|
-
type: 'vec4',
|
|
1332
|
-
inputs: [
|
|
1333
|
-
{ name: 'p', type: 'vec3' },
|
|
1334
|
-
{ name: 'octaves', type: 'int' },
|
|
1335
|
-
{ name: 'lacunarity', type: 'float' },
|
|
1336
|
-
{ name: 'diminish', type: 'float' }
|
|
1337
|
-
]
|
|
1338
|
-
} );
|
|
1339
|
-
|
|
1340
|
-
mx_worley_distance_0.setLayout( {
|
|
1341
|
-
name: 'mx_worley_distance_0',
|
|
1342
|
-
type: 'float',
|
|
1343
|
-
inputs: [
|
|
1344
|
-
{ name: 'p', type: 'vec2' },
|
|
1345
|
-
{ name: 'x', type: 'int' },
|
|
1346
|
-
{ name: 'y', type: 'int' },
|
|
1347
|
-
{ name: 'xoff', type: 'int' },
|
|
1348
|
-
{ name: 'yoff', type: 'int' },
|
|
1349
|
-
{ name: 'jitter', type: 'float' },
|
|
1350
|
-
{ name: 'metric', type: 'int' }
|
|
1351
|
-
]
|
|
1352
|
-
} );
|
|
1353
|
-
|
|
1354
|
-
mx_worley_distance_1.setLayout( {
|
|
1355
|
-
name: 'mx_worley_distance_1',
|
|
1356
|
-
type: 'float',
|
|
1357
|
-
inputs: [
|
|
1358
|
-
{ name: 'p', type: 'vec3' },
|
|
1359
|
-
{ name: 'x', type: 'int' },
|
|
1360
|
-
{ name: 'y', type: 'int' },
|
|
1361
|
-
{ name: 'z', type: 'int' },
|
|
1362
|
-
{ name: 'xoff', type: 'int' },
|
|
1363
|
-
{ name: 'yoff', type: 'int' },
|
|
1364
|
-
{ name: 'zoff', type: 'int' },
|
|
1365
|
-
{ name: 'jitter', type: 'float' },
|
|
1366
|
-
{ name: 'metric', type: 'int' }
|
|
1367
|
-
]
|
|
1368
|
-
} );
|
|
1369
|
-
|
|
1370
|
-
mx_worley_noise_float_0.setLayout( {
|
|
1371
|
-
name: 'mx_worley_noise_float_0',
|
|
1372
|
-
type: 'float',
|
|
1373
|
-
inputs: [
|
|
1374
|
-
{ name: 'p', type: 'vec2' },
|
|
1375
|
-
{ name: 'jitter', type: 'float' },
|
|
1376
|
-
{ name: 'metric', type: 'int' }
|
|
1377
|
-
]
|
|
1378
|
-
} );
|
|
1379
|
-
|
|
1380
|
-
mx_worley_noise_vec2_0.setLayout( {
|
|
1381
|
-
name: 'mx_worley_noise_vec2_0',
|
|
1382
|
-
type: 'vec2',
|
|
1383
|
-
inputs: [
|
|
1384
|
-
{ name: 'p', type: 'vec2' },
|
|
1385
|
-
{ name: 'jitter', type: 'float' },
|
|
1386
|
-
{ name: 'metric', type: 'int' }
|
|
1387
|
-
]
|
|
1388
|
-
} );
|
|
1389
|
-
|
|
1390
|
-
mx_worley_noise_vec3_0.setLayout( {
|
|
1391
|
-
name: 'mx_worley_noise_vec3_0',
|
|
1392
|
-
type: 'vec3',
|
|
1393
|
-
inputs: [
|
|
1394
|
-
{ name: 'p', type: 'vec2' },
|
|
1395
|
-
{ name: 'jitter', type: 'float' },
|
|
1396
|
-
{ name: 'metric', type: 'int' }
|
|
1397
|
-
]
|
|
1398
|
-
} );
|
|
1399
|
-
|
|
1400
|
-
mx_worley_noise_float_1.setLayout( {
|
|
1401
|
-
name: 'mx_worley_noise_float_1',
|
|
1402
|
-
type: 'float',
|
|
1403
|
-
inputs: [
|
|
1404
|
-
{ name: 'p', type: 'vec3' },
|
|
1405
|
-
{ name: 'jitter', type: 'float' },
|
|
1406
|
-
{ name: 'metric', type: 'int' }
|
|
1407
|
-
]
|
|
1408
|
-
} );
|
|
1409
|
-
|
|
1410
|
-
mx_worley_noise_vec2_1.setLayout( {
|
|
1411
|
-
name: 'mx_worley_noise_vec2_1',
|
|
1412
|
-
type: 'vec2',
|
|
1413
|
-
inputs: [
|
|
1414
|
-
{ name: 'p', type: 'vec3' },
|
|
1415
|
-
{ name: 'jitter', type: 'float' },
|
|
1416
|
-
{ name: 'metric', type: 'int' }
|
|
1417
|
-
]
|
|
1418
|
-
} );
|
|
1419
|
-
|
|
1420
|
-
mx_worley_noise_vec3_1.setLayout( {
|
|
1317
|
+
} ).setLayout( {
|
|
1421
1318
|
name: 'mx_worley_noise_vec3_1',
|
|
1422
1319
|
type: 'vec3',
|
|
1423
1320
|
inputs: [
|
|
@@ -1427,4 +1324,4 @@ mx_worley_noise_vec3_1.setLayout( {
|
|
|
1427
1324
|
]
|
|
1428
1325
|
} );
|
|
1429
1326
|
|
|
1430
|
-
export
|
|
1327
|
+
export const mx_worley_noise_vec3 = /*@__PURE__*/ overloadingFn( [ mx_worley_noise_vec3_0, mx_worley_noise_vec3_1 ] );
|