three-stdlib 2.16.0 → 2.16.1
Sign up to get free protection for your applications and to get access to all the features.
- package/BufferGeometryUtils-1a7a235c.js +655 -0
- package/BufferGeometryUtils-971dfde3.js +1 -0
- package/Nodes-4f766d71.js +471 -0
- package/Nodes-9aa16d74.js +1 -0
- package/animation/AnimationClipCreator.cjs.js +1 -0
- package/animation/AnimationClipCreator.js +52 -32
- package/animation/CCDIKSolver.cjs.js +1 -0
- package/animation/CCDIKSolver.js +143 -64
- package/animation/MMDAnimationHelper.cjs.js +1 -0
- package/animation/MMDAnimationHelper.js +341 -150
- package/animation/MMDPhysics.cjs.js +1 -0
- package/animation/MMDPhysics.js +361 -154
- package/cameras/CinematicCamera.cjs.js +1 -0
- package/cameras/CinematicCamera.js +77 -67
- package/controls/ArcballControls.cjs.js +1 -0
- package/controls/ArcballControls.js +1449 -544
- package/controls/DeviceOrientationControls.cjs.js +1 -0
- package/controls/DeviceOrientationControls.js +97 -52
- package/controls/DragControls.cjs.js +1 -0
- package/controls/DragControls.js +187 -85
- package/controls/FirstPersonControls.cjs.js +1 -0
- package/controls/FirstPersonControls.js +193 -123
- package/controls/FlyControls.cjs.js +1 -0
- package/controls/FlyControls.js +152 -82
- package/controls/OrbitControls.cjs.js +1 -0
- package/controls/OrbitControls.js +481 -232
- package/controls/PointerLockControls.cjs.js +1 -0
- package/controls/PointerLockControls.js +99 -63
- package/controls/TrackballControls.cjs.js +1 -0
- package/controls/TrackballControls.js +383 -211
- package/controls/TransformControls.cjs.js +1 -0
- package/controls/TransformControls.js +782 -575
- package/controls/experimental/CameraControls.cjs.js +1 -0
- package/controls/experimental/CameraControls.js +609 -329
- package/csm/CSM.cjs.js +1 -0
- package/csm/CSM.js +108 -47
- package/csm/CSMFrustum.cjs.js +1 -0
- package/csm/CSMFrustum.js +29 -14
- package/csm/CSMHelper.cjs.js +1 -0
- package/csm/CSMHelper.js +34 -20
- package/csm/CSMShader.cjs.js +1 -0
- package/csm/CSMShader.js +11 -7
- package/curves/CurveExtras.cjs.js +1 -0
- package/curves/CurveExtras.js +115 -73
- package/curves/NURBSCurve.cjs.js +1 -0
- package/curves/NURBSCurve.js +43 -15
- package/curves/NURBSSurface.cjs.js +1 -0
- package/curves/NURBSSurface.js +27 -11
- package/curves/NURBSUtils.cjs.js +1 -0
- package/curves/NURBSUtils.js +203 -54
- package/custom.d.cjs.js +1 -0
- package/{shaders/types.mjs → custom.d.js} +0 -0
- package/deprecated/Geometry.cjs.js +1 -0
- package/deprecated/Geometry.js +486 -191
- package/effects/AnaglyphEffect.cjs.js +1 -0
- package/effects/AnaglyphEffect.js +60 -95
- package/effects/AsciiEffect.cjs.js +1 -0
- package/effects/AsciiEffect.js +110 -80
- package/effects/OutlineEffect.cjs.js +1 -0
- package/effects/OutlineEffect.js +204 -121
- package/effects/ParallaxBarrierEffect.cjs.js +1 -0
- package/effects/ParallaxBarrierEffect.js +38 -39
- package/effects/PeppersGhostEffect.cjs.js +1 -0
- package/effects/PeppersGhostEffect.js +68 -19
- package/effects/StereoEffect.cjs.js +1 -0
- package/effects/StereoEffect.js +16 -12
- package/environments/RoomEnvironment.cjs.js +1 -0
- package/environments/RoomEnvironment.js +47 -52
- package/exporters/ColladaExporter.cjs.js +1 -0
- package/exporters/ColladaExporter.js +241 -115
- package/exporters/DRACOExporter.cjs.js +1 -0
- package/exporters/DRACOExporter.js +121 -67
- package/exporters/GLTFExporter.cjs.js +1 -0
- package/exporters/GLTFExporter.js +1014 -463
- package/exporters/MMDExporter.cjs.js +1 -0
- package/exporters/MMDExporter.js +102 -44
- package/exporters/OBJExporter.cjs.js +1 -0
- package/exporters/OBJExporter.js +140 -78
- package/exporters/PLYExporter.cjs.js +1 -0
- package/exporters/PLYExporter.js +154 -93
- package/exporters/STLExporter.cjs.js +1 -0
- package/exporters/STLExporter.js +81 -30
- package/exporters/USDZExporter.cjs.js +1 -0
- package/exporters/USDZExporter.js +144 -84
- package/geometries/BoxLineGeometry.cjs.js +1 -0
- package/geometries/BoxLineGeometry.js +14 -7
- package/geometries/ConvexGeometry.cjs.js +1 -0
- package/geometries/ConvexGeometry.js +23 -14
- package/geometries/DecalGeometry.cjs.js +1 -0
- package/geometries/DecalGeometry.js +162 -108
- package/geometries/LightningStrike.cjs.js +1 -0
- package/geometries/LightningStrike.js +294 -101
- package/geometries/ParametricGeometries.cjs.js +1 -0
- package/geometries/ParametricGeometries.js +76 -26
- package/geometries/ParametricGeometry.cjs.js +1 -0
- package/geometries/ParametricGeometry.js +48 -24
- package/geometries/RoundedBoxGeometry.cjs.js +1 -0
- package/geometries/RoundedBoxGeometry.js +64 -33
- package/geometries/TeapotGeometry.cjs.js +1 -0
- package/geometries/TeapotGeometry.js +174 -1434
- package/geometries/TextGeometry.cjs.js +1 -0
- package/geometries/TextGeometry.js +17 -9
- package/helpers/LightProbeHelper.cjs.js +1 -0
- package/helpers/LightProbeHelper.js +21 -53
- package/helpers/PositionalAudioHelper.cjs.js +1 -0
- package/helpers/PositionalAudioHelper.js +30 -23
- package/helpers/RectAreaLightHelper.cjs.js +1 -0
- package/helpers/RectAreaLightHelper.js +33 -17
- package/helpers/VertexNormalsHelper.cjs.js +1 -0
- package/helpers/VertexNormalsHelper.js +41 -20
- package/helpers/VertexTangentsHelper.cjs.js +1 -0
- package/helpers/VertexTangentsHelper.js +36 -18
- package/index.cjs.js +1 -0
- package/index.js +333 -969
- package/interactive/InteractiveGroup.cjs.js +1 -0
- package/interactive/InteractiveGroup.d.ts +5 -0
- package/interactive/InteractiveGroup.js +87 -0
- package/interactive/SelectionBox.cjs.js +1 -0
- package/interactive/SelectionBox.js +46 -31
- package/interactive/SelectionHelper.cjs.js +1 -0
- package/interactive/SelectionHelper.js +21 -16
- package/libs/MeshoptDecoder.cjs.js +1 -0
- package/libs/MeshoptDecoder.js +58 -147
- package/libs/MotionControllers.cjs.js +1 -0
- package/libs/MotionControllers.js +208 -66
- package/lights/LightProbeGenerator.cjs.js +1 -0
- package/lights/LightProbeGenerator.js +96 -40
- package/lights/RectAreaLightUniformsLib.cjs.js +1 -0
- package/lights/RectAreaLightUniformsLib.js +9 -32842
- package/lines/Line2.cjs.js +1 -0
- package/lines/Line2.js +12 -9
- package/lines/LineGeometry.cjs.js +1 -0
- package/lines/LineGeometry.js +19 -7
- package/lines/LineMaterial.cjs.js +1 -0
- package/lines/LineMaterial.js +89 -51
- package/lines/LineSegments2.cjs.js +1 -0
- package/lines/LineSegments2.js +165 -56
- package/lines/LineSegmentsGeometry.cjs.js +1 -0
- package/lines/LineSegmentsGeometry.js +71 -29
- package/lines/Wireframe.cjs.js +1 -0
- package/lines/Wireframe.js +29 -15
- package/lines/WireframeGeometry2.cjs.js +1 -0
- package/lines/WireframeGeometry2.js +9 -8
- package/loaders/3DMLoader.cjs.js +1 -0
- package/loaders/3DMLoader.js +469 -234
- package/loaders/3MFLoader.cjs.js +1 -0
- package/loaders/3MFLoader.js +555 -340
- package/loaders/AMFLoader.cjs.js +1 -0
- package/loaders/AMFLoader.js +219 -114
- package/loaders/AssimpLoader.cjs.js +1 -0
- package/loaders/AssimpLoader.js +725 -328
- package/loaders/BVHLoader.cjs.js +1 -0
- package/loaders/BVHLoader.js +200 -94
- package/loaders/BasisTextureLoader.cjs.js +1 -0
- package/loaders/BasisTextureLoader.js +357 -229
- package/loaders/ColladaLoader.cjs.js +1 -0
- package/loaders/ColladaLoader.js +1522 -932
- package/loaders/DDSLoader.cjs.js +1 -0
- package/loaders/DDSLoader.js +108 -42
- package/loaders/DRACOLoader.cjs.js +1 -0
- package/loaders/DRACOLoader.js +210 -103
- package/loaders/EXRLoader.cjs.js +1 -0
- package/loaders/EXRLoader.js +809 -461
- package/loaders/FBXLoader.cjs.js +1 -0
- package/loaders/FBXLoader.js +1397 -842
- package/loaders/FontLoader.cjs.js +1 -0
- package/loaders/FontLoader.js +66 -33
- package/loaders/GCodeLoader.cjs.js +1 -0
- package/loaders/GCodeLoader.js +111 -63
- package/loaders/GLTFLoader.cjs.js +1 -0
- package/loaders/GLTFLoader.js +1484 -771
- package/loaders/HDRCubeTextureLoader.cjs.js +1 -0
- package/loaders/HDRCubeTextureLoader.js +50 -45
- package/loaders/KMZLoader.cjs.js +1 -0
- package/loaders/KMZLoader.js +55 -42
- package/loaders/KTX2Loader.cjs.js +1 -0
- package/loaders/KTX2Loader.js +362 -229
- package/loaders/KTXLoader.cjs.js +1 -0
- package/loaders/KTXLoader.js +99 -37
- package/loaders/LDrawLoader.cjs.js +1 -0
- package/loaders/LDrawLoader.js +746 -313
- package/loaders/LUT3dlLoader.cjs.js +1 -0
- package/loaders/LUT3dlLoader.js +62 -50
- package/loaders/LUTCubeLoader.cjs.js +1 -0
- package/loaders/LUTCubeLoader.js +56 -45
- package/loaders/LWOLoader.cjs.js +1 -0
- package/loaders/LWOLoader.js +339 -227
- package/loaders/LottieLoader.cjs.js +1 -0
- package/loaders/LottieLoader.js +38 -36
- package/loaders/MD2Loader.cjs.js +1 -0
- package/loaders/MD2Loader.js +91 -248
- package/loaders/MDDLoader.cjs.js +1 -0
- package/loaders/MDDLoader.js +45 -25
- package/loaders/MMDLoader.cjs.js +1 -0
- package/loaders/MMDLoader.js +795 -359
- package/loaders/MTLLoader.cjs.js +1 -0
- package/loaders/MTLLoader.js +201 -91
- package/loaders/NRRDLoader.cjs.js +1 -0
- package/loaders/NRRDLoader.js +263 -182
- package/loaders/NodeMaterialLoader.cjs.js +1 -0
- package/loaders/NodeMaterialLoader.js +14 -121
- package/loaders/OBJLoader.cjs.js +1 -0
- package/loaders/OBJLoader.js +283 -161
- package/loaders/PCDLoader.cjs.js +1 -0
- package/loaders/PCDLoader.js +164 -145
- package/loaders/PDBLoader.cjs.js +1 -0
- package/loaders/PDBLoader.js +63 -45
- package/loaders/PLYLoader.cjs.js +1 -0
- package/loaders/PLYLoader.js +203 -106
- package/loaders/PRWMLoader.cjs.js +1 -0
- package/loaders/PRWMLoader.js +110 -73
- package/loaders/PVRLoader.cjs.js +1 -0
- package/loaders/PVRLoader.js +93 -32
- package/loaders/RGBELoader.cjs.js +1 -0
- package/loaders/RGBELoader.js +233 -96
- package/loaders/RGBMLoader.cjs.js +1 -0
- package/loaders/RGBMLoader.js +514 -344
- package/loaders/STLLoader.cjs.js +1 -0
- package/loaders/STLLoader.js +165 -59
- package/loaders/SVGLoader.cjs.js +1 -0
- package/loaders/SVGLoader.js +851 -481
- package/loaders/TDSLoader.cjs.js +1 -0
- package/loaders/TDSLoader.js +527 -137
- package/loaders/TGALoader.cjs.js +1 -0
- package/loaders/TGALoader.js +205 -94
- package/loaders/TTFLoader.cjs.js +1 -0
- package/loaders/TTFLoader.js +79 -58
- package/loaders/TiltLoader.cjs.js +1 -0
- package/loaders/TiltLoader.js +167 -129
- package/loaders/VOXLoader.cjs.js +1 -0
- package/loaders/VOXLoader.js +84 -320
- package/loaders/VRMLLoader.cjs.js +1 -0
- package/loaders/VRMLLoader.js +1268 -786
- package/loaders/VRMLoader.cjs.js +1 -0
- package/loaders/VRMLoader.js +31 -23
- package/loaders/VTKLoader.cjs.js +1 -0
- package/loaders/VTKLoader.js +407 -219
- package/loaders/XLoader.cjs.js +1 -0
- package/loaders/XLoader.js +1259 -1083
- package/loaders/XYZLoader.cjs.js +1 -0
- package/loaders/XYZLoader.js +34 -28
- package/loaders/lwo/IFFParser.cjs.js +1 -0
- package/loaders/lwo/IFFParser.js +492 -238
- package/loaders/lwo/LWO2Parser.cjs.js +1 -0
- package/loaders/lwo/LWO2Parser.js +279 -176
- package/loaders/lwo/LWO3Parser.cjs.js +1 -0
- package/loaders/lwo/LWO3Parser.js +247 -160
- package/math/Capsule.cjs.js +1 -0
- package/math/Capsule.js +43 -56
- package/math/ColorConverter.cjs.js +1 -0
- package/math/ColorConverter.js +32 -18
- package/math/ConvexHull.cjs.js +1 -0
- package/math/ConvexHull.js +357 -97
- package/math/ImprovedNoise.cjs.js +1 -0
- package/math/ImprovedNoise.js +32 -282
- package/math/Lut.cjs.js +1 -0
- package/math/Lut.js +35 -51
- package/math/MeshSurfaceSampler.cjs.js +1 -0
- package/math/MeshSurfaceSampler.js +68 -25
- package/math/OBB.cjs.js +1 -0
- package/math/OBB.js +152 -91
- package/math/Octree.cjs.js +1 -0
- package/math/Octree.js +139 -76
- package/math/SimplexNoise.cjs.js +1 -0
- package/math/SimplexNoise.js +238 -217
- package/misc/ConvexObjectBreaker.cjs.js +1 -0
- package/misc/ConvexObjectBreaker.js +185 -79
- package/misc/GPUComputationRenderer.cjs.js +1 -0
- package/misc/GPUComputationRenderer.js +194 -69
- package/misc/Gyroscope.cjs.js +1 -0
- package/misc/Gyroscope.js +22 -16
- package/misc/MD2Character.cjs.js +1 -0
- package/misc/MD2Character.js +74 -52
- package/misc/MD2CharacterComplex.cjs.js +1 -0
- package/misc/MD2CharacterComplex.js +163 -112
- package/misc/MorphAnimMesh.cjs.js +1 -0
- package/misc/MorphAnimMesh.js +28 -20
- package/misc/MorphBlendMesh.cjs.js +1 -0
- package/misc/MorphBlendMesh.js +69 -45
- package/misc/ProgressiveLightmap.cjs.js +1 -0
- package/misc/ProgressiveLightmap.js +187 -70
- package/misc/RollerCoaster.cjs.js +1 -0
- package/misc/RollerCoaster.js +135 -106
- package/misc/TubePainter.cjs.js +1 -0
- package/misc/TubePainter.js +92 -74
- package/misc/Volume.cjs.js +1 -0
- package/misc/Volume.js +270 -108
- package/misc/VolumeSlice.cjs.js +1 -0
- package/misc/VolumeSlice.js +122 -34
- package/misc/WebGL.cjs.js +1 -0
- package/misc/WebGL.js +34 -37
- package/modifiers/CurveModifier.cjs.js +1 -0
- package/modifiers/CurveModifier.js +151 -46
- package/modifiers/EdgeSplitModifier.cjs.js +1 -0
- package/modifiers/EdgeSplitModifier.js +90 -46
- package/modifiers/SimplifyModifier.cjs.js +1 -0
- package/modifiers/SimplifyModifier.js +202 -77
- package/modifiers/TessellateModifier.cjs.js +1 -0
- package/modifiers/TessellateModifier.js +90 -65
- package/nodes/Nodes.cjs.js +1 -0
- package/nodes/Nodes.js +140 -274
- package/nodes/ShaderNode.cjs.js +1 -0
- package/nodes/ShaderNode.js +196 -296
- package/nodes/accessors/BufferNode.cjs.js +1 -0
- package/nodes/accessors/BufferNode.js +8 -4
- package/nodes/accessors/CameraNode.cjs.js +1 -0
- package/nodes/accessors/CameraNode.js +25 -20
- package/nodes/accessors/CubeTextureNode.cjs.js +1 -0
- package/nodes/accessors/CubeTextureNode.js +26 -14
- package/nodes/accessors/MaterialNode.cjs.js +1 -0
- package/nodes/accessors/MaterialNode.js +53 -43
- package/nodes/accessors/MaterialReferenceNode.cjs.js +1 -0
- package/nodes/accessors/MaterialReferenceNode.js +6 -3
- package/nodes/accessors/ModelNode.cjs.js +1 -0
- package/nodes/accessors/ModelNode.js +5 -3
- package/nodes/accessors/ModelViewProjectionNode.cjs.js +1 -0
- package/nodes/accessors/ModelViewProjectionNode.js +13 -14
- package/nodes/accessors/NormalNode.cjs.js +1 -0
- package/nodes/accessors/NormalNode.js +39 -40
- package/nodes/accessors/Object3DNode.cjs.js +1 -0
- package/nodes/accessors/Object3DNode.js +50 -40
- package/nodes/accessors/PointUVNode.cjs.js +1 -0
- package/nodes/accessors/PointUVNode.js +9 -5
- package/nodes/accessors/PositionNode.cjs.js +1 -0
- package/nodes/accessors/PositionNode.js +41 -42
- package/nodes/accessors/ReferenceNode.cjs.js +1 -0
- package/nodes/accessors/ReferenceNode.js +17 -10
- package/nodes/accessors/ReflectNode.cjs.js +1 -0
- package/nodes/accessors/ReflectNode.js +26 -23
- package/nodes/accessors/SkinningNode.cjs.js +1 -0
- package/nodes/accessors/SkinningNode.js +48 -46
- package/nodes/accessors/TextureNode.cjs.js +1 -0
- package/nodes/accessors/TextureNode.js +29 -14
- package/nodes/accessors/UVNode.cjs.js +1 -0
- package/nodes/accessors/UVNode.js +11 -5
- package/nodes/core/ArrayUniformNode.cjs.js +1 -0
- package/nodes/core/ArrayUniformNode.js +7 -3
- package/nodes/core/AttributeNode.cjs.js +1 -0
- package/nodes/core/AttributeNode.js +12 -5
- package/nodes/core/BypassNode.cjs.js +1 -0
- package/nodes/core/BypassNode.js +12 -5
- package/nodes/core/CodeNode.cjs.js +1 -0
- package/nodes/core/CodeNode.js +12 -4
- package/nodes/core/ConstNode.cjs.js +1 -0
- package/nodes/core/ConstNode.js +7 -3
- package/nodes/core/ContextNode.cjs.js +1 -0
- package/nodes/core/ContextNode.js +8 -3
- package/nodes/core/ExpressionNode.cjs.js +1 -0
- package/nodes/core/ExpressionNode.js +9 -5
- package/nodes/core/FunctionCallNode.cjs.js +1 -0
- package/nodes/core/FunctionCallNode.js +15 -6
- package/nodes/core/FunctionNode.cjs.js +1 -0
- package/nodes/core/FunctionNode.js +25 -10
- package/nodes/core/InputNode.cjs.js +1 -0
- package/nodes/core/InputNode.js +23 -12
- package/nodes/core/Node.cjs.js +1 -0
- package/nodes/core/Node.js +75 -35
- package/nodes/core/NodeAttribute.cjs.js +1 -0
- package/nodes/core/NodeAttribute.js +4 -2
- package/nodes/core/NodeBuilder.cjs.js +1 -0
- package/nodes/core/NodeBuilder.js +224 -110
- package/nodes/core/NodeCode.cjs.js +1 -0
- package/nodes/core/NodeCode.js +7 -4
- package/nodes/core/NodeFrame.cjs.js +1 -0
- package/nodes/core/NodeFrame.js +12 -9
- package/nodes/core/NodeFunction.cjs.js +1 -0
- package/nodes/core/NodeFunction.js +17 -0
- package/nodes/core/NodeFunctionInput.cjs.js +1 -0
- package/nodes/core/NodeFunctionInput.js +5 -3
- package/nodes/core/NodeKeywords.cjs.js +1 -0
- package/nodes/core/NodeKeywords.js +16 -5
- package/nodes/core/NodeParser.cjs.js +1 -0
- package/nodes/core/NodeParser.js +8 -0
- package/nodes/core/NodeUniform.cjs.js +1 -0
- package/nodes/core/NodeUniform.js +7 -3
- package/nodes/core/NodeUtils.cjs.js +1 -0
- package/nodes/core/NodeUtils.js +43 -39
- package/nodes/core/NodeVar.cjs.js +1 -0
- package/nodes/core/NodeVar.js +4 -2
- package/nodes/core/NodeVary.cjs.js +1 -0
- package/nodes/core/NodeVary.js +4 -2
- package/nodes/core/PropertyNode.cjs.js +1 -0
- package/nodes/core/PropertyNode.js +10 -4
- package/nodes/core/TempNode.cjs.js +1 -0
- package/nodes/core/TempNode.js +11 -5
- package/nodes/core/UniformNode.cjs.js +1 -0
- package/nodes/core/UniformNode.js +10 -4
- package/nodes/core/VarNode.cjs.js +1 -0
- package/nodes/core/VarNode.js +11 -3
- package/nodes/core/VaryNode.cjs.js +1 -0
- package/nodes/core/VaryNode.js +15 -6
- package/nodes/core/constants.cjs.js +1 -0
- package/nodes/core/constants.js +7 -20
- package/nodes/display/ColorSpaceNode.cjs.js +1 -0
- package/nodes/display/ColorSpaceNode.js +38 -34
- package/nodes/display/NormalMapNode.cjs.js +1 -0
- package/nodes/display/NormalMapNode.js +53 -35
- package/nodes/fog/FogNode.cjs.js +1 -0
- package/nodes/fog/FogNode.js +9 -5
- package/nodes/fog/FogRangeNode.cjs.js +1 -0
- package/nodes/fog/FogRangeNode.js +9 -5
- package/nodes/functions/BSDFs.cjs.js +1 -0
- package/nodes/functions/BSDFs.js +118 -61
- package/nodes/functions/PhysicalMaterialFunctions.cjs.js +1 -0
- package/nodes/functions/PhysicalMaterialFunctions.js +57 -0
- package/nodes/lights/LightContextNode.cjs.js +1 -0
- package/nodes/lights/LightContextNode.js +23 -14
- package/nodes/lights/LightNode.cjs.js +1 -0
- package/nodes/lights/LightNode.js +31 -27
- package/nodes/lights/LightsNode.cjs.js +1 -0
- package/nodes/lights/LightsNode.js +28 -9
- package/nodes/loaders/NodeLoader.cjs.js +1 -0
- package/nodes/loaders/NodeLoader.js +42 -27
- package/nodes/loaders/NodeMaterialLoader.cjs.js +1 -0
- package/nodes/loaders/NodeMaterialLoader.js +10 -4
- package/nodes/loaders/NodeObjectLoader.cjs.js +1 -0
- package/nodes/loaders/NodeObjectLoader.js +19 -9
- package/nodes/materials/LineBasicNodeMaterial.cjs.js +1 -0
- package/nodes/materials/LineBasicNodeMaterial.js +10 -5
- package/nodes/materials/Materials.cjs.js +1 -0
- package/nodes/materials/Materials.js +17 -14
- package/nodes/materials/MeshBasicNodeMaterial.cjs.js +1 -0
- package/nodes/materials/MeshBasicNodeMaterial.js +10 -5
- package/nodes/materials/MeshStandardNodeMaterial.cjs.js +1 -0
- package/nodes/materials/MeshStandardNodeMaterial.js +8 -5
- package/nodes/materials/NodeMaterial.cjs.js +1 -0
- package/nodes/materials/NodeMaterial.js +36 -20
- package/nodes/materials/PointsNodeMaterial.cjs.js +1 -0
- package/nodes/materials/PointsNodeMaterial.js +10 -5
- package/nodes/math/CondNode.cjs.js +1 -0
- package/nodes/math/CondNode.js +23 -11
- package/nodes/math/MathNode.cjs.js +1 -0
- package/nodes/math/MathNode.js +142 -98
- package/nodes/math/OperatorNode.cjs.js +1 -0
- package/nodes/math/OperatorNode.js +46 -24
- package/nodes/parsers/GLSLNodeFunction.cjs.js +1 -0
- package/nodes/parsers/GLSLNodeFunction.js +101 -0
- package/nodes/parsers/GLSLNodeParser.cjs.js +1 -0
- package/nodes/parsers/GLSLNodeParser.js +13 -0
- package/nodes/parsers/WGSLNodeFunction.cjs.js +1 -0
- package/nodes/parsers/WGSLNodeFunction.js +71 -0
- package/nodes/parsers/WGSLNodeParser.cjs.js +1 -0
- package/nodes/parsers/WGSLNodeParser.js +13 -0
- package/nodes/procedural/CheckerNode.cjs.js +1 -0
- package/nodes/procedural/CheckerNode.js +19 -13
- package/nodes/utils/ArrayElementNode.cjs.js +1 -0
- package/nodes/utils/ArrayElementNode.js +8 -4
- package/nodes/utils/ConvertNode.cjs.js +1 -0
- package/nodes/utils/ConvertNode.js +8 -3
- package/nodes/utils/JoinNode.cjs.js +1 -0
- package/nodes/utils/JoinNode.js +11 -7
- package/nodes/utils/MatcapUVNode.cjs.js +1 -0
- package/nodes/utils/MatcapUVNode.js +11 -8
- package/nodes/utils/OscNode.cjs.js +1 -0
- package/nodes/utils/OscNode.js +33 -27
- package/nodes/utils/SplitNode.cjs.js +1 -0
- package/nodes/utils/SplitNode.js +20 -6
- package/nodes/utils/SpriteSheetUVNode.cjs.js +1 -0
- package/nodes/utils/SpriteSheetUVNode.js +23 -23
- package/nodes/utils/TimerNode.cjs.js +1 -0
- package/nodes/utils/TimerNode.js +24 -20
- package/objects/GroundProjectedEnv.cjs.js +1 -0
- package/objects/GroundProjectedEnv.js +37 -22
- package/objects/Lensflare.cjs.js +1 -0
- package/objects/Lensflare.js +156 -86
- package/objects/LightningStorm.cjs.js +1 -0
- package/objects/LightningStorm.js +102 -38
- package/objects/MarchingCubes.cjs.js +1 -0
- package/objects/MarchingCubes.js +303 -150
- package/objects/Reflector.cjs.js +1 -0
- package/objects/Reflector.js +72 -50
- package/objects/ReflectorForSSRPass.cjs.js +1 -0
- package/objects/ReflectorForSSRPass.js +131 -80
- package/objects/ReflectorRTT.cjs.js +1 -0
- package/objects/ReflectorRTT.js +7 -6
- package/objects/Refractor.cjs.js +1 -0
- package/objects/Refractor.js +106 -64
- package/objects/ShadowMesh.cjs.js +1 -0
- package/objects/ShadowMesh.js +17 -8
- package/objects/Sky.cjs.js +1 -0
- package/objects/Sky.js +80 -119
- package/objects/Water.cjs.js +1 -0
- package/objects/Water.js +127 -83
- package/objects/Water2.cjs.js +1 -0
- package/objects/Water2.js +108 -72
- package/offscreen/jank.cjs.js +1 -0
- package/offscreen/jank.js +14 -10
- package/offscreen/offscreen.cjs.js +1 -0
- package/offscreen/offscreen.js +5 -4
- package/offscreen/scene.cjs.js +1 -0
- package/offscreen/scene.js +48 -45
- package/package.json +3 -3
- package/physics/AmmoPhysics.cjs.js +1 -0
- package/physics/AmmoPhysics.js +71 -30
- package/postprocessing/AdaptiveToneMappingPass.cjs.js +1 -0
- package/postprocessing/AdaptiveToneMappingPass.js +123 -97
- package/postprocessing/AfterimagePass.cjs.js +1 -0
- package/postprocessing/AfterimagePass.js +49 -28
- package/postprocessing/BloomPass.cjs.js +1 -0
- package/postprocessing/BloomPass.js +69 -43
- package/postprocessing/BokehPass.cjs.js +1 -0
- package/postprocessing/BokehPass.js +69 -39
- package/postprocessing/ClearPass.cjs.js +1 -0
- package/postprocessing/ClearPass.js +25 -10
- package/postprocessing/CubeTexturePass.cjs.js +1 -0
- package/postprocessing/CubeTexturePass.js +27 -28
- package/postprocessing/DotScreenPass.cjs.js +1 -0
- package/postprocessing/DotScreenPass.js +32 -24
- package/postprocessing/EffectComposer.cjs.js +1 -0
- package/postprocessing/EffectComposer.js +86 -39
- package/postprocessing/FilmPass.cjs.js +1 -0
- package/postprocessing/FilmPass.js +30 -25
- package/postprocessing/GlitchPass.cjs.js +1 -0
- package/postprocessing/GlitchPass.js +61 -38
- package/postprocessing/HalftonePass.cjs.js +1 -0
- package/postprocessing/HalftonePass.js +39 -19
- package/postprocessing/LUTPass.cjs.js +1 -0
- package/postprocessing/LUTPass.js +38 -13
- package/postprocessing/MaskPass.cjs.js +1 -0
- package/postprocessing/MaskPass.js +38 -19
- package/postprocessing/OutlinePass.cjs.js +1 -0
- package/postprocessing/OutlinePass.js +277 -135
- package/postprocessing/Pass.cjs.js +1 -0
- package/postprocessing/Pass.js +44 -20
- package/postprocessing/RenderPass.cjs.js +1 -0
- package/postprocessing/RenderPass.js +36 -13
- package/postprocessing/RenderPixelatedPass.cjs.js +1 -0
- package/postprocessing/RenderPixelatedPass.js +58 -44
- package/postprocessing/SAOPass.cjs.js +1 -0
- package/postprocessing/SAOPass.js +189 -154
- package/postprocessing/SMAAPass.cjs.js +1 -0
- package/postprocessing/SMAAPass.js +84 -64
- package/postprocessing/SSAARenderPass.cjs.js +1 -0
- package/postprocessing/SSAARenderPass.js +69 -121
- package/postprocessing/SSAOPass.cjs.js +1 -0
- package/postprocessing/SSAOPass.js +172 -123
- package/postprocessing/SSRPass.cjs.js +1 -0
- package/postprocessing/SSRPass.js +280 -211
- package/postprocessing/SavePass.cjs.js +1 -0
- package/postprocessing/SavePass.js +25 -20
- package/postprocessing/ShaderPass.cjs.js +1 -0
- package/postprocessing/ShaderPass.js +30 -14
- package/postprocessing/TAARenderPass.cjs.js +1 -0
- package/postprocessing/TAARenderPass.js +61 -42
- package/postprocessing/TexturePass.cjs.js +1 -0
- package/postprocessing/TexturePass.js +22 -21
- package/postprocessing/UnrealBloomPass.cjs.js +1 -0
- package/postprocessing/UnrealBloomPass.js +213 -105
- package/renderers/CSS2DRenderer.cjs.js +1 -0
- package/renderers/CSS2DRenderer.js +56 -44
- package/renderers/CSS3DRenderer.cjs.js +1 -0
- package/renderers/CSS3DRenderer.js +86 -53
- package/renderers/Projector.cjs.js +1 -0
- package/renderers/Projector.js +274 -107
- package/renderers/SVGRenderer.cjs.js +1 -0
- package/renderers/SVGRenderer.js +182 -72
- package/renderers/nodes/accessors/CameraNode.cjs.js +1 -0
- package/renderers/nodes/accessors/CameraNode.js +40 -29
- package/renderers/nodes/accessors/ModelNode.cjs.js +1 -0
- package/renderers/nodes/accessors/ModelNode.js +37 -28
- package/renderers/nodes/accessors/ModelViewProjectionNode.cjs.js +1 -0
- package/renderers/nodes/accessors/ModelViewProjectionNode.js +23 -10
- package/renderers/nodes/accessors/NormalNode.cjs.js +1 -0
- package/renderers/nodes/accessors/NormalNode.js +45 -35
- package/renderers/nodes/accessors/PositionNode.cjs.js +1 -0
- package/renderers/nodes/accessors/PositionNode.js +19 -18
- package/renderers/nodes/accessors/UVNode.cjs.js +1 -0
- package/renderers/nodes/accessors/UVNode.js +10 -5
- package/renderers/nodes/core/AttributeNode.cjs.js +1 -0
- package/renderers/nodes/core/AttributeNode.js +14 -5
- package/renderers/nodes/core/InputNode.cjs.js +1 -0
- package/renderers/nodes/core/InputNode.js +14 -4
- package/renderers/nodes/core/Node.cjs.js +1 -0
- package/renderers/nodes/core/Node.js +17 -7
- package/renderers/nodes/core/NodeAttribute.cjs.js +1 -0
- package/renderers/nodes/core/NodeAttribute.js +6 -3
- package/renderers/nodes/core/NodeBuilder.cjs.js +1 -0
- package/renderers/nodes/core/NodeBuilder.js +154 -87
- package/renderers/nodes/core/NodeFrame.cjs.js +1 -0
- package/renderers/nodes/core/NodeFrame.js +12 -9
- package/renderers/nodes/core/NodeSlot.cjs.js +1 -0
- package/renderers/nodes/core/NodeSlot.js +3 -2
- package/renderers/nodes/core/NodeUniform.cjs.js +1 -0
- package/renderers/nodes/core/NodeUniform.js +9 -4
- package/renderers/nodes/core/NodeVary.cjs.js +1 -0
- package/renderers/nodes/core/NodeVary.js +7 -4
- package/renderers/nodes/core/VaryNode.cjs.js +1 -0
- package/renderers/nodes/core/VaryNode.js +12 -6
- package/renderers/nodes/core/constants.cjs.js +1 -0
- package/renderers/nodes/core/constants.js +13 -16
- package/renderers/nodes/inputs/ColorNode.cjs.js +1 -0
- package/renderers/nodes/inputs/ColorNode.js +11 -5
- package/renderers/nodes/inputs/FloatNode.cjs.js +1 -0
- package/renderers/nodes/inputs/FloatNode.js +11 -5
- package/renderers/nodes/inputs/Matrix3Node.cjs.js +1 -0
- package/renderers/nodes/inputs/Matrix3Node.js +13 -7
- package/renderers/nodes/inputs/Matrix4Node.cjs.js +1 -0
- package/renderers/nodes/inputs/Matrix4Node.js +13 -7
- package/renderers/nodes/inputs/TextureNode.cjs.js +1 -0
- package/renderers/nodes/inputs/TextureNode.js +15 -7
- package/renderers/nodes/inputs/Vector2Node.cjs.js +1 -0
- package/renderers/nodes/inputs/Vector2Node.js +11 -5
- package/renderers/nodes/inputs/Vector3Node.cjs.js +1 -0
- package/renderers/nodes/inputs/Vector3Node.js +13 -7
- package/renderers/nodes/inputs/Vector4Node.cjs.js +1 -0
- package/renderers/nodes/inputs/Vector4Node.js +13 -7
- package/renderers/nodes/math/MathNode.cjs.js +1 -0
- package/renderers/nodes/math/MathNode.js +30 -20
- package/renderers/nodes/math/OperatorNode.cjs.js +1 -0
- package/renderers/nodes/math/OperatorNode.js +20 -4
- package/renderers/nodes/utils/SwitchNode.cjs.js +1 -0
- package/renderers/nodes/utils/SwitchNode.js +9 -4
- package/renderers/nodes/utils/TimerNode.cjs.js +1 -0
- package/renderers/nodes/utils/TimerNode.js +10 -5
- package/renderers/webgpu/WebGPU.cjs.js +1 -0
- package/renderers/webgpu/WebGPU.js +16 -14
- package/renderers/webgpu/WebGPUAttributes.cjs.js +1 -0
- package/renderers/webgpu/WebGPUAttributes.js +23 -16
- package/renderers/webgpu/WebGPUBackground.cjs.js +1 -0
- package/renderers/webgpu/WebGPUBackground.js +30 -13
- package/renderers/webgpu/WebGPUBinding.cjs.js +1 -0
- package/renderers/webgpu/WebGPUBinding.js +7 -4
- package/renderers/webgpu/WebGPUBindings.cjs.js +1 -0
- package/renderers/webgpu/WebGPUBindings.js +57 -21
- package/renderers/webgpu/WebGPUComputePipelines.cjs.js +1 -0
- package/renderers/webgpu/WebGPUComputePipelines.js +25 -14
- package/renderers/webgpu/WebGPUGeometries.cjs.js +1 -0
- package/renderers/webgpu/WebGPUGeometries.js +15 -5
- package/renderers/webgpu/WebGPUInfo.cjs.js +1 -0
- package/renderers/webgpu/WebGPUInfo.js +8 -3
- package/renderers/webgpu/WebGPUObjects.cjs.js +1 -0
- package/renderers/webgpu/WebGPUObjects.js +10 -5
- package/renderers/webgpu/WebGPUProperties.cjs.js +1 -0
- package/renderers/webgpu/WebGPUProperties.js +11 -5
- package/renderers/webgpu/WebGPURenderLists.cjs.js +1 -0
- package/renderers/webgpu/WebGPURenderLists.js +36 -20
- package/renderers/webgpu/WebGPURenderPipelines.cjs.js +1 -0
- package/renderers/webgpu/WebGPURenderPipelines.js +387 -260
- package/renderers/webgpu/WebGPURenderer.cjs.js +1 -0
- package/renderers/webgpu/WebGPURenderer.js +262 -124
- package/renderers/webgpu/WebGPUSampledTexture.cjs.js +1 -0
- package/renderers/webgpu/WebGPUSampledTexture.js +31 -18
- package/renderers/webgpu/WebGPUSampler.cjs.js +1 -0
- package/renderers/webgpu/WebGPUSampler.js +12 -7
- package/renderers/webgpu/WebGPUStorageBuffer.cjs.js +1 -0
- package/renderers/webgpu/WebGPUStorageBuffer.js +12 -7
- package/renderers/webgpu/WebGPUTextureRenderer.cjs.js +1 -0
- package/renderers/webgpu/WebGPUTextureRenderer.js +11 -5
- package/renderers/webgpu/WebGPUTextureUtils.cjs.js +1 -0
- package/renderers/webgpu/WebGPUTextureUtils.js +40 -29
- package/renderers/webgpu/WebGPUTextures.cjs.js +1 -0
- package/renderers/webgpu/WebGPUTextures.js +333 -186
- package/renderers/webgpu/WebGPUUniform.cjs.js +1 -0
- package/renderers/webgpu/WebGPUUniform.js +51 -25
- package/renderers/webgpu/WebGPUUniformsGroup.cjs.js +1 -0
- package/renderers/webgpu/WebGPUUniformsGroup.js +72 -32
- package/renderers/webgpu/constants.cjs.js +1 -0
- package/renderers/webgpu/constants.js +181 -190
- package/renderers/webgpu/nodes/ShaderLib.cjs.js +1 -0
- package/renderers/webgpu/nodes/ShaderLib.js +2 -2
- package/renderers/webgpu/nodes/WebGPUNodeBuilder.cjs.js +1 -0
- package/renderers/webgpu/nodes/WebGPUNodeBuilder.js +124 -53
- package/renderers/webgpu/nodes/WebGPUNodeUniform.cjs.js +1 -0
- package/renderers/webgpu/nodes/WebGPUNodeUniform.js +31 -17
- package/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.cjs.js +1 -0
- package/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.js +9 -8
- package/renderers/webgpu/nodes/WebGPUNodes.cjs.js +1 -0
- package/renderers/webgpu/nodes/WebGPUNodes.js +45 -7
- package/shaders/ACESFilmicToneMappingShader.cjs.js +1 -0
- package/shaders/ACESFilmicToneMappingShader.js +24 -44
- package/shaders/AfterimageShader.cjs.js +1 -0
- package/shaders/AfterimageShader.js +18 -28
- package/shaders/BasicShader.cjs.js +1 -0
- package/shaders/BasicShader.js +7 -9
- package/shaders/BleachBypassShader.cjs.js +1 -0
- package/shaders/BleachBypassShader.js +15 -31
- package/shaders/BlendShader.cjs.js +1 -0
- package/shaders/BlendShader.js +19 -26
- package/shaders/BokehShader.cjs.js +1 -0
- package/shaders/BokehShader.js +36 -98
- package/shaders/BokehShader2.cjs.js +1 -0
- package/shaders/BokehShader2.js +90 -261
- package/shaders/BrightnessContrastShader.cjs.js +1 -0
- package/shaders/BrightnessContrastShader.js +19 -28
- package/shaders/ColorCorrectionShader.cjs.js +1 -0
- package/shaders/ColorCorrectionShader.js +22 -26
- package/shaders/ColorifyShader.cjs.js +1 -0
- package/shaders/ColorifyShader.js +16 -24
- package/shaders/ConvolutionShader.cjs.js +1 -0
- package/shaders/ConvolutionShader.js +36 -40
- package/shaders/CopyShader.cjs.js +1 -0
- package/shaders/CopyShader.js +13 -21
- package/shaders/DOFMipMapShader.cjs.js +1 -0
- package/shaders/DOFMipMapShader.js +21 -28
- package/shaders/DepthLimitedBlurShader.cjs.js +1 -0
- package/shaders/DepthLimitedBlurShader.js +40 -85
- package/shaders/DigitalGlitch.cjs.js +1 -0
- package/shaders/DigitalGlitch.js +46 -74
- package/shaders/DotScreenShader.cjs.js +1 -0
- package/shaders/DotScreenShader.js +27 -35
- package/shaders/FXAAShader.cjs.js +1 -0
- package/shaders/FXAAShader.js +19 -1094
- package/shaders/FilmShader.cjs.js +1 -0
- package/shaders/FilmShader.js +52 -38
- package/shaders/FocusShader.cjs.js +1 -0
- package/shaders/FocusShader.js +24 -51
- package/shaders/FreiChenShader.cjs.js +1 -0
- package/shaders/FreiChenShader.js +24 -57
- package/shaders/FresnelShader.cjs.js +1 -0
- package/shaders/FresnelShader.js +22 -43
- package/shaders/GammaCorrectionShader.cjs.js +1 -0
- package/shaders/GammaCorrectionShader.js +11 -19
- package/shaders/GodRaysShader.cjs.js +1 -0
- package/shaders/GodRaysShader.js +94 -103
- package/shaders/HalftoneShader.cjs.js +1 -0
- package/shaders/HalftoneShader.js +65 -208
- package/shaders/HorizontalBlurShader.cjs.js +1 -0
- package/shaders/HorizontalBlurShader.js +23 -7
- package/shaders/HorizontalTiltShiftShader.cjs.js +1 -0
- package/shaders/HorizontalTiltShiftShader.js +21 -33
- package/shaders/HueSaturationShader.cjs.js +1 -0
- package/shaders/HueSaturationShader.js +21 -37
- package/shaders/KaleidoShader.cjs.js +1 -0
- package/shaders/KaleidoShader.js +22 -30
- package/shaders/LuminosityHighPassShader.cjs.js +1 -0
- package/shaders/LuminosityHighPassShader.js +27 -33
- package/shaders/LuminosityShader.cjs.js +1 -0
- package/shaders/LuminosityShader.js +11 -21
- package/shaders/MirrorShader.cjs.js +1 -0
- package/shaders/MirrorShader.js +16 -31
- package/shaders/NormalMapShader.cjs.js +1 -0
- package/shaders/NormalMapShader.js +23 -27
- package/shaders/ParallaxShader.cjs.js +1 -0
- package/shaders/ParallaxShader.js +48 -107
- package/shaders/PixelShader.cjs.js +1 -0
- package/shaders/PixelShader.js +16 -24
- package/shaders/RGBShiftShader.cjs.js +1 -0
- package/shaders/RGBShiftShader.js +22 -26
- package/shaders/SAOShader.cjs.js +1 -0
- package/shaders/SAOShader.js +48 -132
- package/shaders/SMAAShader.cjs.js +1 -0
- package/shaders/SMAAShader.js +135 -256
- package/shaders/SSAOShader.cjs.js +1 -0
- package/shaders/SSAOShader.js +81 -153
- package/shaders/SSRShader.cjs.js +1 -0
- package/shaders/SSRShader.js +87 -32
- package/shaders/SepiaShader.cjs.js +1 -0
- package/shaders/SepiaShader.js +15 -25
- package/shaders/SobelOperatorShader.cjs.js +1 -0
- package/shaders/SobelOperatorShader.js +29 -40
- package/shaders/SubsurfaceScatteringShader.cjs.js +1 -0
- package/shaders/SubsurfaceScatteringShader.js +39 -53
- package/shaders/TechnicolorShader.cjs.js +1 -0
- package/shaders/TechnicolorShader.js +13 -20
- package/shaders/ToneMapShader.cjs.js +1 -0
- package/shaders/ToneMapShader.js +28 -44
- package/shaders/ToonShader.cjs.js +1 -0
- package/shaders/ToonShader.js +96 -172
- package/shaders/TriangleBlurShader.cjs.js +1 -0
- package/shaders/TriangleBlurShader.js +23 -32
- package/shaders/UnpackDepthRGBAShader.cjs.js +1 -0
- package/shaders/UnpackDepthRGBAShader.js +14 -22
- package/shaders/VerticalBlurShader.cjs.js +1 -0
- package/shaders/VerticalBlurShader.js +23 -7
- package/shaders/VerticalTiltShiftShader.cjs.js +1 -0
- package/shaders/VerticalTiltShiftShader.js +21 -33
- package/shaders/VignetteShader.cjs.js +1 -0
- package/shaders/VignetteShader.js +28 -24
- package/shaders/VolumeShader.cjs.js +1 -0
- package/shaders/VolumeShader.js +77 -174
- package/shaders/WaterRefractionShader.cjs.js +1 -0
- package/shaders/WaterRefractionShader.js +6 -38
- package/shaders/types.cjs.js +1 -0
- package/shaders/types.js +1 -1
- package/textures/FlakesTexture.cjs.js +1 -0
- package/textures/FlakesTexture.js +10 -8
- package/types/helpers.cjs.js +1 -0
- package/types/helpers.js +2 -3
- package/types/shared.cjs.js +1 -0
- package/types/shared.js +1 -0
- package/types/utils.cjs.js +1 -0
- package/types/utils.js +1 -0
- package/utils/BufferGeometryUtils.cjs.js +1 -0
- package/utils/BufferGeometryUtils.js +325 -251
- package/utils/GeometryCompressionUtils.cjs.js +1 -0
- package/utils/GeometryCompressionUtils.js +239 -241
- package/utils/GeometryUtils.cjs.js +1 -0
- package/utils/GeometryUtils.js +94 -41
- package/utils/LDrawUtils.cjs.js +1 -0
- package/utils/LDrawUtils.d.ts +5 -0
- package/utils/LDrawUtils.js +144 -0
- package/utils/RoughnessMipmapper.cjs.js +1 -0
- package/utils/RoughnessMipmapper.js +82 -38
- package/utils/SceneUtils.cjs.js +1 -0
- package/utils/SceneUtils.js +20 -15
- package/utils/ShadowMapViewer.cjs.js +1 -0
- package/utils/ShadowMapViewer.js +95 -49
- package/utils/SkeletonUtils.cjs.js +1 -0
- package/utils/SkeletonUtils.js +165 -74
- package/utils/UVsDebug.cjs.js +1 -0
- package/utils/UVsDebug.js +62 -32
- package/utils/WorkerPool.cjs.js +1 -0
- package/utils/WorkerPool.js +33 -13
- package/webxr/ARButton.cjs.js +1 -0
- package/webxr/ARButton.js +98 -72
- package/webxr/OculusHandModel.cjs.js +1 -0
- package/webxr/OculusHandModel.js +37 -18
- package/webxr/OculusHandPointerModel.cjs.js +1 -0
- package/webxr/OculusHandPointerModel.js +80 -58
- package/webxr/Text2D.cjs.js +1 -0
- package/webxr/Text2D.js +19 -37
- package/webxr/VRButton.cjs.js +1 -0
- package/webxr/VRButton.js +90 -59
- package/webxr/XRControllerModelFactory.cjs.js +1 -0
- package/webxr/XRControllerModelFactory.js +116 -58
- package/webxr/XREstimatedLight.cjs.js +1 -0
- package/webxr/XREstimatedLight.js +66 -39
- package/webxr/XRHandMeshModel.cjs.js +1 -0
- package/webxr/XRHandMeshModel.js +29 -40
- package/webxr/XRHandModelFactory.cjs.js +1 -0
- package/webxr/XRHandModelFactory.js +31 -28
- package/webxr/XRHandPrimitiveModel.cjs.js +1 -0
- package/webxr/XRHandPrimitiveModel.js +27 -41
- package/animation/AnimationClipCreator.mjs +0 -57
- package/animation/CCDIKSolver.mjs +0 -223
- package/animation/MMDAnimationHelper.mjs +0 -514
- package/animation/MMDPhysics.mjs +0 -769
- package/cameras/CinematicCamera.mjs +0 -129
- package/controls/ArcballControls.mjs +0 -1737
- package/controls/DeviceOrientationControls.mjs +0 -74
- package/controls/DragControls.mjs +0 -172
- package/controls/FirstPersonControls.mjs +0 -220
- package/controls/FlyControls.mjs +0 -239
- package/controls/OrbitControls.mjs +0 -731
- package/controls/PointerLockControls.mjs +0 -88
- package/controls/TrackballControls.mjs +0 -481
- package/controls/TransformControls.mjs +0 -1068
- package/controls/experimental/CameraControls.mjs +0 -673
- package/csm/CSM.mjs +0 -244
- package/csm/CSMFrustum.mjs +0 -75
- package/csm/CSMHelper.mjs +0 -114
- package/csm/CSMShader.mjs +0 -251
- package/curves/CurveExtras.mjs +0 -224
- package/curves/NURBSCurve.mjs +0 -35
- package/curves/NURBSSurface.mjs +0 -28
- package/curves/NURBSUtils.mjs +0 -226
- package/deprecated/Geometry.mjs +0 -966
- package/effects/AnaglyphEffect.mjs +0 -120
- package/effects/AsciiEffect.mjs +0 -173
- package/effects/OutlineEffect.mjs +0 -295
- package/effects/ParallaxBarrierEffect.mjs +0 -64
- package/effects/PeppersGhostEffect.mjs +0 -85
- package/effects/StereoEffect.mjs +0 -32
- package/environments/RoomEnvironment.mjs +0 -78
- package/exporters/ColladaExporter.mjs +0 -299
- package/exporters/DRACOExporter.mjs +0 -132
- package/exporters/GLTFExporter.mjs +0 -1381
- package/exporters/MMDExporter.mjs +0 -102
- package/exporters/OBJExporter.mjs +0 -166
- package/exporters/PLYExporter.mjs +0 -278
- package/exporters/STLExporter.mjs +0 -129
- package/exporters/USDZExporter.mjs +0 -328
- package/geometries/BoxLineGeometry.mjs +0 -45
- package/geometries/ConvexGeometry.mjs +0 -29
- package/geometries/DecalGeometry.mjs +0 -184
- package/geometries/LightningStrike.mjs +0 -547
- package/geometries/ParametricGeometries.mjs +0 -129
- package/geometries/ParametricGeometry.mjs +0 -63
- package/geometries/RoundedBoxGeometry.mjs +0 -91
- package/geometries/TeapotGeometry.mjs +0 -1557
- package/geometries/TextGeometry.mjs +0 -23
- package/helpers/LightProbeHelper.mjs +0 -72
- package/helpers/PositionalAudioHelper.mjs +0 -68
- package/helpers/RectAreaLightHelper.mjs +0 -44
- package/helpers/VertexNormalsHelper.mjs +0 -54
- package/helpers/VertexTangentsHelper.mjs +0 -45
- package/index.mjs +0 -969
- package/interactive/SelectionBox.mjs +0 -137
- package/interactive/SelectionHelper.mjs +0 -54
- package/libs/MeshoptDecoder.mjs +0 -210
- package/libs/MotionControllers.mjs +0 -261
- package/lights/LightProbeGenerator.mjs +0 -145
- package/lights/RectAreaLightUniformsLib.mjs +0 -32842
- package/lines/Line2.mjs +0 -13
- package/lines/LineGeometry.mjs +0 -44
- package/lines/LineMaterial.mjs +0 -539
- package/lines/LineSegments2.mjs +0 -202
- package/lines/LineSegmentsGeometry.mjs +0 -124
- package/lines/Wireframe.mjs +0 -31
- package/lines/WireframeGeometry2.mjs +0 -13
- package/loaders/3DMLoader.mjs +0 -802
- package/loaders/3MFLoader.mjs +0 -837
- package/loaders/AMFLoader.mjs +0 -284
- package/loaders/AssimpLoader.mjs +0 -1396
- package/loaders/BVHLoader.mjs +0 -207
- package/loaders/BasisTextureLoader.mjs +0 -474
- package/loaders/ColladaLoader.mjs +0 -2403
- package/loaders/DDSLoader.mjs +0 -148
- package/loaders/DRACOLoader.mjs +0 -340
- package/loaders/EXRLoader.mjs +0 -1351
- package/loaders/FBXLoader.mjs +0 -2362
- package/loaders/FontLoader.mjs +0 -111
- package/loaders/GCodeLoader.mjs +0 -141
- package/loaders/GLTFLoader.mjs +0 -2316
- package/loaders/HDRCubeTextureLoader.mjs +0 -77
- package/loaders/KMZLoader.mjs +0 -75
- package/loaders/KTX2Loader.mjs +0 -427
- package/loaders/KTXLoader.mjs +0 -87
- package/loaders/LDrawLoader.mjs +0 -1409
- package/loaders/LUT3dlLoader.mjs +0 -100
- package/loaders/LUTCubeLoader.mjs +0 -104
- package/loaders/LWOLoader.mjs +0 -625
- package/loaders/LottieLoader.mjs +0 -47
- package/loaders/MD2Loader.mjs +0 -359
- package/loaders/MDDLoader.mjs +0 -58
- package/loaders/MMDLoader.mjs +0 -998
- package/loaders/MTLLoader.mjs +0 -280
- package/loaders/NRRDLoader.mjs +0 -401
- package/loaders/NodeMaterialLoader.mjs +0 -146
- package/loaders/OBJLoader.mjs +0 -487
- package/loaders/PCDLoader.mjs +0 -248
- package/loaders/PDBLoader.mjs +0 -246
- package/loaders/PLYLoader.mjs +0 -317
- package/loaders/PRWMLoader.mjs +0 -160
- package/loaders/PVRLoader.mjs +0 -131
- package/loaders/RGBELoader.mjs +0 -244
- package/loaders/RGBMLoader.mjs +0 -998
- package/loaders/STLLoader.mjs +0 -190
- package/loaders/SVGLoader.mjs +0 -1709
- package/loaders/TDSLoader.mjs +0 -480
- package/loaders/TGALoader.mjs +0 -285
- package/loaders/TTFLoader.mjs +0 -131
- package/loaders/TiltLoader.mjs +0 -373
- package/loaders/VOXLoader.mjs +0 -431
- package/loaders/VRMLLoader.mjs +0 -2093
- package/loaders/VRMLoader.mjs +0 -38
- package/loaders/VTKLoader.mjs +0 -646
- package/loaders/XLoader.mjs +0 -1258
- package/loaders/XYZLoader.mjs +0 -60
- package/loaders/lwo/IFFParser.mjs +0 -697
- package/loaders/lwo/LWO2Parser.mjs +0 -327
- package/loaders/lwo/LWO3Parser.mjs +0 -298
- package/math/Capsule.mjs +0 -100
- package/math/ColorConverter.mjs +0 -51
- package/math/ConvexHull.mjs +0 -574
- package/math/ImprovedNoise.mjs +0 -302
- package/math/Lut.mjs +0 -135
- package/math/MeshSurfaceSampler.mjs +0 -107
- package/math/OBB.mjs +0 -235
- package/math/Octree.mjs +0 -278
- package/math/SimplexNoise.mjs +0 -425
- package/misc/ConvexObjectBreaker.mjs +0 -292
- package/misc/GPUComputationRenderer.mjs +0 -171
- package/misc/Gyroscope.mjs +0 -35
- package/misc/MD2Character.mjs +0 -162
- package/misc/MD2CharacterComplex.mjs +0 -328
- package/misc/MorphAnimMesh.mjs +0 -40
- package/misc/MorphBlendMesh.mjs +0 -179
- package/misc/ProgressiveLightmap.mjs +0 -166
- package/misc/RollerCoaster.mjs +0 -346
- package/misc/TubePainter.mjs +0 -123
- package/misc/Volume.mjs +0 -244
- package/misc/VolumeSlice.mjs +0 -106
- package/misc/WebGL.mjs +0 -74
- package/modifiers/CurveModifier.mjs +0 -182
- package/modifiers/EdgeSplitModifier.mjs +0 -162
- package/modifiers/SimplifyModifier.mjs +0 -282
- package/modifiers/TessellateModifier.mjs +0 -206
- package/nodes/Nodes.mjs +0 -400
- package/nodes/ShaderNode.mjs +0 -408
- package/nodes/accessors/BufferNode.mjs +0 -15
- package/nodes/accessors/CameraNode.mjs +0 -44
- package/nodes/accessors/CubeTextureNode.mjs +0 -42
- package/nodes/accessors/MaterialNode.mjs +0 -71
- package/nodes/accessors/MaterialReferenceNode.mjs +0 -14
- package/nodes/accessors/ModelNode.mjs +0 -9
- package/nodes/accessors/ModelViewProjectionNode.mjs +0 -24
- package/nodes/accessors/NormalNode.mjs +0 -62
- package/nodes/accessors/Object3DNode.mjs +0 -76
- package/nodes/accessors/PointUVNode.mjs +0 -13
- package/nodes/accessors/PositionNode.mjs +0 -65
- package/nodes/accessors/ReferenceNode.mjs +0 -37
- package/nodes/accessors/ReflectNode.mjs +0 -43
- package/nodes/accessors/SkinningNode.mjs +0 -58
- package/nodes/accessors/TextureNode.mjs +0 -54
- package/nodes/accessors/UVNode.mjs +0 -23
- package/nodes/core/ArrayUniformNode.mjs +0 -14
- package/nodes/core/AttributeNode.mjs +0 -30
- package/nodes/core/BypassNode.mjs +0 -22
- package/nodes/core/CodeNode.mjs +0 -28
- package/nodes/core/ConstNode.mjs +0 -14
- package/nodes/core/ContextNode.mjs +0 -22
- package/nodes/core/ExpressionNode.mjs +0 -19
- package/nodes/core/FunctionCallNode.mjs +0 -37
- package/nodes/core/FunctionNode.mjs +0 -56
- package/nodes/core/InputNode.mjs +0 -38
- package/nodes/core/Node.mjs +0 -139
- package/nodes/core/NodeAttribute.mjs +0 -10
- package/nodes/core/NodeBuilder.mjs +0 -395
- package/nodes/core/NodeCode.mjs +0 -11
- package/nodes/core/NodeFrame.mjs +0 -35
- package/nodes/core/NodeFunctionInput.mjs +0 -13
- package/nodes/core/NodeKeywords.mjs +0 -44
- package/nodes/core/NodeUniform.mjs +0 -18
- package/nodes/core/NodeUtils.mjs +0 -57
- package/nodes/core/NodeVar.mjs +0 -10
- package/nodes/core/NodeVary.mjs +0 -10
- package/nodes/core/PropertyNode.mjs +0 -21
- package/nodes/core/TempNode.mjs +0 -25
- package/nodes/core/UniformNode.mjs +0 -23
- package/nodes/core/VarNode.mjs +0 -31
- package/nodes/core/VaryNode.mjs +0 -30
- package/nodes/core/constants.mjs +0 -24
- package/nodes/display/ColorSpaceNode.mjs +0 -63
- package/nodes/display/NormalMapNode.mjs +0 -54
- package/nodes/fog/FogNode.mjs +0 -15
- package/nodes/fog/FogRangeNode.mjs +0 -17
- package/nodes/functions/BSDFs.mjs +0 -64
- package/nodes/lights/LightContextNode.mjs +0 -35
- package/nodes/lights/LightNode.mjs +0 -58
- package/nodes/lights/LightsNode.mjs +0 -59
- package/nodes/loaders/NodeLoader.mjs +0 -66
- package/nodes/loaders/NodeMaterialLoader.mjs +0 -24
- package/nodes/loaders/NodeObjectLoader.mjs +0 -40
- package/nodes/materials/LineBasicNodeMaterial.mjs +0 -27
- package/nodes/materials/Materials.mjs +0 -28
- package/nodes/materials/MeshBasicNodeMaterial.mjs +0 -28
- package/nodes/materials/MeshStandardNodeMaterial.mjs +0 -41
- package/nodes/materials/NodeMaterial.mjs +0 -64
- package/nodes/materials/PointsNodeMaterial.mjs +0 -30
- package/nodes/math/CondNode.mjs +0 -38
- package/nodes/math/MathNode.mjs +0 -163
- package/nodes/math/OperatorNode.mjs +0 -103
- package/nodes/procedural/CheckerNode.mjs +0 -21
- package/nodes/utils/ArrayElementNode.mjs +0 -19
- package/nodes/utils/ConvertNode.mjs +0 -25
- package/nodes/utils/JoinNode.mjs +0 -26
- package/nodes/utils/MatcapUVNode.mjs +0 -16
- package/nodes/utils/OscNode.mjs +0 -50
- package/nodes/utils/SplitNode.mjs +0 -45
- package/nodes/utils/SpriteSheetUVNode.mjs +0 -40
- package/nodes/utils/TimerNode.mjs +0 -44
- package/objects/GroundProjectedEnv.mjs +0 -130
- package/objects/Lensflare.mjs +0 -262
- package/objects/LightningStorm.mjs +0 -110
- package/objects/MarchingCubes.mjs +0 -457
- package/objects/Reflector.mjs +0 -166
- package/objects/ReflectorForSSRPass.mjs +0 -247
- package/objects/ReflectorRTT.mjs +0 -10
- package/objects/Refractor.mjs +0 -178
- package/objects/ShadowMesh.mjs +0 -41
- package/objects/Sky.mjs +0 -124
- package/objects/Water.mjs +0 -235
- package/objects/Water2.mjs +0 -252
- package/offscreen/jank.mjs +0 -27
- package/offscreen/offscreen.mjs +0 -5
- package/offscreen/scene.mjs +0 -52
- package/physics/AmmoPhysics.mjs +0 -165
- package/postprocessing/AdaptiveToneMappingPass.mjs +0 -221
- package/postprocessing/AfterimagePass.mjs +0 -55
- package/postprocessing/BloomPass.mjs +0 -90
- package/postprocessing/BokehPass.mjs +0 -76
- package/postprocessing/ClearPass.mjs +0 -27
- package/postprocessing/CubeTexturePass.mjs +0 -49
- package/postprocessing/DotScreenPass.mjs +0 -40
- package/postprocessing/EffectComposer.mjs +0 -139
- package/postprocessing/FilmPass.mjs +0 -42
- package/postprocessing/GlitchPass.mjs +0 -75
- package/postprocessing/HalftonePass.mjs +0 -44
- package/postprocessing/LUTPass.mjs +0 -136
- package/postprocessing/MaskPass.mjs +0 -60
- package/postprocessing/OutlinePass.mjs +0 -438
- package/postprocessing/Pass.mjs +0 -37
- package/postprocessing/RenderPass.mjs +0 -48
- package/postprocessing/RenderPixelatedPass.mjs +0 -199
- package/postprocessing/SAOPass.mjs +0 -282
- package/postprocessing/SMAAPass.mjs +0 -112
- package/postprocessing/SSAARenderPass.mjs +0 -170
- package/postprocessing/SSAOPass.mjs +0 -265
- package/postprocessing/SSRPass.mjs +0 -432
- package/postprocessing/SavePass.mjs +0 -37
- package/postprocessing/ShaderPass.mjs +0 -39
- package/postprocessing/TAARenderPass.mjs +0 -88
- package/postprocessing/TexturePass.mjs +0 -39
- package/postprocessing/UnrealBloomPass.mjs +0 -220
- package/renderers/CSS2DRenderer.mjs +0 -112
- package/renderers/CSS3DRenderer.mjs +0 -133
- package/renderers/Projector.mjs +0 -511
- package/renderers/SVGRenderer.mjs +0 -306
- package/renderers/nodes/accessors/CameraNode.mjs +0 -63
- package/renderers/nodes/accessors/ModelNode.mjs +0 -61
- package/renderers/nodes/accessors/ModelViewProjectionNode.mjs +0 -21
- package/renderers/nodes/accessors/NormalNode.mjs +0 -61
- package/renderers/nodes/accessors/PositionNode.mjs +0 -30
- package/renderers/nodes/accessors/UVNode.mjs +0 -13
- package/renderers/nodes/core/AttributeNode.mjs +0 -35
- package/renderers/nodes/core/InputNode.mjs +0 -31
- package/renderers/nodes/core/Node.mjs +0 -34
- package/renderers/nodes/core/NodeAttribute.mjs +0 -10
- package/renderers/nodes/core/NodeBuilder.mjs +0 -243
- package/renderers/nodes/core/NodeFrame.mjs +0 -35
- package/renderers/nodes/core/NodeSlot.mjs +0 -10
- package/renderers/nodes/core/NodeUniform.mjs +0 -18
- package/renderers/nodes/core/NodeVary.mjs +0 -11
- package/renderers/nodes/core/VaryNode.mjs +0 -22
- package/renderers/nodes/core/constants.mjs +0 -22
- package/renderers/nodes/inputs/ColorNode.mjs +0 -11
- package/renderers/nodes/inputs/FloatNode.mjs +0 -11
- package/renderers/nodes/inputs/Matrix3Node.mjs +0 -12
- package/renderers/nodes/inputs/Matrix4Node.mjs +0 -12
- package/renderers/nodes/inputs/TextureNode.mjs +0 -20
- package/renderers/nodes/inputs/Vector2Node.mjs +0 -11
- package/renderers/nodes/inputs/Vector3Node.mjs +0 -12
- package/renderers/nodes/inputs/Vector4Node.mjs +0 -12
- package/renderers/nodes/math/MathNode.mjs +0 -55
- package/renderers/nodes/math/OperatorNode.mjs +0 -42
- package/renderers/nodes/utils/SwitchNode.mjs +0 -20
- package/renderers/nodes/utils/TimerNode.mjs +0 -14
- package/renderers/webgpu/WebGPU.mjs +0 -24
- package/renderers/webgpu/WebGPUAttributes.mjs +0 -69
- package/renderers/webgpu/WebGPUBackground.mjs +0 -61
- package/renderers/webgpu/WebGPUBinding.mjs +0 -14
- package/renderers/webgpu/WebGPUBindings.mjs +0 -155
- package/renderers/webgpu/WebGPUComputePipelines.mjs +0 -44
- package/renderers/webgpu/WebGPUGeometries.mjs +0 -41
- package/renderers/webgpu/WebGPUInfo.mjs +0 -46
- package/renderers/webgpu/WebGPUObjects.mjs +0 -25
- package/renderers/webgpu/WebGPUProperties.mjs +0 -22
- package/renderers/webgpu/WebGPURenderLists.mjs +0 -119
- package/renderers/webgpu/WebGPURenderPipelines.mjs +0 -545
- package/renderers/webgpu/WebGPURenderer.mjs +0 -574
- package/renderers/webgpu/WebGPUSampledTexture.mjs +0 -40
- package/renderers/webgpu/WebGPUSampler.mjs +0 -15
- package/renderers/webgpu/WebGPUStorageBuffer.mjs +0 -15
- package/renderers/webgpu/WebGPUTextureRenderer.mjs +0 -23
- package/renderers/webgpu/WebGPUTextureUtils.mjs +0 -98
- package/renderers/webgpu/WebGPUTextures.mjs +0 -484
- package/renderers/webgpu/WebGPUUniform.mjs +0 -81
- package/renderers/webgpu/WebGPUUniformsGroup.mjs +0 -176
- package/renderers/webgpu/constants.mjs +0 -230
- package/renderers/webgpu/nodes/ShaderLib.mjs +0 -42
- package/renderers/webgpu/nodes/WebGPUNodeBuilder.mjs +0 -165
- package/renderers/webgpu/nodes/WebGPUNodeUniform.mjs +0 -73
- package/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.mjs +0 -15
- package/renderers/webgpu/nodes/WebGPUNodes.mjs +0 -40
- package/shaders/ACESFilmicToneMappingShader.mjs +0 -48
- package/shaders/AfterimageShader.mjs +0 -32
- package/shaders/BasicShader.mjs +0 -12
- package/shaders/BleachBypassShader.mjs +0 -35
- package/shaders/BlendShader.mjs +0 -30
- package/shaders/BokehShader.mjs +0 -106
- package/shaders/BokehShader2.mjs +0 -269
- package/shaders/BrightnessContrastShader.mjs +0 -32
- package/shaders/ColorCorrectionShader.mjs +0 -30
- package/shaders/ColorifyShader.mjs +0 -28
- package/shaders/ConvolutionShader.mjs +0 -55
- package/shaders/CopyShader.mjs +0 -25
- package/shaders/DOFMipMapShader.mjs +0 -32
- package/shaders/DepthLimitedBlurShader.mjs +0 -114
- package/shaders/DigitalGlitch.mjs +0 -78
- package/shaders/DotScreenShader.mjs +0 -39
- package/shaders/FXAAShader.mjs +0 -1098
- package/shaders/FilmShader.mjs +0 -42
- package/shaders/FocusShader.mjs +0 -55
- package/shaders/FreiChenShader.mjs +0 -61
- package/shaders/FresnelShader.mjs +0 -47
- package/shaders/GammaCorrectionShader.mjs +0 -23
- package/shaders/GodRaysShader.mjs +0 -146
- package/shaders/HalftoneShader.mjs +0 -212
- package/shaders/HorizontalBlurShader.mjs +0 -43
- package/shaders/HorizontalTiltShiftShader.mjs +0 -37
- package/shaders/HueSaturationShader.mjs +0 -41
- package/shaders/KaleidoShader.mjs +0 -34
- package/shaders/LuminosityHighPassShader.mjs +0 -37
- package/shaders/LuminosityShader.mjs +0 -25
- package/shaders/MirrorShader.mjs +0 -35
- package/shaders/NormalMapShader.mjs +0 -31
- package/shaders/ParallaxShader.mjs +0 -113
- package/shaders/PixelShader.mjs +0 -28
- package/shaders/RGBShiftShader.mjs +0 -30
- package/shaders/SAOShader.mjs +0 -144
- package/shaders/SMAAShader.mjs +0 -272
- package/shaders/SSAOShader.mjs +0 -172
- package/shaders/SSRShader.mjs +0 -324
- package/shaders/SepiaShader.mjs +0 -29
- package/shaders/SobelOperatorShader.mjs +0 -44
- package/shaders/SubsurfaceScatteringShader.mjs +0 -59
- package/shaders/TechnicolorShader.mjs +0 -24
- package/shaders/ToneMapShader.mjs +0 -48
- package/shaders/ToonShader.mjs +0 -188
- package/shaders/TriangleBlurShader.mjs +0 -36
- package/shaders/UnpackDepthRGBAShader.mjs +0 -26
- package/shaders/VerticalBlurShader.mjs +0 -44
- package/shaders/VerticalTiltShiftShader.mjs +0 -37
- package/shaders/VignetteShader.mjs +0 -28
- package/shaders/VolumeShader.mjs +0 -178
- package/shaders/WaterRefractionShader.mjs +0 -57
- package/textures/FlakesTexture.mjs +0 -30
- package/types/helpers.mjs +0 -4
- package/utils/BufferGeometryUtils.mjs +0 -570
- package/utils/GeometryCompressionUtils.mjs +0 -547
- package/utils/GeometryUtils.mjs +0 -108
- package/utils/RoughnessMipmapper.mjs +0 -213
- package/utils/SceneUtils.mjs +0 -36
- package/utils/ShadowMapViewer.mjs +0 -114
- package/utils/SkeletonUtils.mjs +0 -292
- package/utils/UVsDebug.mjs +0 -85
- package/utils/WorkerPool.mjs +0 -62
- package/webxr/ARButton.mjs +0 -119
- package/webxr/OculusHandModel.mjs +0 -71
- package/webxr/OculusHandPointerModel.mjs +0 -207
- package/webxr/Text2D.mjs +0 -31
- package/webxr/VRButton.mjs +0 -105
- package/webxr/XRControllerModelFactory.mjs +0 -146
- package/webxr/XREstimatedLight.mjs +0 -126
- package/webxr/XRHandMeshModel.mjs +0 -73
- package/webxr/XRHandModelFactory.mjs +0 -61
- package/webxr/XRHandPrimitiveModel.mjs +0 -68
package/shaders/GodRaysShader.js
CHANGED
@@ -1,77 +1,96 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
import { Vector3, Color } from 'three';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* God-rays (crepuscular rays)
|
5
|
+
*
|
6
|
+
* Similar implementation to the one used by Crytek for CryEngine 2 [Sousa2008].
|
7
|
+
* Blurs a mask generated from the depth map along radial lines emanating from the light
|
8
|
+
* source. The blur repeatedly applies a blur filter of increasing support but constant
|
9
|
+
* sample count to produce a blur filter with large support.
|
10
|
+
*
|
11
|
+
* My implementation performs 3 passes, similar to the implementation from Sousa. I found
|
12
|
+
* just 6 samples per pass produced acceptible results. The blur is applied three times,
|
13
|
+
* with decreasing filter support. The result is equivalent to a single pass with
|
14
|
+
* 6*6*6 = 216 samples.
|
15
|
+
*
|
16
|
+
* References:
|
17
|
+
*
|
18
|
+
* Sousa2008 - Crysis Next Gen Effects, GDC2008, http://www.crytek.com/sites/default/files/GDC08_SousaT_CrysisEffects.ppt
|
19
|
+
*/
|
20
|
+
|
4
21
|
const GodRaysDepthMaskShader = {
|
5
22
|
uniforms: {
|
6
23
|
tInput: {
|
7
24
|
value: null
|
8
25
|
}
|
9
26
|
},
|
10
|
-
vertexShader: [
|
11
|
-
|
12
|
-
"void main() {",
|
13
|
-
" vUv = uv;",
|
14
|
-
" gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
|
15
|
-
"}"
|
16
|
-
].join("\n"),
|
17
|
-
fragmentShader: [
|
18
|
-
"varying vec2 vUv;",
|
19
|
-
"uniform sampler2D tInput;",
|
20
|
-
"void main() {",
|
21
|
-
" gl_FragColor = vec4( 1.0 ) - texture2D( tInput, vUv );",
|
22
|
-
"}"
|
23
|
-
].join("\n")
|
27
|
+
vertexShader: ['varying vec2 vUv;', 'void main() {', ' vUv = uv;', ' gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
|
28
|
+
fragmentShader: ['varying vec2 vUv;', 'uniform sampler2D tInput;', 'void main() {', ' gl_FragColor = vec4( 1.0 ) - texture2D( tInput, vUv );', '}'].join('\n')
|
24
29
|
};
|
30
|
+
/**
|
31
|
+
* The god-ray generation shader.
|
32
|
+
*
|
33
|
+
* First pass:
|
34
|
+
*
|
35
|
+
* The depth map is blurred along radial lines towards the "sun". The
|
36
|
+
* output is written to a temporary render target (I used a 1/4 sized
|
37
|
+
* target).
|
38
|
+
*
|
39
|
+
* Pass two & three:
|
40
|
+
*
|
41
|
+
* The results of the previous pass are re-blurred, each time with a
|
42
|
+
* decreased distance between samples.
|
43
|
+
*/
|
44
|
+
|
25
45
|
const GodRaysGenerateShader = {
|
26
46
|
uniforms: {
|
27
47
|
tInput: {
|
28
48
|
value: null
|
29
49
|
},
|
30
50
|
fStepSize: {
|
31
|
-
value: 1
|
51
|
+
value: 1.0
|
32
52
|
},
|
33
53
|
vSunPositionScreenSpace: {
|
34
|
-
value: new
|
54
|
+
value: new Vector3()
|
35
55
|
}
|
36
56
|
},
|
37
|
-
vertexShader: [
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
" if ( 5.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;",
|
69
|
-
" uv += stepv;",
|
70
|
-
" gl_FragColor = vec4( col/TAPS_PER_PASS );",
|
71
|
-
" gl_FragColor.a = 1.0;",
|
72
|
-
"}"
|
73
|
-
].join("\n")
|
57
|
+
vertexShader: ['varying vec2 vUv;', 'void main() {', ' vUv = uv;', ' gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
|
58
|
+
fragmentShader: ['#define TAPS_PER_PASS 6.0', 'varying vec2 vUv;', 'uniform sampler2D tInput;', 'uniform vec3 vSunPositionScreenSpace;', 'uniform float fStepSize;', // filter step size
|
59
|
+
'void main() {', // delta from current pixel to "sun" position
|
60
|
+
' vec2 delta = vSunPositionScreenSpace.xy - vUv;', ' float dist = length( delta );', // Step vector (uv space)
|
61
|
+
' vec2 stepv = fStepSize * delta / dist;', // Number of iterations between pixel and sun
|
62
|
+
' float iters = dist/fStepSize;', ' vec2 uv = vUv.xy;', ' float col = 0.0;', // This breaks ANGLE in Chrome 22
|
63
|
+
// - see http://code.google.com/p/chromium/issues/detail?id=153105
|
64
|
+
|
65
|
+
/*
|
66
|
+
// Unrolling didnt do much on my hardware (ATI Mobility Radeon 3450),
|
67
|
+
// so i've just left the loop
|
68
|
+
"for ( float i = 0.0; i < TAPS_PER_PASS; i += 1.0 ) {",
|
69
|
+
// Accumulate samples, making sure we dont walk past the light source.
|
70
|
+
// The check for uv.y < 1 would not be necessary with "border" UV wrap
|
71
|
+
// mode, with a black border color. I don't think this is currently
|
72
|
+
// exposed by three.js. As a result there might be artifacts when the
|
73
|
+
// sun is to the left, right or bottom of screen as these cases are
|
74
|
+
// not specifically handled.
|
75
|
+
" col += ( i <= iters && uv.y < 1.0 ? texture2D( tInput, uv ).r : 0.0 );",
|
76
|
+
" uv += stepv;",
|
77
|
+
"}",
|
78
|
+
*/
|
79
|
+
// Unrolling loop manually makes it work in ANGLE
|
80
|
+
' float f = min( 1.0, max( vSunPositionScreenSpace.z / 1000.0, 0.0 ) );', // used to fade out godrays
|
81
|
+
' if ( 0.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;', ' uv += stepv;', ' if ( 1.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;', ' uv += stepv;', ' if ( 2.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;', ' uv += stepv;', ' if ( 3.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;', ' uv += stepv;', ' if ( 4.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;', ' uv += stepv;', ' if ( 5.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r * f;', ' uv += stepv;', // Should technically be dividing by 'iters', but 'TAPS_PER_PASS' smooths out
|
82
|
+
// objectionable artifacts, in particular near the sun position. The side
|
83
|
+
// effect is that the result is darker than it should be around the sun, as
|
84
|
+
// TAPS_PER_PASS is greater than the number of samples actually accumulated.
|
85
|
+
// When the result is inverted (in the shader 'godrays_combine', this produces
|
86
|
+
// a slight bright spot at the position of the sun, even when it is occluded.
|
87
|
+
' gl_FragColor = vec4( col/TAPS_PER_PASS );', ' gl_FragColor.a = 1.0;', '}'].join('\n')
|
74
88
|
};
|
89
|
+
/**
|
90
|
+
* Additively applies god rays from texture tGodRays to a background (tColors).
|
91
|
+
* fGodRayIntensity attenuates the god rays.
|
92
|
+
*/
|
93
|
+
|
75
94
|
const GodRaysCombineShader = {
|
76
95
|
uniforms: {
|
77
96
|
tColors: {
|
@@ -84,63 +103,35 @@ const GodRaysCombineShader = {
|
|
84
103
|
value: 0.69
|
85
104
|
}
|
86
105
|
},
|
87
|
-
vertexShader: [
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
"}"
|
93
|
-
].join("\n"),
|
94
|
-
fragmentShader: [
|
95
|
-
"varying vec2 vUv;",
|
96
|
-
"uniform sampler2D tColors;",
|
97
|
-
"uniform sampler2D tGodRays;",
|
98
|
-
"uniform float fGodRayIntensity;",
|
99
|
-
"void main() {",
|
100
|
-
" gl_FragColor = texture2D( tColors, vUv ) + fGodRayIntensity * vec4( 1.0 - texture2D( tGodRays, vUv ).r );",
|
101
|
-
" gl_FragColor.a = 1.0;",
|
102
|
-
"}"
|
103
|
-
].join("\n")
|
106
|
+
vertexShader: ['varying vec2 vUv;', 'void main() {', ' vUv = uv;', ' gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
|
107
|
+
fragmentShader: ['varying vec2 vUv;', 'uniform sampler2D tColors;', 'uniform sampler2D tGodRays;', 'uniform float fGodRayIntensity;', 'void main() {', // Since THREE.MeshDepthMaterial renders foreground objects white and background
|
108
|
+
// objects black, the god-rays will be white streaks. Therefore value is inverted
|
109
|
+
// before being combined with tColors
|
110
|
+
' gl_FragColor = texture2D( tColors, vUv ) + fGodRayIntensity * vec4( 1.0 - texture2D( tGodRays, vUv ).r );', ' gl_FragColor.a = 1.0;', '}'].join('\n')
|
104
111
|
};
|
112
|
+
/**
|
113
|
+
* A dodgy sun/sky shader. Makes a bright spot at the sun location. Would be
|
114
|
+
* cheaper/faster/simpler to implement this as a simple sun sprite.
|
115
|
+
*/
|
116
|
+
|
105
117
|
const GodRaysFakeSunShader = {
|
106
118
|
uniforms: {
|
107
119
|
vSunPositionScreenSpace: {
|
108
|
-
value: new
|
120
|
+
value: new Vector3()
|
109
121
|
},
|
110
122
|
fAspect: {
|
111
|
-
value: 1
|
123
|
+
value: 1.0
|
112
124
|
},
|
113
125
|
sunColor: {
|
114
|
-
value: new
|
126
|
+
value: new Color(0xffee00)
|
115
127
|
},
|
116
128
|
bgColor: {
|
117
|
-
value: new
|
129
|
+
value: new Color(0x000000)
|
118
130
|
}
|
119
131
|
},
|
120
|
-
vertexShader: [
|
121
|
-
|
122
|
-
|
123
|
-
" vUv = uv;",
|
124
|
-
" gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
|
125
|
-
"}"
|
126
|
-
].join("\n"),
|
127
|
-
fragmentShader: [
|
128
|
-
"varying vec2 vUv;",
|
129
|
-
"uniform vec3 vSunPositionScreenSpace;",
|
130
|
-
"uniform float fAspect;",
|
131
|
-
"uniform vec3 sunColor;",
|
132
|
-
"uniform vec3 bgColor;",
|
133
|
-
"void main() {",
|
134
|
-
" vec2 diff = vUv - vSunPositionScreenSpace.xy;",
|
135
|
-
" diff.x *= fAspect;",
|
136
|
-
" float prop = clamp( length( diff ) / 0.5, 0.0, 1.0 );",
|
137
|
-
" prop = 0.35 * pow( 1.0 - prop, 3.0 );",
|
138
|
-
" gl_FragColor.xyz = ( vSunPositionScreenSpace.z > 0.0 ) ? mix( sunColor, bgColor, 1.0 - prop ) : bgColor;",
|
139
|
-
" gl_FragColor.w = 1.0;",
|
140
|
-
"}"
|
141
|
-
].join("\n")
|
132
|
+
vertexShader: ['varying vec2 vUv;', 'void main() {', ' vUv = uv;', ' gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
|
133
|
+
fragmentShader: ['varying vec2 vUv;', 'uniform vec3 vSunPositionScreenSpace;', 'uniform float fAspect;', 'uniform vec3 sunColor;', 'uniform vec3 bgColor;', 'void main() {', ' vec2 diff = vUv - vSunPositionScreenSpace.xy;', // Correct for aspect ratio
|
134
|
+
' diff.x *= fAspect;', ' float prop = clamp( length( diff ) / 0.5, 0.0, 1.0 );', ' prop = 0.35 * pow( 1.0 - prop, 3.0 );', ' gl_FragColor.xyz = ( vSunPositionScreenSpace.z > 0.0 ) ? mix( sunColor, bgColor, 1.0 - prop ) : bgColor;', ' gl_FragColor.w = 1.0;', '}'].join('\n')
|
142
135
|
};
|
143
|
-
|
144
|
-
|
145
|
-
exports.GodRaysFakeSunShader = GodRaysFakeSunShader;
|
146
|
-
exports.GodRaysGenerateShader = GodRaysGenerateShader;
|
136
|
+
|
137
|
+
export { GodRaysCombineShader, GodRaysDepthMaskShader, GodRaysFakeSunShader, GodRaysGenerateShader };
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const t={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","\tvUV = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","\treturn a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","\treturn sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","\tfloat dist = hypot( coord.x - p.x, coord.y - p.y );","\tfloat rad = channel;","\tif ( shape == SHAPE_DOT ) {","\t\trad = pow( abs( rad ), 1.125 ) * rad_max;","\t} else if ( shape == SHAPE_ELLIPSE ) {","\t\trad = pow( abs( rad ), 1.125 ) * rad_max;","\t\tif ( dist != 0.0 ) {","\t\t\tfloat dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","\t\t\tdist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","\t\t}","\t} else if ( shape == SHAPE_LINE ) {","\t\trad = pow( abs( rad ), 1.5) * rad_max;","\t\tfloat dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","\t\tdist = hypot( normal.x * dot_p, normal.y * dot_p );","\t} else if ( shape == SHAPE_SQUARE ) {","\t\tfloat theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","\t\tfloat sin_t = abs( sin( theta ) );","\t\tfloat cos_t = abs( cos( theta ) );","\t\trad = pow( abs( rad ), 1.4 );","\t\trad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","\t}","\treturn rad - dist;","}","struct Cell {","\tvec2 normal;","\tvec2 p1;","\tvec2 p2;","\tvec2 p3;","\tvec2 p4;","\tfloat samp2;","\tfloat samp1;","\tfloat samp3;","\tfloat samp4;","};","vec4 getSample( vec2 point ) {","\tvec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","\tfloat base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","\tfloat step = PI2 / float( samples );","\tfloat dist = radius * 0.66;","\tfor ( int i = 0; i < samples; ++i ) {","\t\tfloat r = base + step * float( i );","\t\tvec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","\t\ttex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","\t}","\ttex /= float( samples ) + 1.0;","\treturn tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","\tfloat dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","\tif ( channel == 0 ) {","\t\tc.samp1 = getSample( c.p1 ).r;","\t\tc.samp2 = getSample( c.p2 ).r;","\t\tc.samp3 = getSample( c.p3 ).r;","\t\tc.samp4 = getSample( c.p4 ).r;","\t} else if (channel == 1) {","\t\tc.samp1 = getSample( c.p1 ).g;","\t\tc.samp2 = getSample( c.p2 ).g;","\t\tc.samp3 = getSample( c.p3 ).g;","\t\tc.samp4 = getSample( c.p4 ).g;","\t} else {","\t\tc.samp1 = getSample( c.p1 ).b;","\t\tc.samp3 = getSample( c.p3 ).b;","\t\tc.samp2 = getSample( c.p2 ).b;","\t\tc.samp4 = getSample( c.p4 ).b;","\t}","\tdist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","\tdist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","\tdist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","\tdist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","\tres = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","\tres = clamp( res, 0.0, 1.0 );","\treturn res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","\tCell c;","\tvec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","\tfloat threshold = step * 0.5;","\tfloat dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","\tfloat dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","\tvec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","\tfloat offset_normal = mod( hypot( offset.x, offset.y ), step );","\tfloat normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","\tfloat normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","\tfloat offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","\tfloat line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","\tfloat line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","\tc.normal = n;","\tc.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","\tc.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","\tif ( scatter != 0.0 ) {","\t\tfloat off_mag = scatter * threshold * 0.5;","\t\tfloat off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","\t\tc.p1.x += cos( off_angle ) * off_mag;","\t\tc.p1.y += sin( off_angle ) * off_mag;","\t}","\tfloat normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","\tfloat line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","\tc.p2.x = c.p1.x - n.x * normal_step;","\tc.p2.y = c.p1.y - n.y * normal_step;","\tc.p3.x = c.p1.x + n.y * line_step;","\tc.p3.y = c.p1.y - n.x * line_step;","\tc.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","\tc.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","\treturn c;","}","float blendColour( float a, float b, float t ) {","\tif ( blendingMode == BLENDING_LINEAR ) {","\t\treturn blend( a, b, 1.0 - t );","\t} else if ( blendingMode == BLENDING_ADD ) {","\t\treturn blend( a, min( 1.0, a + b ), t );","\t} else if ( blendingMode == BLENDING_MULTIPLY ) {","\t\treturn blend( a, max( 0.0, a * b ), t );","\t} else if ( blendingMode == BLENDING_LIGHTER ) {","\t\treturn blend( a, max( a, b ), t );","\t} else if ( blendingMode == BLENDING_DARKER ) {","\t\treturn blend( a, min( a, b ), t );","\t} else {","\t\treturn blend( a, b, 1.0 - t );","\t}","}","void main() {","\tif ( ! disable ) {","\t\tvec2 p = vec2( vUV.x * width, vUV.y * height );","\t\tvec2 origin = vec2( 0, 0 );","\t\tfloat aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","\t\tCell cell_r = getReferenceCell( p, origin, rotateR, radius );","\t\tCell cell_g = getReferenceCell( p, origin, rotateG, radius );","\t\tCell cell_b = getReferenceCell( p, origin, rotateB, radius );","\t\tfloat r = getDotColour( cell_r, p, 0, rotateR, aa );","\t\tfloat g = getDotColour( cell_g, p, 1, rotateG, aa );","\t\tfloat b = getDotColour( cell_b, p, 2, rotateB, aa );","\t\tvec4 colour = texture2D( tDiffuse, vUV );","\t\tr = blendColour( r, colour.r, blending );","\t\tg = blendColour( g, colour.g, blending );","\t\tb = blendColour( b, colour.b, blending );","\t\tif ( greyscale ) {","\t\t\tr = g = b = (r + b + g) / 3.0;","\t\t}","\t\tgl_FragColor = vec4( r, g, b, 1.0 );","\t} else {","\t\tgl_FragColor = texture2D( tDiffuse, vUV );","\t}","}"].join("\n")};exports.HalftoneShader=t;
|
@@ -1,212 +1,69 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
/**
|
2
|
+
* RGB Halftone shader for three.js.
|
3
|
+
* NOTE:
|
4
|
+
* Shape (1 = Dot, 2 = Ellipse, 3 = Line, 4 = Square)
|
5
|
+
* Blending Mode (1 = Linear, 2 = Multiply, 3 = Add, 4 = Lighter, 5 = Darker)
|
6
|
+
*/
|
3
7
|
const HalftoneShader = {
|
4
8
|
uniforms: {
|
5
|
-
tDiffuse: {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
9
|
+
tDiffuse: {
|
10
|
+
value: null
|
11
|
+
},
|
12
|
+
shape: {
|
13
|
+
value: 1
|
14
|
+
},
|
15
|
+
radius: {
|
16
|
+
value: 4
|
17
|
+
},
|
18
|
+
rotateR: {
|
19
|
+
value: Math.PI / 12 * 1
|
20
|
+
},
|
21
|
+
rotateG: {
|
22
|
+
value: Math.PI / 12 * 2
|
23
|
+
},
|
24
|
+
rotateB: {
|
25
|
+
value: Math.PI / 12 * 3
|
26
|
+
},
|
27
|
+
scatter: {
|
28
|
+
value: 0
|
29
|
+
},
|
30
|
+
width: {
|
31
|
+
value: 1
|
32
|
+
},
|
33
|
+
height: {
|
34
|
+
value: 1
|
35
|
+
},
|
36
|
+
blending: {
|
37
|
+
value: 1
|
38
|
+
},
|
39
|
+
blendingMode: {
|
40
|
+
value: 1
|
41
|
+
},
|
42
|
+
greyscale: {
|
43
|
+
value: false
|
44
|
+
},
|
45
|
+
disable: {
|
46
|
+
value: false
|
47
|
+
}
|
18
48
|
},
|
19
|
-
vertexShader: [
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
"#define BLENDING_LIGHTER 4",
|
38
|
-
"#define BLENDING_DARKER 5",
|
39
|
-
"uniform sampler2D tDiffuse;",
|
40
|
-
"uniform float radius;",
|
41
|
-
"uniform float rotateR;",
|
42
|
-
"uniform float rotateG;",
|
43
|
-
"uniform float rotateB;",
|
44
|
-
"uniform float scatter;",
|
45
|
-
"uniform float width;",
|
46
|
-
"uniform float height;",
|
47
|
-
"uniform int shape;",
|
48
|
-
"uniform bool disable;",
|
49
|
-
"uniform float blending;",
|
50
|
-
"uniform int blendingMode;",
|
51
|
-
"varying vec2 vUV;",
|
52
|
-
"uniform bool greyscale;",
|
53
|
-
"const int samples = 8;",
|
54
|
-
"float blend( float a, float b, float t ) {",
|
55
|
-
" return a * ( 1.0 - t ) + b * t;",
|
56
|
-
"}",
|
57
|
-
"float hypot( float x, float y ) {",
|
58
|
-
" return sqrt( x * x + y * y );",
|
59
|
-
"}",
|
60
|
-
"float rand( vec2 seed ){",
|
61
|
-
"return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );",
|
62
|
-
"}",
|
63
|
-
"float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {",
|
64
|
-
" float dist = hypot( coord.x - p.x, coord.y - p.y );",
|
65
|
-
" float rad = channel;",
|
66
|
-
" if ( shape == SHAPE_DOT ) {",
|
67
|
-
" rad = pow( abs( rad ), 1.125 ) * rad_max;",
|
68
|
-
" } else if ( shape == SHAPE_ELLIPSE ) {",
|
69
|
-
" rad = pow( abs( rad ), 1.125 ) * rad_max;",
|
70
|
-
" if ( dist != 0.0 ) {",
|
71
|
-
" float dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );",
|
72
|
-
" dist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;",
|
73
|
-
" }",
|
74
|
-
" } else if ( shape == SHAPE_LINE ) {",
|
75
|
-
" rad = pow( abs( rad ), 1.5) * rad_max;",
|
76
|
-
" float dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;",
|
77
|
-
" dist = hypot( normal.x * dot_p, normal.y * dot_p );",
|
78
|
-
" } else if ( shape == SHAPE_SQUARE ) {",
|
79
|
-
" float theta = atan( p.y - coord.y, p.x - coord.x ) - angle;",
|
80
|
-
" float sin_t = abs( sin( theta ) );",
|
81
|
-
" float cos_t = abs( cos( theta ) );",
|
82
|
-
" rad = pow( abs( rad ), 1.4 );",
|
83
|
-
" rad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );",
|
84
|
-
" }",
|
85
|
-
" return rad - dist;",
|
86
|
-
"}",
|
87
|
-
"struct Cell {",
|
88
|
-
" vec2 normal;",
|
89
|
-
" vec2 p1;",
|
90
|
-
" vec2 p2;",
|
91
|
-
" vec2 p3;",
|
92
|
-
" vec2 p4;",
|
93
|
-
" float samp2;",
|
94
|
-
" float samp1;",
|
95
|
-
" float samp3;",
|
96
|
-
" float samp4;",
|
97
|
-
"};",
|
98
|
-
"vec4 getSample( vec2 point ) {",
|
99
|
-
" vec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );",
|
100
|
-
" float base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;",
|
101
|
-
" float step = PI2 / float( samples );",
|
102
|
-
" float dist = radius * 0.66;",
|
103
|
-
" for ( int i = 0; i < samples; ++i ) {",
|
104
|
-
" float r = base + step * float( i );",
|
105
|
-
" vec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );",
|
106
|
-
" tex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );",
|
107
|
-
" }",
|
108
|
-
" tex /= float( samples ) + 1.0;",
|
109
|
-
" return tex;",
|
110
|
-
"}",
|
111
|
-
"float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {",
|
112
|
-
" float dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;",
|
113
|
-
" if ( channel == 0 ) {",
|
114
|
-
" c.samp1 = getSample( c.p1 ).r;",
|
115
|
-
" c.samp2 = getSample( c.p2 ).r;",
|
116
|
-
" c.samp3 = getSample( c.p3 ).r;",
|
117
|
-
" c.samp4 = getSample( c.p4 ).r;",
|
118
|
-
" } else if (channel == 1) {",
|
119
|
-
" c.samp1 = getSample( c.p1 ).g;",
|
120
|
-
" c.samp2 = getSample( c.p2 ).g;",
|
121
|
-
" c.samp3 = getSample( c.p3 ).g;",
|
122
|
-
" c.samp4 = getSample( c.p4 ).g;",
|
123
|
-
" } else {",
|
124
|
-
" c.samp1 = getSample( c.p1 ).b;",
|
125
|
-
" c.samp3 = getSample( c.p3 ).b;",
|
126
|
-
" c.samp2 = getSample( c.p2 ).b;",
|
127
|
-
" c.samp4 = getSample( c.p4 ).b;",
|
128
|
-
" }",
|
129
|
-
" dist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );",
|
130
|
-
" dist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );",
|
131
|
-
" dist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );",
|
132
|
-
" dist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );",
|
133
|
-
" res = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;",
|
134
|
-
" res += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;",
|
135
|
-
" res += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;",
|
136
|
-
" res += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;",
|
137
|
-
" res = clamp( res, 0.0, 1.0 );",
|
138
|
-
" return res;",
|
139
|
-
"}",
|
140
|
-
"Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {",
|
141
|
-
" Cell c;",
|
142
|
-
" vec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );",
|
143
|
-
" float threshold = step * 0.5;",
|
144
|
-
" float dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );",
|
145
|
-
" float dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );",
|
146
|
-
" vec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );",
|
147
|
-
" float offset_normal = mod( hypot( offset.x, offset.y ), step );",
|
148
|
-
" float normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;",
|
149
|
-
" float normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;",
|
150
|
-
" float offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );",
|
151
|
-
" float line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;",
|
152
|
-
" float line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;",
|
153
|
-
" c.normal = n;",
|
154
|
-
" c.p1.x = p.x - n.x * normal_scale + n.y * line_scale;",
|
155
|
-
" c.p1.y = p.y - n.y * normal_scale - n.x * line_scale;",
|
156
|
-
" if ( scatter != 0.0 ) {",
|
157
|
-
" float off_mag = scatter * threshold * 0.5;",
|
158
|
-
" float off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;",
|
159
|
-
" c.p1.x += cos( off_angle ) * off_mag;",
|
160
|
-
" c.p1.y += sin( off_angle ) * off_mag;",
|
161
|
-
" }",
|
162
|
-
" float normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );",
|
163
|
-
" float line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );",
|
164
|
-
" c.p2.x = c.p1.x - n.x * normal_step;",
|
165
|
-
" c.p2.y = c.p1.y - n.y * normal_step;",
|
166
|
-
" c.p3.x = c.p1.x + n.y * line_step;",
|
167
|
-
" c.p3.y = c.p1.y - n.x * line_step;",
|
168
|
-
" c.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;",
|
169
|
-
" c.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;",
|
170
|
-
" return c;",
|
171
|
-
"}",
|
172
|
-
"float blendColour( float a, float b, float t ) {",
|
173
|
-
" if ( blendingMode == BLENDING_LINEAR ) {",
|
174
|
-
" return blend( a, b, 1.0 - t );",
|
175
|
-
" } else if ( blendingMode == BLENDING_ADD ) {",
|
176
|
-
" return blend( a, min( 1.0, a + b ), t );",
|
177
|
-
" } else if ( blendingMode == BLENDING_MULTIPLY ) {",
|
178
|
-
" return blend( a, max( 0.0, a * b ), t );",
|
179
|
-
" } else if ( blendingMode == BLENDING_LIGHTER ) {",
|
180
|
-
" return blend( a, max( a, b ), t );",
|
181
|
-
" } else if ( blendingMode == BLENDING_DARKER ) {",
|
182
|
-
" return blend( a, min( a, b ), t );",
|
183
|
-
" } else {",
|
184
|
-
" return blend( a, b, 1.0 - t );",
|
185
|
-
" }",
|
186
|
-
"}",
|
187
|
-
"void main() {",
|
188
|
-
" if ( ! disable ) {",
|
189
|
-
" vec2 p = vec2( vUV.x * width, vUV.y * height );",
|
190
|
-
" vec2 origin = vec2( 0, 0 );",
|
191
|
-
" float aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;",
|
192
|
-
" Cell cell_r = getReferenceCell( p, origin, rotateR, radius );",
|
193
|
-
" Cell cell_g = getReferenceCell( p, origin, rotateG, radius );",
|
194
|
-
" Cell cell_b = getReferenceCell( p, origin, rotateB, radius );",
|
195
|
-
" float r = getDotColour( cell_r, p, 0, rotateR, aa );",
|
196
|
-
" float g = getDotColour( cell_g, p, 1, rotateG, aa );",
|
197
|
-
" float b = getDotColour( cell_b, p, 2, rotateB, aa );",
|
198
|
-
" vec4 colour = texture2D( tDiffuse, vUV );",
|
199
|
-
" r = blendColour( r, colour.r, blending );",
|
200
|
-
" g = blendColour( g, colour.g, blending );",
|
201
|
-
" b = blendColour( b, colour.b, blending );",
|
202
|
-
" if ( greyscale ) {",
|
203
|
-
" r = g = b = (r + b + g) / 3.0;",
|
204
|
-
" }",
|
205
|
-
" gl_FragColor = vec4( r, g, b, 1.0 );",
|
206
|
-
" } else {",
|
207
|
-
" gl_FragColor = texture2D( tDiffuse, vUV );",
|
208
|
-
" }",
|
209
|
-
"}"
|
210
|
-
].join("\n")
|
49
|
+
vertexShader: ['varying vec2 vUV;', 'void main() {', ' vUV = uv;', ' gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);', '}'].join('\n'),
|
50
|
+
fragmentShader: ['#define SQRT2_MINUS_ONE 0.41421356', '#define SQRT2_HALF_MINUS_ONE 0.20710678', '#define PI2 6.28318531', '#define SHAPE_DOT 1', '#define SHAPE_ELLIPSE 2', '#define SHAPE_LINE 3', '#define SHAPE_SQUARE 4', '#define BLENDING_LINEAR 1', '#define BLENDING_MULTIPLY 2', '#define BLENDING_ADD 3', '#define BLENDING_LIGHTER 4', '#define BLENDING_DARKER 5', 'uniform sampler2D tDiffuse;', 'uniform float radius;', 'uniform float rotateR;', 'uniform float rotateG;', 'uniform float rotateB;', 'uniform float scatter;', 'uniform float width;', 'uniform float height;', 'uniform int shape;', 'uniform bool disable;', 'uniform float blending;', 'uniform int blendingMode;', 'varying vec2 vUV;', 'uniform bool greyscale;', 'const int samples = 8;', 'float blend( float a, float b, float t ) {', // linear blend
|
51
|
+
' return a * ( 1.0 - t ) + b * t;', '}', 'float hypot( float x, float y ) {', // vector magnitude
|
52
|
+
' return sqrt( x * x + y * y );', '}', 'float rand( vec2 seed ){', // get pseudo-random number
|
53
|
+
'return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );', '}', 'float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {', // apply shape-specific transforms
|
54
|
+
' float dist = hypot( coord.x - p.x, coord.y - p.y );', ' float rad = channel;', ' if ( shape == SHAPE_DOT ) {', ' rad = pow( abs( rad ), 1.125 ) * rad_max;', ' } else if ( shape == SHAPE_ELLIPSE ) {', ' rad = pow( abs( rad ), 1.125 ) * rad_max;', ' if ( dist != 0.0 ) {', ' float dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );', ' dist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;', ' }', ' } else if ( shape == SHAPE_LINE ) {', ' rad = pow( abs( rad ), 1.5) * rad_max;', ' float dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;', ' dist = hypot( normal.x * dot_p, normal.y * dot_p );', ' } else if ( shape == SHAPE_SQUARE ) {', ' float theta = atan( p.y - coord.y, p.x - coord.x ) - angle;', ' float sin_t = abs( sin( theta ) );', ' float cos_t = abs( cos( theta ) );', ' rad = pow( abs( rad ), 1.4 );', ' rad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );', ' }', ' return rad - dist;', '}', 'struct Cell {', // grid sample positions
|
55
|
+
' vec2 normal;', ' vec2 p1;', ' vec2 p2;', ' vec2 p3;', ' vec2 p4;', ' float samp2;', ' float samp1;', ' float samp3;', ' float samp4;', '};', 'vec4 getSample( vec2 point ) {', // multi-sampled point
|
56
|
+
' vec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );', ' float base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;', ' float step = PI2 / float( samples );', ' float dist = radius * 0.66;', ' for ( int i = 0; i < samples; ++i ) {', ' float r = base + step * float( i );', ' vec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );', ' tex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );', ' }', ' tex /= float( samples ) + 1.0;', ' return tex;', '}', 'float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {', // get colour for given point
|
57
|
+
' float dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;', ' if ( channel == 0 ) {', ' c.samp1 = getSample( c.p1 ).r;', ' c.samp2 = getSample( c.p2 ).r;', ' c.samp3 = getSample( c.p3 ).r;', ' c.samp4 = getSample( c.p4 ).r;', ' } else if (channel == 1) {', ' c.samp1 = getSample( c.p1 ).g;', ' c.samp2 = getSample( c.p2 ).g;', ' c.samp3 = getSample( c.p3 ).g;', ' c.samp4 = getSample( c.p4 ).g;', ' } else {', ' c.samp1 = getSample( c.p1 ).b;', ' c.samp3 = getSample( c.p3 ).b;', ' c.samp2 = getSample( c.p2 ).b;', ' c.samp4 = getSample( c.p4 ).b;', ' }', ' dist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );', ' dist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );', ' dist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );', ' dist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );', ' res = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;', ' res += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;', ' res += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;', ' res += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;', ' res = clamp( res, 0.0, 1.0 );', ' return res;', '}', 'Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {', // get containing cell
|
58
|
+
' Cell c;', // calc grid
|
59
|
+
' vec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );', ' float threshold = step * 0.5;', ' float dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );', ' float dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );', ' vec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );', ' float offset_normal = mod( hypot( offset.x, offset.y ), step );', ' float normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;', ' float normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;', ' float offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );', ' float line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;', ' float line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;', // get closest corner
|
60
|
+
' c.normal = n;', ' c.p1.x = p.x - n.x * normal_scale + n.y * line_scale;', ' c.p1.y = p.y - n.y * normal_scale - n.x * line_scale;', // scatter
|
61
|
+
' if ( scatter != 0.0 ) {', ' float off_mag = scatter * threshold * 0.5;', ' float off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;', ' c.p1.x += cos( off_angle ) * off_mag;', ' c.p1.y += sin( off_angle ) * off_mag;', ' }', // find corners
|
62
|
+
' float normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );', ' float line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );', ' c.p2.x = c.p1.x - n.x * normal_step;', ' c.p2.y = c.p1.y - n.y * normal_step;', ' c.p3.x = c.p1.x + n.y * line_step;', ' c.p3.y = c.p1.y - n.x * line_step;', ' c.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;', ' c.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;', ' return c;', '}', 'float blendColour( float a, float b, float t ) {', // blend colours
|
63
|
+
' if ( blendingMode == BLENDING_LINEAR ) {', ' return blend( a, b, 1.0 - t );', ' } else if ( blendingMode == BLENDING_ADD ) {', ' return blend( a, min( 1.0, a + b ), t );', ' } else if ( blendingMode == BLENDING_MULTIPLY ) {', ' return blend( a, max( 0.0, a * b ), t );', ' } else if ( blendingMode == BLENDING_LIGHTER ) {', ' return blend( a, max( a, b ), t );', ' } else if ( blendingMode == BLENDING_DARKER ) {', ' return blend( a, min( a, b ), t );', ' } else {', ' return blend( a, b, 1.0 - t );', ' }', '}', 'void main() {', ' if ( ! disable ) {', // setup
|
64
|
+
' vec2 p = vec2( vUV.x * width, vUV.y * height );', ' vec2 origin = vec2( 0, 0 );', ' float aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;', // get channel samples
|
65
|
+
' Cell cell_r = getReferenceCell( p, origin, rotateR, radius );', ' Cell cell_g = getReferenceCell( p, origin, rotateG, radius );', ' Cell cell_b = getReferenceCell( p, origin, rotateB, radius );', ' float r = getDotColour( cell_r, p, 0, rotateR, aa );', ' float g = getDotColour( cell_g, p, 1, rotateG, aa );', ' float b = getDotColour( cell_b, p, 2, rotateB, aa );', // blend with original
|
66
|
+
' vec4 colour = texture2D( tDiffuse, vUV );', ' r = blendColour( r, colour.r, blending );', ' g = blendColour( g, colour.g, blending );', ' b = blendColour( b, colour.b, blending );', ' if ( greyscale ) {', ' r = g = b = (r + b + g) / 3.0;', ' }', ' gl_FragColor = vec4( r, g, b, 1.0 );', ' } else {', ' gl_FragColor = texture2D( tDiffuse, vUV );', ' }', '}'].join('\n')
|
211
67
|
};
|
212
|
-
|
68
|
+
|
69
|
+
export { HalftoneShader };
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:"\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n }\n ",fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform float h;\n\n varying vec2 vUv;\n\n void main() {\n\n \tvec4 sum = vec4( 0.0 );\n\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;\n \tsum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;\n \tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;\n \tsum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;\n\n \tgl_FragColor = sum;\n\n }\n "};exports.HorizontalBlurShader=e;
|
@@ -1,11 +1,24 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
/**
|
2
|
+
* Two pass Gaussian blur filter (horizontal and vertical blur shaders)
|
3
|
+
* - described in http://www.gamerendering.com/2008/10/11/gaussian-blur-filter-shader/
|
4
|
+
* and used in http://www.cake23.de/traveling-wavefronts-lit-up.html
|
5
|
+
*
|
6
|
+
* - 9 samples per pass
|
7
|
+
* - standard deviation 2.7
|
8
|
+
* - "h" and "v" parameters should be set to "1 / width" and "1 / height"
|
9
|
+
*/
|
3
10
|
const HorizontalBlurShader = {
|
4
11
|
uniforms: {
|
5
|
-
tDiffuse: {
|
6
|
-
|
12
|
+
tDiffuse: {
|
13
|
+
value: null
|
14
|
+
},
|
15
|
+
h: {
|
16
|
+
value: 1.0 / 512.0
|
17
|
+
}
|
7
18
|
},
|
8
|
-
vertexShader:
|
19
|
+
vertexShader:
|
20
|
+
/* glsl */
|
21
|
+
`
|
9
22
|
varying vec2 vUv;
|
10
23
|
|
11
24
|
void main() {
|
@@ -15,7 +28,9 @@ const HorizontalBlurShader = {
|
|
15
28
|
|
16
29
|
}
|
17
30
|
`,
|
18
|
-
fragmentShader:
|
31
|
+
fragmentShader:
|
32
|
+
/* glsl */
|
33
|
+
`
|
19
34
|
uniform sampler2D tDiffuse;
|
20
35
|
uniform float h;
|
21
36
|
|
@@ -40,4 +55,5 @@ const HorizontalBlurShader = {
|
|
40
55
|
}
|
41
56
|
`
|
42
57
|
};
|
43
|
-
|
58
|
+
|
59
|
+
export { HorizontalBlurShader };
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const v={uniforms:{tDiffuse:{value:null},h:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","uniform float r;","varying vec2 vUv;","void main() {","\tvec4 sum = vec4( 0.0 );","\tfloat hh = h * abs( r - vUv.y );","\tsum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;","\tsum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;","\tsum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;","\tgl_FragColor = sum;","}"].join("\n")};exports.HorizontalTiltShiftShader=v;
|