three-stdlib 2.22.7 → 2.22.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_polyfill/CompressedArrayTexture.js +12 -0
- package/dist/_polyfill/CompressedArrayTexture.mjs +12 -0
- package/dist/_polyfill/Data3DTexture.js +17 -0
- package/dist/_polyfill/Data3DTexture.mjs +17 -0
- package/dist/animation/AnimationClipCreator.d.ts +12 -0
- package/dist/animation/AnimationClipCreator.js +57 -0
- package/dist/animation/AnimationClipCreator.mjs +57 -0
- package/dist/animation/CCDIKSolver.d.ts +25 -0
- package/dist/animation/CCDIKSolver.js +224 -0
- package/dist/animation/CCDIKSolver.mjs +224 -0
- package/dist/animation/MMDAnimationHelper.d.ts +93 -0
- package/dist/animation/MMDAnimationHelper.js +590 -0
- package/dist/animation/MMDAnimationHelper.mjs +590 -0
- package/dist/animation/MMDPhysics.d.ts +114 -0
- package/dist/animation/MMDPhysics.js +819 -0
- package/dist/animation/MMDPhysics.mjs +819 -0
- package/dist/cameras/CinematicCamera.d.ts +34 -0
- package/dist/cameras/CinematicCamera.js +131 -0
- package/dist/cameras/CinematicCamera.mjs +131 -0
- package/dist/controls/ArcballControls.d.ts +374 -0
- package/dist/controls/ArcballControls.js +2039 -0
- package/dist/controls/ArcballControls.mjs +2039 -0
- package/dist/controls/DeviceOrientationControls.d.ts +27 -0
- package/dist/controls/DeviceOrientationControls.js +84 -0
- package/dist/controls/DeviceOrientationControls.mjs +84 -0
- package/dist/controls/DragControls.d.ts +34 -0
- package/dist/controls/DragControls.js +182 -0
- package/dist/controls/DragControls.mjs +182 -0
- package/dist/controls/FirstPersonControls.d.ts +48 -0
- package/dist/controls/FirstPersonControls.js +229 -0
- package/dist/controls/FirstPersonControls.mjs +229 -0
- package/dist/controls/FlyControls.d.ts +32 -0
- package/dist/controls/FlyControls.js +248 -0
- package/dist/controls/FlyControls.mjs +248 -0
- package/dist/controls/OrbitControls.d.ts +63 -0
- package/dist/controls/OrbitControls.js +781 -0
- package/dist/controls/OrbitControls.mjs +781 -0
- package/dist/controls/PointerLockControls.d.ts +24 -0
- package/dist/controls/PointerLockControls.js +103 -0
- package/dist/controls/PointerLockControls.mjs +103 -0
- package/dist/controls/TrackballControls.d.ts +95 -0
- package/dist/controls/TrackballControls.js +502 -0
- package/dist/controls/TrackballControls.mjs +502 -0
- package/dist/controls/TransformControls.d.ts +151 -0
- package/dist/controls/TransformControls.js +1089 -0
- package/dist/controls/TransformControls.mjs +1089 -0
- package/dist/controls/experimental/CameraControls.d.ts +212 -0
- package/dist/controls/experimental/CameraControls.js +736 -0
- package/dist/controls/experimental/CameraControls.mjs +736 -0
- package/dist/csm/CSM.d.ts +61 -0
- package/dist/csm/CSM.js +244 -0
- package/dist/csm/CSM.mjs +244 -0
- package/dist/csm/CSMFrustum.d.ts +19 -0
- package/dist/csm/CSMFrustum.js +75 -0
- package/dist/csm/CSMFrustum.mjs +75 -0
- package/dist/csm/CSMHelper.d.ts +26 -0
- package/dist/csm/CSMHelper.js +114 -0
- package/dist/csm/CSMHelper.mjs +114 -0
- package/dist/csm/CSMShader.d.ts +4 -0
- package/dist/csm/CSMShader.js +257 -0
- package/dist/csm/CSMShader.mjs +257 -0
- package/dist/curves/CurveExtras.d.ts +68 -0
- package/dist/curves/CurveExtras.js +224 -0
- package/dist/curves/CurveExtras.mjs +224 -0
- package/dist/curves/NURBSCurve.d.ts +11 -0
- package/dist/curves/NURBSCurve.js +35 -0
- package/dist/curves/NURBSCurve.mjs +35 -0
- package/dist/curves/NURBSSurface.d.ts +13 -0
- package/dist/curves/NURBSSurface.js +28 -0
- package/dist/curves/NURBSSurface.mjs +28 -0
- package/dist/curves/NURBSUtils.d.ts +22 -0
- package/dist/curves/NURBSUtils.js +226 -0
- package/dist/curves/NURBSUtils.mjs +226 -0
- package/dist/custom.d.ts +5 -0
- package/dist/deprecated/Geometry.d.ts +342 -0
- package/dist/deprecated/Geometry.js +971 -0
- package/dist/deprecated/Geometry.mjs +971 -0
- package/dist/effects/AnaglyphEffect.d.ts +11 -0
- package/dist/effects/AnaglyphEffect.js +121 -0
- package/dist/effects/AnaglyphEffect.mjs +121 -0
- package/dist/effects/AsciiEffect.d.ts +18 -0
- package/dist/effects/AsciiEffect.js +173 -0
- package/dist/effects/AsciiEffect.mjs +173 -0
- package/dist/effects/OutlineEffect.d.ts +28 -0
- package/dist/effects/OutlineEffect.js +298 -0
- package/dist/effects/OutlineEffect.mjs +298 -0
- package/dist/effects/ParallaxBarrierEffect.d.ts +8 -0
- package/dist/effects/ParallaxBarrierEffect.js +64 -0
- package/dist/effects/ParallaxBarrierEffect.mjs +64 -0
- package/dist/effects/PeppersGhostEffect.d.ts +10 -0
- package/dist/effects/PeppersGhostEffect.js +85 -0
- package/dist/effects/PeppersGhostEffect.mjs +85 -0
- package/dist/effects/StereoEffect.d.ts +9 -0
- package/dist/effects/StereoEffect.js +32 -0
- package/dist/effects/StereoEffect.mjs +32 -0
- package/dist/environments/RoomEnvironment.d.ts +5 -0
- package/dist/environments/RoomEnvironment.js +95 -0
- package/dist/environments/RoomEnvironment.mjs +78 -0
- package/dist/exporters/ColladaExporter.d.ts +50 -0
- package/dist/exporters/ColladaExporter.js +331 -0
- package/dist/exporters/ColladaExporter.mjs +331 -0
- package/dist/exporters/DRACOExporter.d.ts +23 -0
- package/dist/exporters/DRACOExporter.js +141 -0
- package/dist/exporters/DRACOExporter.mjs +141 -0
- package/dist/exporters/GLTFExporter.d.ts +446 -0
- package/dist/exporters/GLTFExporter.js +1575 -0
- package/dist/exporters/GLTFExporter.mjs +1575 -0
- package/dist/exporters/MMDExporter.d.ts +12 -0
- package/dist/exporters/MMDExporter.js +131 -0
- package/dist/exporters/MMDExporter.mjs +131 -0
- package/dist/exporters/OBJExporter.d.ts +18 -0
- package/dist/exporters/OBJExporter.js +181 -0
- package/dist/exporters/OBJExporter.mjs +181 -0
- package/dist/exporters/PLYExporter.d.ts +23 -0
- package/dist/exporters/PLYExporter.js +280 -0
- package/dist/exporters/PLYExporter.mjs +280 -0
- package/dist/exporters/STLExporter.d.ts +31 -0
- package/dist/exporters/STLExporter.js +146 -0
- package/dist/exporters/STLExporter.mjs +146 -0
- package/dist/exporters/USDZExporter.d.ts +27 -0
- package/dist/exporters/USDZExporter.js +340 -0
- package/dist/exporters/USDZExporter.mjs +340 -0
- package/dist/geometries/BoxLineGeometry.d.ts +12 -0
- package/dist/geometries/BoxLineGeometry.js +45 -0
- package/dist/geometries/BoxLineGeometry.mjs +45 -0
- package/dist/geometries/ConvexGeometry.d.ts +5 -0
- package/dist/geometries/ConvexGeometry.js +29 -0
- package/dist/geometries/ConvexGeometry.mjs +29 -0
- package/dist/geometries/DecalGeometry.d.ts +10 -0
- package/dist/geometries/DecalGeometry.js +184 -0
- package/dist/geometries/DecalGeometry.mjs +184 -0
- package/dist/geometries/LightningStrike.d.ts +108 -0
- package/dist/geometries/LightningStrike.js +548 -0
- package/dist/geometries/LightningStrike.mjs +548 -0
- package/dist/geometries/ParametricGeometries.d.ts +26 -0
- package/dist/geometries/ParametricGeometries.js +129 -0
- package/dist/geometries/ParametricGeometries.mjs +129 -0
- package/dist/geometries/ParametricGeometry.d.ts +18 -0
- package/dist/geometries/ParametricGeometry.js +63 -0
- package/dist/geometries/ParametricGeometry.mjs +63 -0
- package/dist/geometries/RoundedBoxGeometry.d.ts +5 -0
- package/dist/geometries/RoundedBoxGeometry.js +91 -0
- package/dist/geometries/RoundedBoxGeometry.mjs +91 -0
- package/dist/geometries/TeapotGeometry.d.ts +13 -0
- package/dist/geometries/TeapotGeometry.js +1563 -0
- package/dist/geometries/TeapotGeometry.mjs +1563 -0
- package/dist/geometries/TextGeometry.d.ts +18 -0
- package/dist/geometries/TextGeometry.js +27 -0
- package/dist/geometries/TextGeometry.mjs +27 -0
- package/dist/helpers/LightProbeHelper.d.ts +10 -0
- package/dist/helpers/LightProbeHelper.js +73 -0
- package/dist/helpers/LightProbeHelper.mjs +73 -0
- package/dist/helpers/PositionalAudioHelper.d.ts +13 -0
- package/dist/helpers/PositionalAudioHelper.js +68 -0
- package/dist/helpers/PositionalAudioHelper.mjs +68 -0
- package/dist/helpers/RectAreaLightHelper.d.ts +10 -0
- package/dist/helpers/RectAreaLightHelper.js +44 -0
- package/dist/helpers/RectAreaLightHelper.mjs +44 -0
- package/dist/helpers/VertexNormalsHelper.d.ts +10 -0
- package/dist/helpers/VertexNormalsHelper.js +54 -0
- package/dist/helpers/VertexNormalsHelper.mjs +54 -0
- package/dist/helpers/VertexTangentsHelper.d.ts +10 -0
- package/dist/helpers/VertexTangentsHelper.js +45 -0
- package/dist/helpers/VertexTangentsHelper.mjs +45 -0
- package/dist/index.d.ts +325 -0
- package/dist/index.js +978 -0
- package/dist/index.mjs +978 -0
- package/dist/interactive/HTMLMesh.d.ts +6 -0
- package/dist/interactive/HTMLMesh.js +325 -0
- package/dist/interactive/HTMLMesh.mjs +325 -0
- package/dist/interactive/InteractiveGroup.d.ts +5 -0
- package/dist/interactive/InteractiveGroup.js +68 -0
- package/dist/interactive/InteractiveGroup.mjs +68 -0
- package/dist/interactive/SelectionBox.d.ts +15 -0
- package/dist/interactive/SelectionBox.js +137 -0
- package/dist/interactive/SelectionBox.mjs +137 -0
- package/dist/interactive/SelectionHelper.d.ts +17 -0
- package/dist/interactive/SelectionHelper.js +54 -0
- package/dist/interactive/SelectionHelper.mjs +54 -0
- package/dist/libs/MeshoptDecoder.d.ts +12 -0
- package/dist/libs/MeshoptDecoder.js +221 -0
- package/dist/libs/MeshoptDecoder.mjs +221 -0
- package/dist/libs/MotionControllers.d.ts +175 -0
- package/dist/libs/MotionControllers.js +325 -0
- package/dist/libs/MotionControllers.mjs +325 -0
- package/dist/lights/LightProbeGenerator.d.ts +6 -0
- package/dist/lights/LightProbeGenerator.js +145 -0
- package/dist/lights/LightProbeGenerator.mjs +145 -0
- package/dist/lights/RectAreaLightUniformsLib.d.ts +3 -0
- package/dist/lights/RectAreaLightUniformsLib.js +32842 -0
- package/dist/lights/RectAreaLightUniformsLib.mjs +32842 -0
- package/dist/lines/Line2.d.ts +11 -0
- package/dist/lines/Line2.js +13 -0
- package/dist/lines/Line2.mjs +13 -0
- package/dist/lines/LineGeometry.d.ts +10 -0
- package/dist/lines/LineGeometry.js +44 -0
- package/dist/lines/LineGeometry.mjs +44 -0
- package/dist/lines/LineMaterial.d.ts +31 -0
- package/dist/lines/LineMaterial.js +547 -0
- package/dist/lines/LineMaterial.mjs +547 -0
- package/dist/lines/LineSegments2.d.ts +14 -0
- package/dist/lines/LineSegments2.js +203 -0
- package/dist/lines/LineSegments2.mjs +203 -0
- package/dist/lines/LineSegmentsGeometry.d.ts +16 -0
- package/dist/lines/LineSegmentsGeometry.js +124 -0
- package/dist/lines/LineSegmentsGeometry.mjs +124 -0
- package/dist/lines/Wireframe.d.ts +11 -0
- package/dist/lines/Wireframe.js +32 -0
- package/dist/lines/Wireframe.mjs +32 -0
- package/dist/lines/WireframeGeometry2.d.ts +8 -0
- package/dist/lines/WireframeGeometry2.js +13 -0
- package/dist/lines/WireframeGeometry2.mjs +13 -0
- package/dist/loaders/3DMLoader.d.ts +17 -0
- package/dist/loaders/3DMLoader.js +803 -0
- package/dist/loaders/3DMLoader.mjs +803 -0
- package/dist/loaders/3MFLoader.d.ts +16 -0
- package/dist/loaders/3MFLoader.js +854 -0
- package/dist/loaders/3MFLoader.mjs +854 -0
- package/dist/loaders/AMFLoader.d.ts +14 -0
- package/dist/loaders/AMFLoader.js +284 -0
- package/dist/loaders/AMFLoader.mjs +284 -0
- package/dist/loaders/AssimpLoader.js +1396 -0
- package/dist/loaders/AssimpLoader.mjs +1396 -0
- package/dist/loaders/BVHLoader.d.ts +21 -0
- package/dist/loaders/BVHLoader.js +207 -0
- package/dist/loaders/BVHLoader.mjs +207 -0
- package/dist/loaders/BasisTextureLoader.d.ts +32 -0
- package/dist/loaders/BasisTextureLoader.js +480 -0
- package/dist/loaders/BasisTextureLoader.mjs +480 -0
- package/dist/loaders/ColladaLoader.d.ts +20 -0
- package/dist/loaders/ColladaLoader.js +2405 -0
- package/dist/loaders/ColladaLoader.mjs +2405 -0
- package/dist/loaders/DDSLoader.d.ts +16 -0
- package/dist/loaders/DDSLoader.js +148 -0
- package/dist/loaders/DDSLoader.mjs +148 -0
- package/dist/loaders/DRACOLoader.d.ts +18 -0
- package/dist/loaders/DRACOLoader.js +341 -0
- package/dist/loaders/DRACOLoader.mjs +341 -0
- package/dist/loaders/EXRLoader.d.ts +18 -0
- package/dist/loaders/EXRLoader.js +1354 -0
- package/dist/loaders/EXRLoader.mjs +1354 -0
- package/dist/loaders/FBXLoader.d.ts +14 -0
- package/dist/loaders/FBXLoader.js +2457 -0
- package/dist/loaders/FBXLoader.mjs +2457 -0
- package/dist/loaders/FontLoader.d.ts +36 -0
- package/dist/loaders/FontLoader.js +120 -0
- package/dist/loaders/FontLoader.mjs +120 -0
- package/dist/loaders/GCodeLoader.d.ts +15 -0
- package/dist/loaders/GCodeLoader.js +141 -0
- package/dist/loaders/GCodeLoader.mjs +141 -0
- package/dist/loaders/GLTFLoader.d.ts +153 -0
- package/dist/loaders/GLTFLoader.js +2459 -0
- package/dist/loaders/GLTFLoader.mjs +2459 -0
- package/dist/loaders/HDRCubeTextureLoader.d.ts +18 -0
- package/dist/loaders/HDRCubeTextureLoader.js +75 -0
- package/dist/loaders/HDRCubeTextureLoader.mjs +75 -0
- package/dist/loaders/KMZLoader.d.ts +16 -0
- package/dist/loaders/KMZLoader.js +75 -0
- package/dist/loaders/KMZLoader.mjs +75 -0
- package/dist/loaders/KTX2Loader.d.ts +16 -0
- package/dist/loaders/KTX2Loader.js +461 -0
- package/dist/loaders/KTX2Loader.mjs +461 -0
- package/dist/loaders/KTXLoader.d.ts +16 -0
- package/dist/loaders/KTXLoader.js +93 -0
- package/dist/loaders/KTXLoader.mjs +93 -0
- package/dist/loaders/LDrawLoader.d.ts +26 -0
- package/dist/loaders/LDrawLoader.js +1424 -0
- package/dist/loaders/LDrawLoader.mjs +1424 -0
- package/dist/loaders/LUT3dlLoader.d.ts +20 -0
- package/dist/loaders/LUT3dlLoader.js +103 -0
- package/dist/loaders/LUT3dlLoader.mjs +103 -0
- package/dist/loaders/LUTCubeLoader.d.ts +23 -0
- package/dist/loaders/LUTCubeLoader.js +107 -0
- package/dist/loaders/LUTCubeLoader.mjs +107 -0
- package/dist/loaders/LWOLoader.d.ts +26 -0
- package/dist/loaders/LWOLoader.js +645 -0
- package/dist/loaders/LWOLoader.mjs +645 -0
- package/dist/loaders/LottieLoader.d.ts +15 -0
- package/dist/loaders/LottieLoader.js +47 -0
- package/dist/loaders/LottieLoader.mjs +47 -0
- package/dist/loaders/MD2Loader.d.ts +14 -0
- package/dist/loaders/MD2Loader.js +359 -0
- package/dist/loaders/MD2Loader.mjs +359 -0
- package/dist/loaders/MDDLoader.d.ts +19 -0
- package/dist/loaders/MDDLoader.js +58 -0
- package/dist/loaders/MDDLoader.mjs +58 -0
- package/dist/loaders/MMDLoader.d.ts +63 -0
- package/dist/loaders/MMDLoader.js +1121 -0
- package/dist/loaders/MMDLoader.mjs +1121 -0
- package/dist/loaders/MTLLoader.d.ts +100 -0
- package/dist/loaders/MTLLoader.js +304 -0
- package/dist/loaders/MTLLoader.mjs +304 -0
- package/dist/loaders/NRRDLoader.d.ts +21 -0
- package/dist/loaders/NRRDLoader.js +401 -0
- package/dist/loaders/NRRDLoader.mjs +401 -0
- package/dist/loaders/NodeMaterialLoader.js +146 -0
- package/dist/loaders/NodeMaterialLoader.mjs +146 -0
- package/dist/loaders/OBJLoader.d.ts +17 -0
- package/dist/loaders/OBJLoader.js +487 -0
- package/dist/loaders/OBJLoader.mjs +487 -0
- package/dist/loaders/PCDLoader.d.ts +15 -0
- package/dist/loaders/PCDLoader.js +248 -0
- package/dist/loaders/PCDLoader.mjs +248 -0
- package/dist/loaders/PDBLoader.d.ts +22 -0
- package/dist/loaders/PDBLoader.js +247 -0
- package/dist/loaders/PDBLoader.mjs +247 -0
- package/dist/loaders/PLYLoader.d.ts +16 -0
- package/dist/loaders/PLYLoader.js +317 -0
- package/dist/loaders/PLYLoader.mjs +317 -0
- package/dist/loaders/PRWMLoader.d.ts +16 -0
- package/dist/loaders/PRWMLoader.js +160 -0
- package/dist/loaders/PRWMLoader.mjs +160 -0
- package/dist/loaders/PVRLoader.d.ts +16 -0
- package/dist/loaders/PVRLoader.js +131 -0
- package/dist/loaders/PVRLoader.mjs +131 -0
- package/dist/loaders/RGBELoader.d.ts +20 -0
- package/dist/loaders/RGBELoader.js +252 -0
- package/dist/loaders/RGBELoader.mjs +252 -0
- package/dist/loaders/RGBMLoader.d.ts +32 -0
- package/dist/loaders/RGBMLoader.js +998 -0
- package/dist/loaders/RGBMLoader.mjs +998 -0
- package/dist/loaders/STLLoader.d.ts +14 -0
- package/dist/loaders/STLLoader.js +190 -0
- package/dist/loaders/STLLoader.mjs +190 -0
- package/dist/loaders/SVGLoader.d.ts +63 -0
- package/dist/loaders/SVGLoader.js +1712 -0
- package/dist/loaders/SVGLoader.mjs +1712 -0
- package/dist/loaders/TDSLoader.d.ts +42 -0
- package/dist/loaders/TDSLoader.js +650 -0
- package/dist/loaders/TDSLoader.mjs +650 -0
- package/dist/loaders/TGALoader.d.ts +14 -0
- package/dist/loaders/TGALoader.js +285 -0
- package/dist/loaders/TGALoader.mjs +285 -0
- package/dist/loaders/TTFLoader.d.ts +15 -0
- package/dist/loaders/TTFLoader.js +131 -0
- package/dist/loaders/TTFLoader.mjs +131 -0
- package/dist/loaders/TiltLoader.d.ts +14 -0
- package/dist/loaders/TiltLoader.js +373 -0
- package/dist/loaders/TiltLoader.mjs +373 -0
- package/dist/loaders/VOXLoader.d.ts +28 -0
- package/dist/loaders/VOXLoader.js +432 -0
- package/dist/loaders/VOXLoader.mjs +432 -0
- package/dist/loaders/VRMLLoader.d.ts +14 -0
- package/dist/loaders/VRMLLoader.js +2105 -0
- package/dist/loaders/VRMLLoader.mjs +2105 -0
- package/dist/loaders/VRMLoader.js +38 -0
- package/dist/loaders/VRMLoader.mjs +38 -0
- package/dist/loaders/VTKLoader.d.ts +14 -0
- package/dist/loaders/VTKLoader.js +648 -0
- package/dist/loaders/VTKLoader.mjs +648 -0
- package/dist/loaders/XLoader.js +1258 -0
- package/dist/loaders/XLoader.mjs +1258 -0
- package/dist/loaders/XYZLoader.d.ts +14 -0
- package/dist/loaders/XYZLoader.js +60 -0
- package/dist/loaders/XYZLoader.mjs +60 -0
- package/dist/loaders/lwo/IFFParser.js +749 -0
- package/dist/loaders/lwo/IFFParser.mjs +749 -0
- package/dist/loaders/lwo/LWO2Parser.js +327 -0
- package/dist/loaders/lwo/LWO2Parser.mjs +327 -0
- package/dist/loaders/lwo/LWO3Parser.js +298 -0
- package/dist/loaders/lwo/LWO3Parser.mjs +298 -0
- package/dist/math/Capsule.d.ts +27 -0
- package/dist/math/Capsule.js +100 -0
- package/dist/math/Capsule.mjs +100 -0
- package/dist/math/ColorConverter.d.ts +21 -0
- package/dist/math/ColorConverter.js +52 -0
- package/dist/math/ColorConverter.mjs +52 -0
- package/dist/math/ConvexHull.d.ts +89 -0
- package/dist/math/ConvexHull.js +597 -0
- package/dist/math/ConvexHull.mjs +597 -0
- package/dist/math/ImprovedNoise.d.ts +4 -0
- package/dist/math/ImprovedNoise.js +302 -0
- package/dist/math/ImprovedNoise.mjs +302 -0
- package/dist/math/Lut.d.ts +27 -0
- package/dist/math/Lut.js +135 -0
- package/dist/math/Lut.mjs +135 -0
- package/dist/math/MeshSurfaceSampler.d.ts +15 -0
- package/dist/math/MeshSurfaceSampler.js +107 -0
- package/dist/math/MeshSurfaceSampler.mjs +107 -0
- package/dist/math/OBB.d.ts +24 -0
- package/dist/math/OBB.js +262 -0
- package/dist/math/OBB.mjs +262 -0
- package/dist/math/Octree.d.ts +24 -0
- package/dist/math/Octree.js +278 -0
- package/dist/math/Octree.mjs +278 -0
- package/dist/math/SimplexNoise.d.ts +21 -0
- package/dist/math/SimplexNoise.js +440 -0
- package/dist/math/SimplexNoise.mjs +440 -0
- package/dist/misc/ConvexObjectBreaker.d.ts +25 -0
- package/dist/misc/ConvexObjectBreaker.js +298 -0
- package/dist/misc/ConvexObjectBreaker.mjs +298 -0
- package/dist/misc/GPUComputationRenderer.d.ts +52 -0
- package/dist/misc/GPUComputationRenderer.js +171 -0
- package/dist/misc/GPUComputationRenderer.mjs +171 -0
- package/dist/misc/Gyroscope.d.ts +5 -0
- package/dist/misc/Gyroscope.js +35 -0
- package/dist/misc/Gyroscope.mjs +35 -0
- package/dist/misc/MD2Character.d.ts +33 -0
- package/dist/misc/MD2Character.js +165 -0
- package/dist/misc/MD2Character.mjs +165 -0
- package/dist/misc/MD2CharacterComplex.d.ts +47 -0
- package/dist/misc/MD2CharacterComplex.js +331 -0
- package/dist/misc/MD2CharacterComplex.mjs +331 -0
- package/dist/misc/MorphAnimMesh.d.ts +13 -0
- package/dist/misc/MorphAnimMesh.js +40 -0
- package/dist/misc/MorphAnimMesh.mjs +40 -0
- package/dist/misc/MorphBlendMesh.d.ts +21 -0
- package/dist/misc/MorphBlendMesh.js +179 -0
- package/dist/misc/MorphBlendMesh.mjs +179 -0
- package/dist/misc/ProgressiveLightmap.d.ts +61 -0
- package/dist/misc/ProgressiveLightmap.js +186 -0
- package/dist/misc/ProgressiveLightmap.mjs +186 -0
- package/dist/misc/RollerCoaster.d.ts +21 -0
- package/dist/misc/RollerCoaster.js +346 -0
- package/dist/misc/RollerCoaster.mjs +346 -0
- package/dist/misc/Timer.d.ts +27 -0
- package/dist/misc/Timer.js +101 -0
- package/dist/misc/Timer.mjs +101 -0
- package/dist/misc/TubePainter.d.ts +10 -0
- package/dist/misc/TubePainter.js +123 -0
- package/dist/misc/TubePainter.mjs +123 -0
- package/dist/misc/Volume.d.ts +37 -0
- package/dist/misc/Volume.js +302 -0
- package/dist/misc/Volume.mjs +302 -0
- package/dist/misc/VolumeSlice.d.ts +28 -0
- package/dist/misc/VolumeSlice.js +115 -0
- package/dist/misc/VolumeSlice.mjs +115 -0
- package/dist/misc/WebGL.d.ts +5 -0
- package/dist/misc/WebGL.js +74 -0
- package/dist/misc/WebGL.mjs +74 -0
- package/dist/modifiers/CurveModifier.d.ts +91 -0
- package/dist/modifiers/CurveModifier.js +232 -0
- package/dist/modifiers/CurveModifier.mjs +232 -0
- package/dist/modifiers/EdgeSplitModifier.d.ts +19 -0
- package/dist/modifiers/EdgeSplitModifier.js +167 -0
- package/dist/modifiers/EdgeSplitModifier.mjs +168 -0
- package/dist/modifiers/SimplifyModifier.d.ts +19 -0
- package/dist/modifiers/SimplifyModifier.js +300 -0
- package/dist/modifiers/SimplifyModifier.mjs +300 -0
- package/dist/modifiers/TessellateModifier.d.ts +11 -0
- package/dist/modifiers/TessellateModifier.js +214 -0
- package/dist/modifiers/TessellateModifier.mjs +214 -0
- package/dist/nodes/Nodes.js +347 -0
- package/dist/nodes/Nodes.mjs +347 -0
- package/dist/nodes/ShaderNode.js +408 -0
- package/dist/nodes/ShaderNode.mjs +408 -0
- package/dist/nodes/accessors/BufferNode.js +14 -0
- package/dist/nodes/accessors/BufferNode.mjs +15 -0
- package/dist/nodes/accessors/CameraNode.js +43 -0
- package/dist/nodes/accessors/CameraNode.mjs +44 -0
- package/dist/nodes/accessors/CubeTextureNode.js +41 -0
- package/dist/nodes/accessors/CubeTextureNode.mjs +42 -0
- package/dist/nodes/accessors/MaterialNode.js +70 -0
- package/dist/nodes/accessors/MaterialNode.mjs +71 -0
- package/dist/nodes/accessors/MaterialReferenceNode.js +13 -0
- package/dist/nodes/accessors/MaterialReferenceNode.mjs +14 -0
- package/dist/nodes/accessors/ModelNode.js +8 -0
- package/dist/nodes/accessors/ModelNode.mjs +9 -0
- package/dist/nodes/accessors/ModelViewProjectionNode.js +23 -0
- package/dist/nodes/accessors/ModelViewProjectionNode.mjs +24 -0
- package/dist/nodes/accessors/NormalNode.js +61 -0
- package/dist/nodes/accessors/NormalNode.mjs +62 -0
- package/dist/nodes/accessors/Object3DNode.js +75 -0
- package/dist/nodes/accessors/Object3DNode.mjs +76 -0
- package/dist/nodes/accessors/PointUVNode.js +12 -0
- package/dist/nodes/accessors/PointUVNode.mjs +13 -0
- package/dist/nodes/accessors/PositionNode.js +64 -0
- package/dist/nodes/accessors/PositionNode.mjs +65 -0
- package/dist/nodes/accessors/ReferenceNode.js +36 -0
- package/dist/nodes/accessors/ReferenceNode.mjs +37 -0
- package/dist/nodes/accessors/ReflectNode.js +42 -0
- package/dist/nodes/accessors/ReflectNode.mjs +43 -0
- package/dist/nodes/accessors/SkinningNode.js +57 -0
- package/dist/nodes/accessors/SkinningNode.mjs +58 -0
- package/dist/nodes/accessors/TextureNode.js +53 -0
- package/dist/nodes/accessors/TextureNode.mjs +54 -0
- package/dist/nodes/accessors/UVNode.js +22 -0
- package/dist/nodes/accessors/UVNode.mjs +23 -0
- package/dist/nodes/core/ArrayUniformNode.js +13 -0
- package/dist/nodes/core/ArrayUniformNode.mjs +14 -0
- package/dist/nodes/core/AttributeNode.js +29 -0
- package/dist/nodes/core/AttributeNode.mjs +30 -0
- package/dist/nodes/core/BypassNode.js +21 -0
- package/dist/nodes/core/BypassNode.mjs +22 -0
- package/dist/nodes/core/CodeNode.js +27 -0
- package/dist/nodes/core/CodeNode.mjs +28 -0
- package/dist/nodes/core/ConstNode.js +13 -0
- package/dist/nodes/core/ConstNode.mjs +14 -0
- package/dist/nodes/core/ContextNode.js +21 -0
- package/dist/nodes/core/ContextNode.mjs +22 -0
- package/dist/nodes/core/ExpressionNode.js +18 -0
- package/dist/nodes/core/ExpressionNode.mjs +19 -0
- package/dist/nodes/core/FunctionCallNode.js +36 -0
- package/dist/nodes/core/FunctionCallNode.mjs +37 -0
- package/dist/nodes/core/FunctionNode.js +55 -0
- package/dist/nodes/core/FunctionNode.mjs +56 -0
- package/dist/nodes/core/InputNode.js +37 -0
- package/dist/nodes/core/InputNode.mjs +38 -0
- package/dist/nodes/core/Node.js +138 -0
- package/dist/nodes/core/Node.mjs +139 -0
- package/dist/nodes/core/NodeAttribute.js +9 -0
- package/dist/nodes/core/NodeAttribute.mjs +10 -0
- package/dist/nodes/core/NodeBuilder.js +402 -0
- package/dist/nodes/core/NodeBuilder.mjs +402 -0
- package/dist/nodes/core/NodeCode.js +10 -0
- package/dist/nodes/core/NodeCode.mjs +11 -0
- package/dist/nodes/core/NodeFrame.js +34 -0
- package/dist/nodes/core/NodeFrame.mjs +35 -0
- package/dist/nodes/core/NodeFunctionInput.js +12 -0
- package/dist/nodes/core/NodeFunctionInput.mjs +13 -0
- package/dist/nodes/core/NodeKeywords.js +43 -0
- package/dist/nodes/core/NodeKeywords.mjs +44 -0
- package/dist/nodes/core/NodeUniform.js +17 -0
- package/dist/nodes/core/NodeUniform.mjs +18 -0
- package/dist/nodes/core/NodeUtils.js +57 -0
- package/dist/nodes/core/NodeUtils.mjs +57 -0
- package/dist/nodes/core/NodeVar.js +9 -0
- package/dist/nodes/core/NodeVar.mjs +10 -0
- package/dist/nodes/core/NodeVary.js +9 -0
- package/dist/nodes/core/NodeVary.mjs +10 -0
- package/dist/nodes/core/PropertyNode.js +20 -0
- package/dist/nodes/core/PropertyNode.mjs +21 -0
- package/dist/nodes/core/TempNode.js +24 -0
- package/dist/nodes/core/TempNode.mjs +25 -0
- package/dist/nodes/core/UniformNode.js +22 -0
- package/dist/nodes/core/UniformNode.mjs +23 -0
- package/dist/nodes/core/VarNode.js +30 -0
- package/dist/nodes/core/VarNode.mjs +31 -0
- package/dist/nodes/core/VaryNode.js +29 -0
- package/dist/nodes/core/VaryNode.mjs +30 -0
- package/dist/nodes/core/constants.js +24 -0
- package/dist/nodes/core/constants.mjs +24 -0
- package/dist/nodes/display/ColorSpaceNode.js +62 -0
- package/dist/nodes/display/ColorSpaceNode.mjs +62 -0
- package/dist/nodes/display/NormalMapNode.js +53 -0
- package/dist/nodes/display/NormalMapNode.mjs +54 -0
- package/dist/nodes/fog/FogNode.js +14 -0
- package/dist/nodes/fog/FogNode.mjs +15 -0
- package/dist/nodes/fog/FogRangeNode.js +16 -0
- package/dist/nodes/fog/FogRangeNode.mjs +17 -0
- package/dist/nodes/functions/BSDFs.js +64 -0
- package/dist/nodes/functions/BSDFs.mjs +64 -0
- package/dist/nodes/lights/LightContextNode.js +34 -0
- package/dist/nodes/lights/LightContextNode.mjs +35 -0
- package/dist/nodes/lights/LightNode.js +57 -0
- package/dist/nodes/lights/LightNode.mjs +58 -0
- package/dist/nodes/lights/LightsNode.js +58 -0
- package/dist/nodes/lights/LightsNode.mjs +59 -0
- package/dist/nodes/loaders/NodeLoader.js +195 -0
- package/dist/nodes/loaders/NodeLoader.mjs +196 -0
- package/dist/nodes/loaders/NodeMaterialLoader.js +23 -0
- package/dist/nodes/loaders/NodeMaterialLoader.mjs +24 -0
- package/dist/nodes/loaders/NodeObjectLoader.js +39 -0
- package/dist/nodes/loaders/NodeObjectLoader.mjs +40 -0
- package/dist/nodes/materials/LineBasicNodeMaterial.js +26 -0
- package/dist/nodes/materials/LineBasicNodeMaterial.mjs +27 -0
- package/dist/nodes/materials/Materials.js +24 -0
- package/dist/nodes/materials/Materials.mjs +24 -0
- package/dist/nodes/materials/MeshBasicNodeMaterial.js +27 -0
- package/dist/nodes/materials/MeshBasicNodeMaterial.mjs +28 -0
- package/dist/nodes/materials/MeshStandardNodeMaterial.js +40 -0
- package/dist/nodes/materials/MeshStandardNodeMaterial.mjs +41 -0
- package/dist/nodes/materials/NodeMaterial.js +63 -0
- package/dist/nodes/materials/NodeMaterial.mjs +64 -0
- package/dist/nodes/materials/PointsNodeMaterial.js +29 -0
- package/dist/nodes/materials/PointsNodeMaterial.mjs +30 -0
- package/dist/nodes/math/CondNode.js +40 -0
- package/dist/nodes/math/CondNode.mjs +41 -0
- package/dist/nodes/math/MathNode.js +165 -0
- package/dist/nodes/math/MathNode.mjs +166 -0
- package/dist/nodes/math/OperatorNode.js +102 -0
- package/dist/nodes/math/OperatorNode.mjs +103 -0
- package/dist/nodes/procedural/CheckerNode.js +20 -0
- package/dist/nodes/procedural/CheckerNode.mjs +21 -0
- package/dist/nodes/utils/ArrayElementNode.js +18 -0
- package/dist/nodes/utils/ArrayElementNode.mjs +19 -0
- package/dist/nodes/utils/ConvertNode.js +24 -0
- package/dist/nodes/utils/ConvertNode.mjs +25 -0
- package/dist/nodes/utils/JoinNode.js +25 -0
- package/dist/nodes/utils/JoinNode.mjs +26 -0
- package/dist/nodes/utils/MatcapUVNode.js +15 -0
- package/dist/nodes/utils/MatcapUVNode.mjs +16 -0
- package/dist/nodes/utils/OscNode.js +49 -0
- package/dist/nodes/utils/OscNode.mjs +50 -0
- package/dist/nodes/utils/SplitNode.js +44 -0
- package/dist/nodes/utils/SplitNode.mjs +45 -0
- package/dist/nodes/utils/SpriteSheetUVNode.js +39 -0
- package/dist/nodes/utils/SpriteSheetUVNode.mjs +40 -0
- package/dist/nodes/utils/TimerNode.js +43 -0
- package/dist/nodes/utils/TimerNode.mjs +44 -0
- package/dist/objects/GroundProjectedEnv.d.ts +12 -0
- package/dist/objects/GroundProjectedEnv.js +134 -0
- package/dist/objects/GroundProjectedEnv.mjs +134 -0
- package/dist/objects/Lensflare.d.ts +17 -0
- package/dist/objects/Lensflare.js +280 -0
- package/dist/objects/Lensflare.mjs +280 -0
- package/dist/objects/LightningStorm.d.ts +32 -0
- package/dist/objects/LightningStorm.js +110 -0
- package/dist/objects/LightningStorm.mjs +110 -0
- package/dist/objects/MarchingCubes.d.ts +75 -0
- package/dist/objects/MarchingCubes.js +457 -0
- package/dist/objects/MarchingCubes.mjs +457 -0
- package/dist/objects/Reflector.d.ts +19 -0
- package/dist/objects/Reflector.js +175 -0
- package/dist/objects/Reflector.mjs +175 -0
- package/dist/objects/ReflectorForSSRPass.d.ts +48 -0
- package/dist/objects/ReflectorForSSRPass.js +256 -0
- package/dist/objects/ReflectorForSSRPass.mjs +256 -0
- package/dist/objects/ReflectorRTT.js +10 -0
- package/dist/objects/ReflectorRTT.mjs +10 -0
- package/dist/objects/Refractor.d.ts +19 -0
- package/dist/objects/Refractor.js +188 -0
- package/dist/objects/Refractor.mjs +188 -0
- package/dist/objects/ShadowMesh.d.ts +7 -0
- package/dist/objects/ShadowMesh.js +41 -0
- package/dist/objects/ShadowMesh.mjs +41 -0
- package/dist/objects/Sky.d.ts +43 -0
- package/dist/objects/Sky.js +156 -0
- package/dist/objects/Sky.mjs +156 -0
- package/dist/objects/Water.d.ts +22 -0
- package/dist/objects/Water.js +241 -0
- package/dist/objects/Water.mjs +241 -0
- package/dist/objects/Water2.d.ts +22 -0
- package/dist/objects/Water2.js +258 -0
- package/dist/objects/Water2.mjs +258 -0
- package/dist/offscreen/jank.js +26 -0
- package/dist/offscreen/jank.mjs +27 -0
- package/dist/offscreen/offscreen.js +8 -0
- package/dist/offscreen/offscreen.mjs +7 -0
- package/dist/offscreen/scene.js +68 -0
- package/dist/offscreen/scene.mjs +52 -0
- package/dist/physics/AmmoPhysics.d.ts +7 -0
- package/dist/physics/AmmoPhysics.js +166 -0
- package/dist/physics/AmmoPhysics.mjs +166 -0
- package/dist/postprocessing/AdaptiveToneMappingPass.d.ts +29 -0
- package/dist/postprocessing/AdaptiveToneMappingPass.js +225 -0
- package/dist/postprocessing/AdaptiveToneMappingPass.mjs +225 -0
- package/dist/postprocessing/AfterimagePass.d.ts +15 -0
- package/dist/postprocessing/AfterimagePass.js +68 -0
- package/dist/postprocessing/AfterimagePass.mjs +68 -0
- package/dist/postprocessing/BloomPass.d.ts +16 -0
- package/dist/postprocessing/BloomPass.js +109 -0
- package/dist/postprocessing/BloomPass.mjs +109 -0
- package/dist/postprocessing/BokehPass.d.ts +26 -0
- package/dist/postprocessing/BokehPass.js +90 -0
- package/dist/postprocessing/BokehPass.mjs +90 -0
- package/dist/postprocessing/ClearPass.d.ts +10 -0
- package/dist/postprocessing/ClearPass.js +36 -0
- package/dist/postprocessing/ClearPass.mjs +36 -0
- package/dist/postprocessing/CubeTexturePass.d.ts +14 -0
- package/dist/postprocessing/CubeTexturePass.js +49 -0
- package/dist/postprocessing/CubeTexturePass.mjs +49 -0
- package/dist/postprocessing/DotScreenPass.d.ts +10 -0
- package/dist/postprocessing/DotScreenPass.js +49 -0
- package/dist/postprocessing/DotScreenPass.mjs +49 -0
- package/dist/postprocessing/EffectComposer.d.ts +27 -0
- package/dist/postprocessing/EffectComposer.js +156 -0
- package/dist/postprocessing/EffectComposer.mjs +156 -0
- package/dist/postprocessing/FilmPass.d.ts +10 -0
- package/dist/postprocessing/FilmPass.js +51 -0
- package/dist/postprocessing/FilmPass.mjs +51 -0
- package/dist/postprocessing/GlitchPass.d.ts +15 -0
- package/dist/postprocessing/GlitchPass.js +84 -0
- package/dist/postprocessing/GlitchPass.mjs +84 -0
- package/dist/postprocessing/HalftonePass.d.ts +26 -0
- package/dist/postprocessing/HalftonePass.js +53 -0
- package/dist/postprocessing/HalftonePass.mjs +53 -0
- package/dist/postprocessing/LUTPass.d.ts +13 -0
- package/dist/postprocessing/LUTPass.js +142 -0
- package/dist/postprocessing/LUTPass.mjs +142 -0
- package/dist/postprocessing/MaskPass.d.ts +14 -0
- package/dist/postprocessing/MaskPass.js +69 -0
- package/dist/postprocessing/MaskPass.mjs +69 -0
- package/dist/postprocessing/OutlinePass.d.ts +53 -0
- package/dist/postprocessing/OutlinePass.js +479 -0
- package/dist/postprocessing/OutlinePass.mjs +479 -0
- package/dist/postprocessing/Pass.d.ts +20 -0
- package/dist/postprocessing/Pass.js +48 -0
- package/dist/postprocessing/Pass.mjs +48 -0
- package/dist/postprocessing/RenderPass.d.ts +14 -0
- package/dist/postprocessing/RenderPass.js +59 -0
- package/dist/postprocessing/RenderPass.mjs +59 -0
- package/dist/postprocessing/RenderPixelatedPass.js +199 -0
- package/dist/postprocessing/RenderPixelatedPass.mjs +199 -0
- package/dist/postprocessing/SAOPass.d.ts +79 -0
- package/dist/postprocessing/SAOPass.js +282 -0
- package/dist/postprocessing/SAOPass.mjs +282 -0
- package/dist/postprocessing/SMAAPass.d.ts +21 -0
- package/dist/postprocessing/SMAAPass.js +112 -0
- package/dist/postprocessing/SMAAPass.mjs +112 -0
- package/dist/postprocessing/SSAARenderPass.d.ts +17 -0
- package/dist/postprocessing/SSAARenderPass.js +171 -0
- package/dist/postprocessing/SSAARenderPass.mjs +171 -0
- package/dist/postprocessing/SSAOPass.d.ts +71 -0
- package/dist/postprocessing/SSAOPass.js +265 -0
- package/dist/postprocessing/SSAOPass.mjs +265 -0
- package/dist/postprocessing/SSRPass.d.ts +124 -0
- package/dist/postprocessing/SSRPass.js +438 -0
- package/dist/postprocessing/SSRPass.mjs +438 -0
- package/dist/postprocessing/SavePass.d.ts +12 -0
- package/dist/postprocessing/SavePass.js +37 -0
- package/dist/postprocessing/SavePass.mjs +37 -0
- package/dist/postprocessing/ShaderPass.d.ts +13 -0
- package/dist/postprocessing/ShaderPass.js +49 -0
- package/dist/postprocessing/ShaderPass.mjs +49 -0
- package/dist/postprocessing/TAARenderPass.d.ts +8 -0
- package/dist/postprocessing/TAARenderPass.js +89 -0
- package/dist/postprocessing/TAARenderPass.mjs +89 -0
- package/dist/postprocessing/TexturePass.d.ts +12 -0
- package/dist/postprocessing/TexturePass.js +39 -0
- package/dist/postprocessing/TexturePass.mjs +39 -0
- package/dist/postprocessing/UnrealBloomPass.d.ts +31 -0
- package/dist/postprocessing/UnrealBloomPass.js +220 -0
- package/dist/postprocessing/UnrealBloomPass.mjs +220 -0
- package/dist/postprocessing/WaterPass.d.ts +30 -0
- package/dist/postprocessing/WaterPass.js +72 -0
- package/dist/postprocessing/WaterPass.mjs +72 -0
- package/dist/renderers/CSS2DRenderer.d.ts +22 -0
- package/dist/renderers/CSS2DRenderer.js +121 -0
- package/dist/renderers/CSS2DRenderer.mjs +121 -0
- package/dist/renderers/CSS3DRenderer.d.ts +26 -0
- package/dist/renderers/CSS3DRenderer.js +133 -0
- package/dist/renderers/CSS3DRenderer.mjs +133 -0
- package/dist/renderers/Projector.d.ts +60 -0
- package/dist/renderers/Projector.js +511 -0
- package/dist/renderers/Projector.mjs +511 -0
- package/dist/renderers/SVGRenderer.d.ts +25 -0
- package/dist/renderers/SVGRenderer.js +306 -0
- package/dist/renderers/SVGRenderer.mjs +306 -0
- package/dist/renderers/nodes/accessors/CameraNode.js +62 -0
- package/dist/renderers/nodes/accessors/CameraNode.mjs +63 -0
- package/dist/renderers/nodes/accessors/ModelNode.js +60 -0
- package/dist/renderers/nodes/accessors/ModelNode.mjs +61 -0
- package/dist/renderers/nodes/accessors/ModelViewProjectionNode.js +20 -0
- package/dist/renderers/nodes/accessors/ModelViewProjectionNode.mjs +21 -0
- package/dist/renderers/nodes/accessors/NormalNode.js +60 -0
- package/dist/renderers/nodes/accessors/NormalNode.mjs +61 -0
- package/dist/renderers/nodes/accessors/PositionNode.js +29 -0
- package/dist/renderers/nodes/accessors/PositionNode.mjs +30 -0
- package/dist/renderers/nodes/accessors/UVNode.js +12 -0
- package/dist/renderers/nodes/accessors/UVNode.mjs +13 -0
- package/dist/renderers/nodes/core/AttributeNode.js +34 -0
- package/dist/renderers/nodes/core/AttributeNode.mjs +35 -0
- package/dist/renderers/nodes/core/InputNode.js +30 -0
- package/dist/renderers/nodes/core/InputNode.mjs +31 -0
- package/dist/renderers/nodes/core/Node.js +33 -0
- package/dist/renderers/nodes/core/Node.mjs +34 -0
- package/dist/renderers/nodes/core/NodeAttribute.js +9 -0
- package/dist/renderers/nodes/core/NodeAttribute.mjs +10 -0
- package/dist/renderers/nodes/core/NodeBuilder.js +248 -0
- package/dist/renderers/nodes/core/NodeBuilder.mjs +249 -0
- package/dist/renderers/nodes/core/NodeFrame.js +34 -0
- package/dist/renderers/nodes/core/NodeFrame.mjs +35 -0
- package/dist/renderers/nodes/core/NodeSlot.js +9 -0
- package/dist/renderers/nodes/core/NodeSlot.mjs +10 -0
- package/dist/renderers/nodes/core/NodeUniform.js +17 -0
- package/dist/renderers/nodes/core/NodeUniform.mjs +18 -0
- package/dist/renderers/nodes/core/NodeVary.js +10 -0
- package/dist/renderers/nodes/core/NodeVary.mjs +11 -0
- package/dist/renderers/nodes/core/VaryNode.js +21 -0
- package/dist/renderers/nodes/core/VaryNode.mjs +22 -0
- package/dist/renderers/nodes/core/constants.js +22 -0
- package/dist/renderers/nodes/core/constants.mjs +22 -0
- package/dist/renderers/nodes/inputs/ColorNode.js +10 -0
- package/dist/renderers/nodes/inputs/ColorNode.mjs +11 -0
- package/dist/renderers/nodes/inputs/FloatNode.js +10 -0
- package/dist/renderers/nodes/inputs/FloatNode.mjs +11 -0
- package/dist/renderers/nodes/inputs/Matrix3Node.js +11 -0
- package/dist/renderers/nodes/inputs/Matrix3Node.mjs +12 -0
- package/dist/renderers/nodes/inputs/Matrix4Node.js +11 -0
- package/dist/renderers/nodes/inputs/Matrix4Node.mjs +12 -0
- package/dist/renderers/nodes/inputs/TextureNode.js +19 -0
- package/dist/renderers/nodes/inputs/TextureNode.mjs +20 -0
- package/dist/renderers/nodes/inputs/Vector2Node.js +10 -0
- package/dist/renderers/nodes/inputs/Vector2Node.mjs +11 -0
- package/dist/renderers/nodes/inputs/Vector3Node.js +11 -0
- package/dist/renderers/nodes/inputs/Vector3Node.mjs +12 -0
- package/dist/renderers/nodes/inputs/Vector4Node.js +11 -0
- package/dist/renderers/nodes/inputs/Vector4Node.mjs +12 -0
- package/dist/renderers/nodes/math/MathNode.js +54 -0
- package/dist/renderers/nodes/math/MathNode.mjs +55 -0
- package/dist/renderers/nodes/math/OperatorNode.js +41 -0
- package/dist/renderers/nodes/math/OperatorNode.mjs +42 -0
- package/dist/renderers/nodes/utils/SwitchNode.js +19 -0
- package/dist/renderers/nodes/utils/SwitchNode.mjs +20 -0
- package/dist/renderers/nodes/utils/TimerNode.js +13 -0
- package/dist/renderers/nodes/utils/TimerNode.mjs +14 -0
- package/dist/renderers/webgpu/WebGPU.js +23 -0
- package/dist/renderers/webgpu/WebGPU.mjs +24 -0
- package/dist/renderers/webgpu/WebGPUAttributes.js +68 -0
- package/dist/renderers/webgpu/WebGPUAttributes.mjs +69 -0
- package/dist/renderers/webgpu/WebGPUBackground.js +60 -0
- package/dist/renderers/webgpu/WebGPUBackground.mjs +61 -0
- package/dist/renderers/webgpu/WebGPUBinding.js +13 -0
- package/dist/renderers/webgpu/WebGPUBinding.mjs +14 -0
- package/dist/renderers/webgpu/WebGPUBindings.js +154 -0
- package/dist/renderers/webgpu/WebGPUBindings.mjs +155 -0
- package/dist/renderers/webgpu/WebGPUComputePipelines.js +43 -0
- package/dist/renderers/webgpu/WebGPUComputePipelines.mjs +44 -0
- package/dist/renderers/webgpu/WebGPUGeometries.js +40 -0
- package/dist/renderers/webgpu/WebGPUGeometries.mjs +41 -0
- package/dist/renderers/webgpu/WebGPUInfo.js +45 -0
- package/dist/renderers/webgpu/WebGPUInfo.mjs +46 -0
- package/dist/renderers/webgpu/WebGPUObjects.js +24 -0
- package/dist/renderers/webgpu/WebGPUObjects.mjs +25 -0
- package/dist/renderers/webgpu/WebGPUProperties.js +21 -0
- package/dist/renderers/webgpu/WebGPUProperties.mjs +22 -0
- package/dist/renderers/webgpu/WebGPURenderLists.js +118 -0
- package/dist/renderers/webgpu/WebGPURenderLists.mjs +119 -0
- package/dist/renderers/webgpu/WebGPURenderPipelines.js +545 -0
- package/dist/renderers/webgpu/WebGPURenderPipelines.mjs +546 -0
- package/dist/renderers/webgpu/WebGPURenderer.js +596 -0
- package/dist/renderers/webgpu/WebGPURenderer.mjs +575 -0
- package/dist/renderers/webgpu/WebGPUSampledTexture.js +40 -0
- package/dist/renderers/webgpu/WebGPUSampledTexture.mjs +40 -0
- package/dist/renderers/webgpu/WebGPUSampler.js +14 -0
- package/dist/renderers/webgpu/WebGPUSampler.mjs +15 -0
- package/dist/renderers/webgpu/WebGPUStorageBuffer.js +14 -0
- package/dist/renderers/webgpu/WebGPUStorageBuffer.mjs +15 -0
- package/dist/renderers/webgpu/WebGPUTextureRenderer.js +22 -0
- package/dist/renderers/webgpu/WebGPUTextureRenderer.mjs +23 -0
- package/dist/renderers/webgpu/WebGPUTextureUtils.js +97 -0
- package/dist/renderers/webgpu/WebGPUTextureUtils.mjs +98 -0
- package/dist/renderers/webgpu/WebGPUTextures.js +483 -0
- package/dist/renderers/webgpu/WebGPUTextures.mjs +484 -0
- package/dist/renderers/webgpu/WebGPUUniform.js +81 -0
- package/dist/renderers/webgpu/WebGPUUniform.mjs +81 -0
- package/dist/renderers/webgpu/WebGPUUniformsGroup.js +175 -0
- package/dist/renderers/webgpu/WebGPUUniformsGroup.mjs +176 -0
- package/dist/renderers/webgpu/constants.js +241 -0
- package/dist/renderers/webgpu/constants.mjs +241 -0
- package/dist/renderers/webgpu/nodes/ShaderLib.js +41 -0
- package/dist/renderers/webgpu/nodes/ShaderLib.mjs +42 -0
- package/dist/renderers/webgpu/nodes/WebGPUNodeBuilder.js +164 -0
- package/dist/renderers/webgpu/nodes/WebGPUNodeBuilder.mjs +165 -0
- package/dist/renderers/webgpu/nodes/WebGPUNodeUniform.js +73 -0
- package/dist/renderers/webgpu/nodes/WebGPUNodeUniform.mjs +73 -0
- package/dist/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.js +14 -0
- package/dist/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.mjs +15 -0
- package/dist/renderers/webgpu/nodes/WebGPUNodes.js +39 -0
- package/dist/renderers/webgpu/nodes/WebGPUNodes.mjs +40 -0
- package/dist/shaders/ACESFilmicToneMappingShader.d.ts +16 -0
- package/dist/shaders/ACESFilmicToneMappingShader.js +55 -0
- package/dist/shaders/ACESFilmicToneMappingShader.mjs +55 -0
- package/dist/shaders/AfterimageShader.d.ts +15 -0
- package/dist/shaders/AfterimageShader.js +32 -0
- package/dist/shaders/AfterimageShader.mjs +32 -0
- package/dist/shaders/BasicShader.d.ts +8 -0
- package/dist/shaders/BasicShader.js +12 -0
- package/dist/shaders/BasicShader.mjs +12 -0
- package/dist/shaders/BleachBypassShader.d.ts +14 -0
- package/dist/shaders/BleachBypassShader.js +35 -0
- package/dist/shaders/BleachBypassShader.mjs +35 -0
- package/dist/shaders/BlendShader.d.ts +21 -0
- package/dist/shaders/BlendShader.js +30 -0
- package/dist/shaders/BlendShader.mjs +30 -0
- package/dist/shaders/BokehShader.d.ts +24 -0
- package/dist/shaders/BokehShader.js +109 -0
- package/dist/shaders/BokehShader.mjs +109 -0
- package/dist/shaders/BokehShader2.d.ts +50 -0
- package/dist/shaders/BokehShader2.js +269 -0
- package/dist/shaders/BokehShader2.mjs +269 -0
- package/dist/shaders/BrightnessContrastShader.d.ts +21 -0
- package/dist/shaders/BrightnessContrastShader.js +32 -0
- package/dist/shaders/BrightnessContrastShader.mjs +32 -0
- package/dist/shaders/ColorCorrectionShader.d.ts +22 -0
- package/dist/shaders/ColorCorrectionShader.js +30 -0
- package/dist/shaders/ColorCorrectionShader.mjs +30 -0
- package/dist/shaders/ColorifyShader.d.ts +16 -0
- package/dist/shaders/ColorifyShader.js +28 -0
- package/dist/shaders/ColorifyShader.mjs +28 -0
- package/dist/shaders/ConvolutionShader.d.ts +21 -0
- package/dist/shaders/ConvolutionShader.js +55 -0
- package/dist/shaders/ConvolutionShader.mjs +55 -0
- package/dist/shaders/CopyShader.d.ts +12 -0
- package/dist/shaders/CopyShader.js +25 -0
- package/dist/shaders/CopyShader.mjs +25 -0
- package/dist/shaders/DOFMipMapShader.d.ts +23 -0
- package/dist/shaders/DOFMipMapShader.js +32 -0
- package/dist/shaders/DOFMipMapShader.mjs +32 -0
- package/dist/shaders/DepthLimitedBlurShader.d.ts +28 -0
- package/dist/shaders/DepthLimitedBlurShader.js +114 -0
- package/dist/shaders/DepthLimitedBlurShader.mjs +114 -0
- package/dist/shaders/DigitalGlitch.d.ts +39 -0
- package/dist/shaders/DigitalGlitch.js +85 -0
- package/dist/shaders/DigitalGlitch.mjs +85 -0
- package/dist/shaders/DotScreenShader.d.ts +27 -0
- package/dist/shaders/DotScreenShader.js +39 -0
- package/dist/shaders/DotScreenShader.mjs +39 -0
- package/dist/shaders/FXAAShader.d.ts +19 -0
- package/dist/shaders/FXAAShader.js +1098 -0
- package/dist/shaders/FXAAShader.mjs +1098 -0
- package/dist/shaders/FilmShader.d.ts +43 -0
- package/dist/shaders/FilmShader.js +53 -0
- package/dist/shaders/FilmShader.mjs +53 -0
- package/dist/shaders/FocusShader.d.ts +26 -0
- package/dist/shaders/FocusShader.js +55 -0
- package/dist/shaders/FocusShader.mjs +55 -0
- package/dist/shaders/FreiChenShader.d.ts +19 -0
- package/dist/shaders/FreiChenShader.js +64 -0
- package/dist/shaders/FreiChenShader.mjs +64 -0
- package/dist/shaders/FresnelShader.d.ts +24 -0
- package/dist/shaders/FresnelShader.js +47 -0
- package/dist/shaders/FresnelShader.mjs +47 -0
- package/dist/shaders/GammaCorrectionShader.d.ts +12 -0
- package/dist/shaders/GammaCorrectionShader.js +23 -0
- package/dist/shaders/GammaCorrectionShader.mjs +23 -0
- package/dist/shaders/GodRaysShader.d.ts +97 -0
- package/dist/shaders/GodRaysShader.js +183 -0
- package/dist/shaders/GodRaysShader.mjs +183 -0
- package/dist/shaders/HalftoneShader.d.ts +51 -0
- package/dist/shaders/HalftoneShader.js +228 -0
- package/dist/shaders/HalftoneShader.mjs +228 -0
- package/dist/shaders/HorizontalBlurShader.d.ts +18 -0
- package/dist/shaders/HorizontalBlurShader.js +49 -0
- package/dist/shaders/HorizontalBlurShader.mjs +49 -0
- package/dist/shaders/HorizontalTiltShiftShader.d.ts +23 -0
- package/dist/shaders/HorizontalTiltShiftShader.js +37 -0
- package/dist/shaders/HorizontalTiltShiftShader.mjs +37 -0
- package/dist/shaders/HueSaturationShader.d.ts +21 -0
- package/dist/shaders/HueSaturationShader.js +43 -0
- package/dist/shaders/HueSaturationShader.mjs +43 -0
- package/dist/shaders/KaleidoShader.d.ts +24 -0
- package/dist/shaders/KaleidoShader.js +34 -0
- package/dist/shaders/KaleidoShader.mjs +34 -0
- package/dist/shaders/LuminosityHighPassShader.d.ts +27 -0
- package/dist/shaders/LuminosityHighPassShader.js +37 -0
- package/dist/shaders/LuminosityHighPassShader.mjs +37 -0
- package/dist/shaders/LuminosityShader.d.ts +13 -0
- package/dist/shaders/LuminosityShader.js +25 -0
- package/dist/shaders/LuminosityShader.mjs +25 -0
- package/dist/shaders/MirrorShader.d.ts +18 -0
- package/dist/shaders/MirrorShader.js +35 -0
- package/dist/shaders/MirrorShader.mjs +35 -0
- package/dist/shaders/NormalMapShader.d.ts +23 -0
- package/dist/shaders/NormalMapShader.js +31 -0
- package/dist/shaders/NormalMapShader.mjs +31 -0
- package/dist/shaders/ParallaxShader.d.ts +28 -0
- package/dist/shaders/ParallaxShader.js +133 -0
- package/dist/shaders/ParallaxShader.mjs +133 -0
- package/dist/shaders/PixelShader.d.ts +18 -0
- package/dist/shaders/PixelShader.js +28 -0
- package/dist/shaders/PixelShader.mjs +28 -0
- package/dist/shaders/RGBShiftShader.d.ts +24 -0
- package/dist/shaders/RGBShiftShader.js +30 -0
- package/dist/shaders/RGBShiftShader.mjs +30 -0
- package/dist/shaders/SAOShader.d.ts +25 -0
- package/dist/shaders/SAOShader.js +144 -0
- package/dist/shaders/SAOShader.mjs +144 -0
- package/dist/shaders/SMAAShader.d.ts +60 -0
- package/dist/shaders/SMAAShader.js +358 -0
- package/dist/shaders/SMAAShader.mjs +358 -0
- package/dist/shaders/SSAOShader.d.ts +86 -0
- package/dist/shaders/SSAOShader.js +182 -0
- package/dist/shaders/SSAOShader.mjs +182 -0
- package/dist/shaders/SSRShader.d.ts +94 -0
- package/dist/shaders/SSRShader.js +342 -0
- package/dist/shaders/SSRShader.mjs +342 -0
- package/dist/shaders/SepiaShader.d.ts +17 -0
- package/dist/shaders/SepiaShader.js +29 -0
- package/dist/shaders/SepiaShader.mjs +29 -0
- package/dist/shaders/SobelOperatorShader.d.ts +19 -0
- package/dist/shaders/SobelOperatorShader.js +54 -0
- package/dist/shaders/SobelOperatorShader.mjs +54 -0
- package/dist/shaders/SubsurfaceScatteringShader.d.ts +5 -0
- package/dist/shaders/SubsurfaceScatteringShader.js +59 -0
- package/dist/shaders/SubsurfaceScatteringShader.mjs +59 -0
- package/dist/shaders/TechnicolorShader.d.ts +15 -0
- package/dist/shaders/TechnicolorShader.js +24 -0
- package/dist/shaders/TechnicolorShader.mjs +24 -0
- package/dist/shaders/ToneMapShader.d.ts +27 -0
- package/dist/shaders/ToneMapShader.js +51 -0
- package/dist/shaders/ToneMapShader.mjs +51 -0
- package/dist/shaders/ToonShader.d.ts +108 -0
- package/dist/shaders/ToonShader.js +188 -0
- package/dist/shaders/ToonShader.mjs +188 -0
- package/dist/shaders/TriangleBlurShader.d.ts +22 -0
- package/dist/shaders/TriangleBlurShader.js +37 -0
- package/dist/shaders/TriangleBlurShader.mjs +37 -0
- package/dist/shaders/UnpackDepthRGBAShader.d.ts +16 -0
- package/dist/shaders/UnpackDepthRGBAShader.js +26 -0
- package/dist/shaders/UnpackDepthRGBAShader.mjs +26 -0
- package/dist/shaders/VerticalBlurShader.d.ts +18 -0
- package/dist/shaders/VerticalBlurShader.js +50 -0
- package/dist/shaders/VerticalBlurShader.mjs +50 -0
- package/dist/shaders/VerticalTiltShiftShader.d.ts +23 -0
- package/dist/shaders/VerticalTiltShiftShader.js +37 -0
- package/dist/shaders/VerticalTiltShiftShader.mjs +37 -0
- package/dist/shaders/VignetteShader.d.ts +20 -0
- package/dist/shaders/VignetteShader.js +38 -0
- package/dist/shaders/VignetteShader.mjs +38 -0
- package/dist/shaders/VolumeShader.d.ts +30 -0
- package/dist/shaders/VolumeShader.js +225 -0
- package/dist/shaders/VolumeShader.mjs +225 -0
- package/dist/shaders/WaterRefractionShader.d.ts +21 -0
- package/dist/shaders/WaterRefractionShader.js +59 -0
- package/dist/shaders/WaterRefractionShader.mjs +59 -0
- package/dist/shaders/types.d.ts +14 -0
- package/dist/shaders/types.js +1 -0
- package/dist/shaders/types.mjs +1 -0
- package/dist/textures/FlakesTexture.d.ts +4 -0
- package/dist/textures/FlakesTexture.js +30 -0
- package/dist/textures/FlakesTexture.mjs +30 -0
- package/dist/types/helpers.d.ts +1 -0
- package/dist/types/helpers.js +4 -0
- package/dist/types/helpers.mjs +4 -0
- package/dist/types/shared.d.ts +2 -0
- package/dist/types/utils.d.ts +3 -0
- package/dist/utils/BufferGeometryUtils.d.ts +48 -0
- package/dist/utils/BufferGeometryUtils.js +636 -0
- package/dist/utils/BufferGeometryUtils.mjs +636 -0
- package/dist/utils/GeometryCompressionUtils.d.ts +7 -0
- package/dist/utils/GeometryCompressionUtils.js +573 -0
- package/dist/utils/GeometryCompressionUtils.mjs +573 -0
- package/dist/utils/GeometryUtils.d.ts +6 -0
- package/dist/utils/GeometryUtils.js +109 -0
- package/dist/utils/GeometryUtils.mjs +109 -0
- package/dist/utils/LDrawUtils.d.ts +5 -0
- package/dist/utils/RoughnessMipmapper.js +219 -0
- package/dist/utils/RoughnessMipmapper.mjs +219 -0
- package/dist/utils/SceneUtils.d.ts +9 -0
- package/dist/utils/SceneUtils.js +36 -0
- package/dist/utils/SceneUtils.mjs +36 -0
- package/dist/utils/ShadowMapViewer.d.ts +24 -0
- package/dist/utils/ShadowMapViewer.js +114 -0
- package/dist/utils/ShadowMapViewer.mjs +114 -0
- package/dist/utils/SkeletonUtils.d.ts +30 -0
- package/dist/utils/SkeletonUtils.js +292 -0
- package/dist/utils/SkeletonUtils.mjs +292 -0
- package/dist/utils/UVsDebug.d.ts +3 -0
- package/dist/utils/UVsDebug.js +85 -0
- package/dist/utils/UVsDebug.mjs +85 -0
- package/dist/utils/WorkerPool.js +62 -0
- package/dist/utils/WorkerPool.mjs +62 -0
- package/dist/webxr/ARButton.d.ts +5 -0
- package/dist/webxr/ARButton.js +119 -0
- package/dist/webxr/ARButton.mjs +119 -0
- package/dist/webxr/OculusHandModel.d.ts +22 -0
- package/dist/webxr/OculusHandModel.js +82 -0
- package/dist/webxr/OculusHandModel.mjs +82 -0
- package/dist/webxr/OculusHandPointerModel.d.ts +63 -0
- package/dist/webxr/OculusHandPointerModel.js +224 -0
- package/dist/webxr/OculusHandPointerModel.mjs +207 -0
- package/dist/webxr/Text2D.d.ts +3 -0
- package/dist/webxr/Text2D.js +48 -0
- package/dist/webxr/Text2D.mjs +31 -0
- package/dist/webxr/VRButton.d.ts +7 -0
- package/dist/webxr/VRButton.js +111 -0
- package/dist/webxr/VRButton.mjs +111 -0
- package/dist/webxr/XRControllerModelFactory.d.ts +23 -0
- package/dist/webxr/XRControllerModelFactory.js +174 -0
- package/dist/webxr/XRControllerModelFactory.mjs +174 -0
- package/dist/webxr/XREstimatedLight.d.ts +33 -0
- package/dist/webxr/XREstimatedLight.js +126 -0
- package/dist/webxr/XREstimatedLight.mjs +126 -0
- package/dist/webxr/XRHandMeshModel.d.ts +9 -0
- package/dist/webxr/XRHandMeshModel.js +82 -0
- package/dist/webxr/XRHandMeshModel.mjs +82 -0
- package/dist/webxr/XRHandModelFactory.d.ts +25 -0
- package/dist/webxr/XRHandModelFactory.js +61 -0
- package/dist/webxr/XRHandModelFactory.mjs +61 -0
- package/dist/webxr/XRHandPrimitiveModel.d.ts +24 -0
- package/dist/webxr/XRHandPrimitiveModel.js +68 -0
- package/dist/webxr/XRHandPrimitiveModel.mjs +68 -0
- package/package.json +1 -1
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const THREE = require("three");
|
|
4
|
+
const VolumeRenderShader1 = {
|
|
5
|
+
uniforms: {
|
|
6
|
+
u_size: { value: new THREE.Vector3(1, 1, 1) },
|
|
7
|
+
u_renderstyle: { value: 0 },
|
|
8
|
+
u_renderthreshold: { value: 0.5 },
|
|
9
|
+
u_clim: { value: new THREE.Vector2(1, 1) },
|
|
10
|
+
u_data: { value: null },
|
|
11
|
+
u_cmdata: { value: null }
|
|
12
|
+
},
|
|
13
|
+
vertexShader: [
|
|
14
|
+
" varying vec4 v_nearpos;",
|
|
15
|
+
" varying vec4 v_farpos;",
|
|
16
|
+
" varying vec3 v_position;",
|
|
17
|
+
" void main() {",
|
|
18
|
+
// Prepare transforms to map to "camera view". See also:
|
|
19
|
+
// https://threejs.org/docs/#api/renderers/webgl/WebGLProgram
|
|
20
|
+
" mat4 viewtransformf = modelViewMatrix;",
|
|
21
|
+
" mat4 viewtransformi = inverse(modelViewMatrix);",
|
|
22
|
+
// Project local vertex coordinate to camera position. Then do a step
|
|
23
|
+
// backward (in cam coords) to the near clipping plane, and project back. Do
|
|
24
|
+
// the same for the far clipping plane. This gives us all the information we
|
|
25
|
+
// need to calculate the ray and truncate it to the viewing cone.
|
|
26
|
+
" vec4 position4 = vec4(position, 1.0);",
|
|
27
|
+
" vec4 pos_in_cam = viewtransformf * position4;",
|
|
28
|
+
// Intersection of ray and near clipping plane (z = -1 in clip coords)
|
|
29
|
+
" pos_in_cam.z = -pos_in_cam.w;",
|
|
30
|
+
" v_nearpos = viewtransformi * pos_in_cam;",
|
|
31
|
+
// Intersection of ray and far clipping plane (z = +1 in clip coords)
|
|
32
|
+
" pos_in_cam.z = pos_in_cam.w;",
|
|
33
|
+
" v_farpos = viewtransformi * pos_in_cam;",
|
|
34
|
+
// Set varyings and output pos
|
|
35
|
+
" v_position = position;",
|
|
36
|
+
" gl_Position = projectionMatrix * viewMatrix * modelMatrix * position4;",
|
|
37
|
+
" }"
|
|
38
|
+
].join("\n"),
|
|
39
|
+
fragmentShader: [
|
|
40
|
+
" precision highp float;",
|
|
41
|
+
" precision mediump sampler3D;",
|
|
42
|
+
" uniform vec3 u_size;",
|
|
43
|
+
" uniform int u_renderstyle;",
|
|
44
|
+
" uniform float u_renderthreshold;",
|
|
45
|
+
" uniform vec2 u_clim;",
|
|
46
|
+
" uniform sampler3D u_data;",
|
|
47
|
+
" uniform sampler2D u_cmdata;",
|
|
48
|
+
" varying vec3 v_position;",
|
|
49
|
+
" varying vec4 v_nearpos;",
|
|
50
|
+
" varying vec4 v_farpos;",
|
|
51
|
+
// The maximum distance through our rendering volume is sqrt(3).
|
|
52
|
+
" const int MAX_STEPS = 887; // 887 for 512^3, 1774 for 1024^3",
|
|
53
|
+
" const int REFINEMENT_STEPS = 4;",
|
|
54
|
+
" const float relative_step_size = 1.0;",
|
|
55
|
+
" const vec4 ambient_color = vec4(0.2, 0.4, 0.2, 1.0);",
|
|
56
|
+
" const vec4 diffuse_color = vec4(0.8, 0.2, 0.2, 1.0);",
|
|
57
|
+
" const vec4 specular_color = vec4(1.0, 1.0, 1.0, 1.0);",
|
|
58
|
+
" const float shininess = 40.0;",
|
|
59
|
+
" void cast_mip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);",
|
|
60
|
+
" void cast_iso(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);",
|
|
61
|
+
" float sample1(vec3 texcoords);",
|
|
62
|
+
" vec4 apply_colormap(float val);",
|
|
63
|
+
" vec4 add_lighting(float val, vec3 loc, vec3 step, vec3 view_ray);",
|
|
64
|
+
" void main() {",
|
|
65
|
+
// Normalize clipping plane info
|
|
66
|
+
" vec3 farpos = v_farpos.xyz / v_farpos.w;",
|
|
67
|
+
" vec3 nearpos = v_nearpos.xyz / v_nearpos.w;",
|
|
68
|
+
// Calculate unit vector pointing in the view direction through this fragment.
|
|
69
|
+
" vec3 view_ray = normalize(nearpos.xyz - farpos.xyz);",
|
|
70
|
+
// Compute the (negative) distance to the front surface or near clipping plane.
|
|
71
|
+
// v_position is the back face of the cuboid, so the initial distance calculated in the dot
|
|
72
|
+
// product below is the distance from near clip plane to the back of the cuboid
|
|
73
|
+
" float distance = dot(nearpos - v_position, view_ray);",
|
|
74
|
+
" distance = max(distance, min((-0.5 - v_position.x) / view_ray.x,",
|
|
75
|
+
" (u_size.x - 0.5 - v_position.x) / view_ray.x));",
|
|
76
|
+
" distance = max(distance, min((-0.5 - v_position.y) / view_ray.y,",
|
|
77
|
+
" (u_size.y - 0.5 - v_position.y) / view_ray.y));",
|
|
78
|
+
" distance = max(distance, min((-0.5 - v_position.z) / view_ray.z,",
|
|
79
|
+
" (u_size.z - 0.5 - v_position.z) / view_ray.z));",
|
|
80
|
+
// Now we have the starting position on the front surface
|
|
81
|
+
" vec3 front = v_position + view_ray * distance;",
|
|
82
|
+
// Decide how many steps to take
|
|
83
|
+
" int nsteps = int(-distance / relative_step_size + 0.5);",
|
|
84
|
+
" if ( nsteps < 1 )",
|
|
85
|
+
" discard;",
|
|
86
|
+
// Get starting location and step vector in texture coordinates
|
|
87
|
+
" vec3 step = ((v_position - front) / u_size) / float(nsteps);",
|
|
88
|
+
" vec3 start_loc = front / u_size;",
|
|
89
|
+
// For testing: show the number of steps. This helps to establish
|
|
90
|
+
// whether the rays are correctly oriented
|
|
91
|
+
//'gl_FragColor = vec4(0.0, float(nsteps) / 1.0 / u_size.x, 1.0, 1.0);',
|
|
92
|
+
//'return;',
|
|
93
|
+
" if (u_renderstyle == 0)",
|
|
94
|
+
" cast_mip(start_loc, step, nsteps, view_ray);",
|
|
95
|
+
" else if (u_renderstyle == 1)",
|
|
96
|
+
" cast_iso(start_loc, step, nsteps, view_ray);",
|
|
97
|
+
" if (gl_FragColor.a < 0.05)",
|
|
98
|
+
" discard;",
|
|
99
|
+
" }",
|
|
100
|
+
" float sample1(vec3 texcoords) {",
|
|
101
|
+
" /* Sample float value from a 3D texture. Assumes intensity data. */",
|
|
102
|
+
" return texture(u_data, texcoords.xyz).r;",
|
|
103
|
+
" }",
|
|
104
|
+
" vec4 apply_colormap(float val) {",
|
|
105
|
+
" val = (val - u_clim[0]) / (u_clim[1] - u_clim[0]);",
|
|
106
|
+
" return texture2D(u_cmdata, vec2(val, 0.5));",
|
|
107
|
+
" }",
|
|
108
|
+
" void cast_mip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray) {",
|
|
109
|
+
" float max_val = -1e6;",
|
|
110
|
+
" int max_i = 100;",
|
|
111
|
+
" vec3 loc = start_loc;",
|
|
112
|
+
// Enter the raycasting loop. In WebGL 1 the loop index cannot be compared with
|
|
113
|
+
// non-constant expression. So we use a hard-coded max, and an additional condition
|
|
114
|
+
// inside the loop.
|
|
115
|
+
" for (int iter=0; iter<MAX_STEPS; iter++) {",
|
|
116
|
+
" if (iter >= nsteps)",
|
|
117
|
+
" break;",
|
|
118
|
+
// Sample from the 3D texture
|
|
119
|
+
" float val = sample1(loc);",
|
|
120
|
+
// Apply MIP operation
|
|
121
|
+
" if (val > max_val) {",
|
|
122
|
+
" max_val = val;",
|
|
123
|
+
" max_i = iter;",
|
|
124
|
+
" }",
|
|
125
|
+
// Advance location deeper into the volume
|
|
126
|
+
" loc += step;",
|
|
127
|
+
" }",
|
|
128
|
+
// Refine location, gives crispier images
|
|
129
|
+
" vec3 iloc = start_loc + step * (float(max_i) - 0.5);",
|
|
130
|
+
" vec3 istep = step / float(REFINEMENT_STEPS);",
|
|
131
|
+
" for (int i=0; i<REFINEMENT_STEPS; i++) {",
|
|
132
|
+
" max_val = max(max_val, sample1(iloc));",
|
|
133
|
+
" iloc += istep;",
|
|
134
|
+
" }",
|
|
135
|
+
// Resolve final color
|
|
136
|
+
" gl_FragColor = apply_colormap(max_val);",
|
|
137
|
+
" }",
|
|
138
|
+
" void cast_iso(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray) {",
|
|
139
|
+
" gl_FragColor = vec4(0.0); // init transparent",
|
|
140
|
+
" vec4 color3 = vec4(0.0); // final color",
|
|
141
|
+
" vec3 dstep = 1.5 / u_size; // step to sample derivative",
|
|
142
|
+
" vec3 loc = start_loc;",
|
|
143
|
+
" float low_threshold = u_renderthreshold - 0.02 * (u_clim[1] - u_clim[0]);",
|
|
144
|
+
// Enter the raycasting loop. In WebGL 1 the loop index cannot be compared with
|
|
145
|
+
// non-constant expression. So we use a hard-coded max, and an additional condition
|
|
146
|
+
// inside the loop.
|
|
147
|
+
" for (int iter=0; iter<MAX_STEPS; iter++) {",
|
|
148
|
+
" if (iter >= nsteps)",
|
|
149
|
+
" break;",
|
|
150
|
+
// Sample from the 3D texture
|
|
151
|
+
" float val = sample1(loc);",
|
|
152
|
+
" if (val > low_threshold) {",
|
|
153
|
+
// Take the last interval in smaller steps
|
|
154
|
+
" vec3 iloc = loc - 0.5 * step;",
|
|
155
|
+
" vec3 istep = step / float(REFINEMENT_STEPS);",
|
|
156
|
+
" for (int i=0; i<REFINEMENT_STEPS; i++) {",
|
|
157
|
+
" val = sample1(iloc);",
|
|
158
|
+
" if (val > u_renderthreshold) {",
|
|
159
|
+
" gl_FragColor = add_lighting(val, iloc, dstep, view_ray);",
|
|
160
|
+
" return;",
|
|
161
|
+
" }",
|
|
162
|
+
" iloc += istep;",
|
|
163
|
+
" }",
|
|
164
|
+
" }",
|
|
165
|
+
// Advance location deeper into the volume
|
|
166
|
+
" loc += step;",
|
|
167
|
+
" }",
|
|
168
|
+
" }",
|
|
169
|
+
" vec4 add_lighting(float val, vec3 loc, vec3 step, vec3 view_ray)",
|
|
170
|
+
" {",
|
|
171
|
+
// Calculate color by incorporating lighting
|
|
172
|
+
// View direction
|
|
173
|
+
" vec3 V = normalize(view_ray);",
|
|
174
|
+
// calculate normal vector from gradient
|
|
175
|
+
" vec3 N;",
|
|
176
|
+
" float val1, val2;",
|
|
177
|
+
" val1 = sample1(loc + vec3(-step[0], 0.0, 0.0));",
|
|
178
|
+
" val2 = sample1(loc + vec3(+step[0], 0.0, 0.0));",
|
|
179
|
+
" N[0] = val1 - val2;",
|
|
180
|
+
" val = max(max(val1, val2), val);",
|
|
181
|
+
" val1 = sample1(loc + vec3(0.0, -step[1], 0.0));",
|
|
182
|
+
" val2 = sample1(loc + vec3(0.0, +step[1], 0.0));",
|
|
183
|
+
" N[1] = val1 - val2;",
|
|
184
|
+
" val = max(max(val1, val2), val);",
|
|
185
|
+
" val1 = sample1(loc + vec3(0.0, 0.0, -step[2]));",
|
|
186
|
+
" val2 = sample1(loc + vec3(0.0, 0.0, +step[2]));",
|
|
187
|
+
" N[2] = val1 - val2;",
|
|
188
|
+
" val = max(max(val1, val2), val);",
|
|
189
|
+
" float gm = length(N); // gradient magnitude",
|
|
190
|
+
" N = normalize(N);",
|
|
191
|
+
// Flip normal so it points towards viewer
|
|
192
|
+
" float Nselect = float(dot(N, V) > 0.0);",
|
|
193
|
+
" N = (2.0 * Nselect - 1.0) * N; // == Nselect * N - (1.0-Nselect)*N;",
|
|
194
|
+
// Init colors
|
|
195
|
+
" vec4 ambient_color = vec4(0.0, 0.0, 0.0, 0.0);",
|
|
196
|
+
" vec4 diffuse_color = vec4(0.0, 0.0, 0.0, 0.0);",
|
|
197
|
+
" vec4 specular_color = vec4(0.0, 0.0, 0.0, 0.0);",
|
|
198
|
+
// note: could allow multiple lights
|
|
199
|
+
" for (int i=0; i<1; i++)",
|
|
200
|
+
" {",
|
|
201
|
+
// Get light direction (make sure to prevent zero devision)
|
|
202
|
+
" vec3 L = normalize(view_ray); //lightDirs[i];",
|
|
203
|
+
" float lightEnabled = float( length(L) > 0.0 );",
|
|
204
|
+
" L = normalize(L + (1.0 - lightEnabled));",
|
|
205
|
+
// Calculate lighting properties
|
|
206
|
+
" float lambertTerm = clamp(dot(N, L), 0.0, 1.0);",
|
|
207
|
+
" vec3 H = normalize(L+V); // Halfway vector",
|
|
208
|
+
" float specularTerm = pow(max(dot(H, N), 0.0), shininess);",
|
|
209
|
+
// Calculate mask
|
|
210
|
+
" float mask1 = lightEnabled;",
|
|
211
|
+
// Calculate colors
|
|
212
|
+
" ambient_color += mask1 * ambient_color; // * gl_LightSource[i].ambient;",
|
|
213
|
+
" diffuse_color += mask1 * lambertTerm;",
|
|
214
|
+
" specular_color += mask1 * specularTerm * specular_color;",
|
|
215
|
+
" }",
|
|
216
|
+
// Calculate final color by componing different components
|
|
217
|
+
" vec4 final_color;",
|
|
218
|
+
" vec4 color = apply_colormap(val);",
|
|
219
|
+
" final_color = color * (ambient_color + diffuse_color) + specular_color;",
|
|
220
|
+
" final_color.a = color.a;",
|
|
221
|
+
" return final_color;",
|
|
222
|
+
" }"
|
|
223
|
+
].join("\n")
|
|
224
|
+
};
|
|
225
|
+
exports.VolumeRenderShader1 = VolumeRenderShader1;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { Vector3, Vector2 } from "three";
|
|
2
|
+
const VolumeRenderShader1 = {
|
|
3
|
+
uniforms: {
|
|
4
|
+
u_size: { value: new Vector3(1, 1, 1) },
|
|
5
|
+
u_renderstyle: { value: 0 },
|
|
6
|
+
u_renderthreshold: { value: 0.5 },
|
|
7
|
+
u_clim: { value: new Vector2(1, 1) },
|
|
8
|
+
u_data: { value: null },
|
|
9
|
+
u_cmdata: { value: null }
|
|
10
|
+
},
|
|
11
|
+
vertexShader: [
|
|
12
|
+
" varying vec4 v_nearpos;",
|
|
13
|
+
" varying vec4 v_farpos;",
|
|
14
|
+
" varying vec3 v_position;",
|
|
15
|
+
" void main() {",
|
|
16
|
+
// Prepare transforms to map to "camera view". See also:
|
|
17
|
+
// https://threejs.org/docs/#api/renderers/webgl/WebGLProgram
|
|
18
|
+
" mat4 viewtransformf = modelViewMatrix;",
|
|
19
|
+
" mat4 viewtransformi = inverse(modelViewMatrix);",
|
|
20
|
+
// Project local vertex coordinate to camera position. Then do a step
|
|
21
|
+
// backward (in cam coords) to the near clipping plane, and project back. Do
|
|
22
|
+
// the same for the far clipping plane. This gives us all the information we
|
|
23
|
+
// need to calculate the ray and truncate it to the viewing cone.
|
|
24
|
+
" vec4 position4 = vec4(position, 1.0);",
|
|
25
|
+
" vec4 pos_in_cam = viewtransformf * position4;",
|
|
26
|
+
// Intersection of ray and near clipping plane (z = -1 in clip coords)
|
|
27
|
+
" pos_in_cam.z = -pos_in_cam.w;",
|
|
28
|
+
" v_nearpos = viewtransformi * pos_in_cam;",
|
|
29
|
+
// Intersection of ray and far clipping plane (z = +1 in clip coords)
|
|
30
|
+
" pos_in_cam.z = pos_in_cam.w;",
|
|
31
|
+
" v_farpos = viewtransformi * pos_in_cam;",
|
|
32
|
+
// Set varyings and output pos
|
|
33
|
+
" v_position = position;",
|
|
34
|
+
" gl_Position = projectionMatrix * viewMatrix * modelMatrix * position4;",
|
|
35
|
+
" }"
|
|
36
|
+
].join("\n"),
|
|
37
|
+
fragmentShader: [
|
|
38
|
+
" precision highp float;",
|
|
39
|
+
" precision mediump sampler3D;",
|
|
40
|
+
" uniform vec3 u_size;",
|
|
41
|
+
" uniform int u_renderstyle;",
|
|
42
|
+
" uniform float u_renderthreshold;",
|
|
43
|
+
" uniform vec2 u_clim;",
|
|
44
|
+
" uniform sampler3D u_data;",
|
|
45
|
+
" uniform sampler2D u_cmdata;",
|
|
46
|
+
" varying vec3 v_position;",
|
|
47
|
+
" varying vec4 v_nearpos;",
|
|
48
|
+
" varying vec4 v_farpos;",
|
|
49
|
+
// The maximum distance through our rendering volume is sqrt(3).
|
|
50
|
+
" const int MAX_STEPS = 887; // 887 for 512^3, 1774 for 1024^3",
|
|
51
|
+
" const int REFINEMENT_STEPS = 4;",
|
|
52
|
+
" const float relative_step_size = 1.0;",
|
|
53
|
+
" const vec4 ambient_color = vec4(0.2, 0.4, 0.2, 1.0);",
|
|
54
|
+
" const vec4 diffuse_color = vec4(0.8, 0.2, 0.2, 1.0);",
|
|
55
|
+
" const vec4 specular_color = vec4(1.0, 1.0, 1.0, 1.0);",
|
|
56
|
+
" const float shininess = 40.0;",
|
|
57
|
+
" void cast_mip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);",
|
|
58
|
+
" void cast_iso(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);",
|
|
59
|
+
" float sample1(vec3 texcoords);",
|
|
60
|
+
" vec4 apply_colormap(float val);",
|
|
61
|
+
" vec4 add_lighting(float val, vec3 loc, vec3 step, vec3 view_ray);",
|
|
62
|
+
" void main() {",
|
|
63
|
+
// Normalize clipping plane info
|
|
64
|
+
" vec3 farpos = v_farpos.xyz / v_farpos.w;",
|
|
65
|
+
" vec3 nearpos = v_nearpos.xyz / v_nearpos.w;",
|
|
66
|
+
// Calculate unit vector pointing in the view direction through this fragment.
|
|
67
|
+
" vec3 view_ray = normalize(nearpos.xyz - farpos.xyz);",
|
|
68
|
+
// Compute the (negative) distance to the front surface or near clipping plane.
|
|
69
|
+
// v_position is the back face of the cuboid, so the initial distance calculated in the dot
|
|
70
|
+
// product below is the distance from near clip plane to the back of the cuboid
|
|
71
|
+
" float distance = dot(nearpos - v_position, view_ray);",
|
|
72
|
+
" distance = max(distance, min((-0.5 - v_position.x) / view_ray.x,",
|
|
73
|
+
" (u_size.x - 0.5 - v_position.x) / view_ray.x));",
|
|
74
|
+
" distance = max(distance, min((-0.5 - v_position.y) / view_ray.y,",
|
|
75
|
+
" (u_size.y - 0.5 - v_position.y) / view_ray.y));",
|
|
76
|
+
" distance = max(distance, min((-0.5 - v_position.z) / view_ray.z,",
|
|
77
|
+
" (u_size.z - 0.5 - v_position.z) / view_ray.z));",
|
|
78
|
+
// Now we have the starting position on the front surface
|
|
79
|
+
" vec3 front = v_position + view_ray * distance;",
|
|
80
|
+
// Decide how many steps to take
|
|
81
|
+
" int nsteps = int(-distance / relative_step_size + 0.5);",
|
|
82
|
+
" if ( nsteps < 1 )",
|
|
83
|
+
" discard;",
|
|
84
|
+
// Get starting location and step vector in texture coordinates
|
|
85
|
+
" vec3 step = ((v_position - front) / u_size) / float(nsteps);",
|
|
86
|
+
" vec3 start_loc = front / u_size;",
|
|
87
|
+
// For testing: show the number of steps. This helps to establish
|
|
88
|
+
// whether the rays are correctly oriented
|
|
89
|
+
//'gl_FragColor = vec4(0.0, float(nsteps) / 1.0 / u_size.x, 1.0, 1.0);',
|
|
90
|
+
//'return;',
|
|
91
|
+
" if (u_renderstyle == 0)",
|
|
92
|
+
" cast_mip(start_loc, step, nsteps, view_ray);",
|
|
93
|
+
" else if (u_renderstyle == 1)",
|
|
94
|
+
" cast_iso(start_loc, step, nsteps, view_ray);",
|
|
95
|
+
" if (gl_FragColor.a < 0.05)",
|
|
96
|
+
" discard;",
|
|
97
|
+
" }",
|
|
98
|
+
" float sample1(vec3 texcoords) {",
|
|
99
|
+
" /* Sample float value from a 3D texture. Assumes intensity data. */",
|
|
100
|
+
" return texture(u_data, texcoords.xyz).r;",
|
|
101
|
+
" }",
|
|
102
|
+
" vec4 apply_colormap(float val) {",
|
|
103
|
+
" val = (val - u_clim[0]) / (u_clim[1] - u_clim[0]);",
|
|
104
|
+
" return texture2D(u_cmdata, vec2(val, 0.5));",
|
|
105
|
+
" }",
|
|
106
|
+
" void cast_mip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray) {",
|
|
107
|
+
" float max_val = -1e6;",
|
|
108
|
+
" int max_i = 100;",
|
|
109
|
+
" vec3 loc = start_loc;",
|
|
110
|
+
// Enter the raycasting loop. In WebGL 1 the loop index cannot be compared with
|
|
111
|
+
// non-constant expression. So we use a hard-coded max, and an additional condition
|
|
112
|
+
// inside the loop.
|
|
113
|
+
" for (int iter=0; iter<MAX_STEPS; iter++) {",
|
|
114
|
+
" if (iter >= nsteps)",
|
|
115
|
+
" break;",
|
|
116
|
+
// Sample from the 3D texture
|
|
117
|
+
" float val = sample1(loc);",
|
|
118
|
+
// Apply MIP operation
|
|
119
|
+
" if (val > max_val) {",
|
|
120
|
+
" max_val = val;",
|
|
121
|
+
" max_i = iter;",
|
|
122
|
+
" }",
|
|
123
|
+
// Advance location deeper into the volume
|
|
124
|
+
" loc += step;",
|
|
125
|
+
" }",
|
|
126
|
+
// Refine location, gives crispier images
|
|
127
|
+
" vec3 iloc = start_loc + step * (float(max_i) - 0.5);",
|
|
128
|
+
" vec3 istep = step / float(REFINEMENT_STEPS);",
|
|
129
|
+
" for (int i=0; i<REFINEMENT_STEPS; i++) {",
|
|
130
|
+
" max_val = max(max_val, sample1(iloc));",
|
|
131
|
+
" iloc += istep;",
|
|
132
|
+
" }",
|
|
133
|
+
// Resolve final color
|
|
134
|
+
" gl_FragColor = apply_colormap(max_val);",
|
|
135
|
+
" }",
|
|
136
|
+
" void cast_iso(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray) {",
|
|
137
|
+
" gl_FragColor = vec4(0.0); // init transparent",
|
|
138
|
+
" vec4 color3 = vec4(0.0); // final color",
|
|
139
|
+
" vec3 dstep = 1.5 / u_size; // step to sample derivative",
|
|
140
|
+
" vec3 loc = start_loc;",
|
|
141
|
+
" float low_threshold = u_renderthreshold - 0.02 * (u_clim[1] - u_clim[0]);",
|
|
142
|
+
// Enter the raycasting loop. In WebGL 1 the loop index cannot be compared with
|
|
143
|
+
// non-constant expression. So we use a hard-coded max, and an additional condition
|
|
144
|
+
// inside the loop.
|
|
145
|
+
" for (int iter=0; iter<MAX_STEPS; iter++) {",
|
|
146
|
+
" if (iter >= nsteps)",
|
|
147
|
+
" break;",
|
|
148
|
+
// Sample from the 3D texture
|
|
149
|
+
" float val = sample1(loc);",
|
|
150
|
+
" if (val > low_threshold) {",
|
|
151
|
+
// Take the last interval in smaller steps
|
|
152
|
+
" vec3 iloc = loc - 0.5 * step;",
|
|
153
|
+
" vec3 istep = step / float(REFINEMENT_STEPS);",
|
|
154
|
+
" for (int i=0; i<REFINEMENT_STEPS; i++) {",
|
|
155
|
+
" val = sample1(iloc);",
|
|
156
|
+
" if (val > u_renderthreshold) {",
|
|
157
|
+
" gl_FragColor = add_lighting(val, iloc, dstep, view_ray);",
|
|
158
|
+
" return;",
|
|
159
|
+
" }",
|
|
160
|
+
" iloc += istep;",
|
|
161
|
+
" }",
|
|
162
|
+
" }",
|
|
163
|
+
// Advance location deeper into the volume
|
|
164
|
+
" loc += step;",
|
|
165
|
+
" }",
|
|
166
|
+
" }",
|
|
167
|
+
" vec4 add_lighting(float val, vec3 loc, vec3 step, vec3 view_ray)",
|
|
168
|
+
" {",
|
|
169
|
+
// Calculate color by incorporating lighting
|
|
170
|
+
// View direction
|
|
171
|
+
" vec3 V = normalize(view_ray);",
|
|
172
|
+
// calculate normal vector from gradient
|
|
173
|
+
" vec3 N;",
|
|
174
|
+
" float val1, val2;",
|
|
175
|
+
" val1 = sample1(loc + vec3(-step[0], 0.0, 0.0));",
|
|
176
|
+
" val2 = sample1(loc + vec3(+step[0], 0.0, 0.0));",
|
|
177
|
+
" N[0] = val1 - val2;",
|
|
178
|
+
" val = max(max(val1, val2), val);",
|
|
179
|
+
" val1 = sample1(loc + vec3(0.0, -step[1], 0.0));",
|
|
180
|
+
" val2 = sample1(loc + vec3(0.0, +step[1], 0.0));",
|
|
181
|
+
" N[1] = val1 - val2;",
|
|
182
|
+
" val = max(max(val1, val2), val);",
|
|
183
|
+
" val1 = sample1(loc + vec3(0.0, 0.0, -step[2]));",
|
|
184
|
+
" val2 = sample1(loc + vec3(0.0, 0.0, +step[2]));",
|
|
185
|
+
" N[2] = val1 - val2;",
|
|
186
|
+
" val = max(max(val1, val2), val);",
|
|
187
|
+
" float gm = length(N); // gradient magnitude",
|
|
188
|
+
" N = normalize(N);",
|
|
189
|
+
// Flip normal so it points towards viewer
|
|
190
|
+
" float Nselect = float(dot(N, V) > 0.0);",
|
|
191
|
+
" N = (2.0 * Nselect - 1.0) * N; // == Nselect * N - (1.0-Nselect)*N;",
|
|
192
|
+
// Init colors
|
|
193
|
+
" vec4 ambient_color = vec4(0.0, 0.0, 0.0, 0.0);",
|
|
194
|
+
" vec4 diffuse_color = vec4(0.0, 0.0, 0.0, 0.0);",
|
|
195
|
+
" vec4 specular_color = vec4(0.0, 0.0, 0.0, 0.0);",
|
|
196
|
+
// note: could allow multiple lights
|
|
197
|
+
" for (int i=0; i<1; i++)",
|
|
198
|
+
" {",
|
|
199
|
+
// Get light direction (make sure to prevent zero devision)
|
|
200
|
+
" vec3 L = normalize(view_ray); //lightDirs[i];",
|
|
201
|
+
" float lightEnabled = float( length(L) > 0.0 );",
|
|
202
|
+
" L = normalize(L + (1.0 - lightEnabled));",
|
|
203
|
+
// Calculate lighting properties
|
|
204
|
+
" float lambertTerm = clamp(dot(N, L), 0.0, 1.0);",
|
|
205
|
+
" vec3 H = normalize(L+V); // Halfway vector",
|
|
206
|
+
" float specularTerm = pow(max(dot(H, N), 0.0), shininess);",
|
|
207
|
+
// Calculate mask
|
|
208
|
+
" float mask1 = lightEnabled;",
|
|
209
|
+
// Calculate colors
|
|
210
|
+
" ambient_color += mask1 * ambient_color; // * gl_LightSource[i].ambient;",
|
|
211
|
+
" diffuse_color += mask1 * lambertTerm;",
|
|
212
|
+
" specular_color += mask1 * specularTerm * specular_color;",
|
|
213
|
+
" }",
|
|
214
|
+
// Calculate final color by componing different components
|
|
215
|
+
" vec4 final_color;",
|
|
216
|
+
" vec4 color = apply_colormap(val);",
|
|
217
|
+
" final_color = color * (ambient_color + diffuse_color) + specular_color;",
|
|
218
|
+
" final_color.a = color.a;",
|
|
219
|
+
" return final_color;",
|
|
220
|
+
" }"
|
|
221
|
+
].join("\n")
|
|
222
|
+
};
|
|
223
|
+
export {
|
|
224
|
+
VolumeRenderShader1
|
|
225
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const WaterRefractionShader: {
|
|
2
|
+
uniforms: {
|
|
3
|
+
color: {
|
|
4
|
+
value: null;
|
|
5
|
+
};
|
|
6
|
+
time: {
|
|
7
|
+
value: number;
|
|
8
|
+
};
|
|
9
|
+
tDiffuse: {
|
|
10
|
+
value: null;
|
|
11
|
+
};
|
|
12
|
+
tDudv: {
|
|
13
|
+
value: null;
|
|
14
|
+
};
|
|
15
|
+
textureMatrix: {
|
|
16
|
+
value: null;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
vertexShader: string;
|
|
20
|
+
fragmentShader: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const WaterRefractionShader = {
|
|
4
|
+
uniforms: {
|
|
5
|
+
color: {
|
|
6
|
+
value: null
|
|
7
|
+
},
|
|
8
|
+
time: {
|
|
9
|
+
value: 0
|
|
10
|
+
},
|
|
11
|
+
tDiffuse: {
|
|
12
|
+
value: null
|
|
13
|
+
},
|
|
14
|
+
tDudv: {
|
|
15
|
+
value: null
|
|
16
|
+
},
|
|
17
|
+
textureMatrix: {
|
|
18
|
+
value: null
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
vertexShader: [
|
|
22
|
+
"uniform mat4 textureMatrix;",
|
|
23
|
+
"varying vec2 vUv;",
|
|
24
|
+
"varying vec4 vUvRefraction;",
|
|
25
|
+
"void main() {",
|
|
26
|
+
" vUv = uv;",
|
|
27
|
+
" vUvRefraction = textureMatrix * vec4( position, 1.0 );",
|
|
28
|
+
" gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
|
|
29
|
+
"}"
|
|
30
|
+
].join("\n"),
|
|
31
|
+
fragmentShader: [
|
|
32
|
+
"uniform vec3 color;",
|
|
33
|
+
"uniform float time;",
|
|
34
|
+
"uniform sampler2D tDiffuse;",
|
|
35
|
+
"uniform sampler2D tDudv;",
|
|
36
|
+
"varying vec2 vUv;",
|
|
37
|
+
"varying vec4 vUvRefraction;",
|
|
38
|
+
"float blendOverlay( float base, float blend ) {",
|
|
39
|
+
" return( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );",
|
|
40
|
+
"}",
|
|
41
|
+
"vec3 blendOverlay( vec3 base, vec3 blend ) {",
|
|
42
|
+
" return vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );",
|
|
43
|
+
"}",
|
|
44
|
+
"void main() {",
|
|
45
|
+
" float waveStrength = 0.1;",
|
|
46
|
+
" float waveSpeed = 0.03;",
|
|
47
|
+
// simple distortion (ripple) via dudv map (see https://www.youtube.com/watch?v=6B7IF6GOu7s)
|
|
48
|
+
" vec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;",
|
|
49
|
+
" distortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );",
|
|
50
|
+
" vec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;",
|
|
51
|
+
// new uv coords
|
|
52
|
+
" vec4 uv = vec4( vUvRefraction );",
|
|
53
|
+
" uv.xy += distortion;",
|
|
54
|
+
" vec4 base = texture2DProj( tDiffuse, uv );",
|
|
55
|
+
" gl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );",
|
|
56
|
+
"}"
|
|
57
|
+
].join("\n")
|
|
58
|
+
};
|
|
59
|
+
exports.WaterRefractionShader = WaterRefractionShader;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const WaterRefractionShader = {
|
|
2
|
+
uniforms: {
|
|
3
|
+
color: {
|
|
4
|
+
value: null
|
|
5
|
+
},
|
|
6
|
+
time: {
|
|
7
|
+
value: 0
|
|
8
|
+
},
|
|
9
|
+
tDiffuse: {
|
|
10
|
+
value: null
|
|
11
|
+
},
|
|
12
|
+
tDudv: {
|
|
13
|
+
value: null
|
|
14
|
+
},
|
|
15
|
+
textureMatrix: {
|
|
16
|
+
value: null
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
vertexShader: [
|
|
20
|
+
"uniform mat4 textureMatrix;",
|
|
21
|
+
"varying vec2 vUv;",
|
|
22
|
+
"varying vec4 vUvRefraction;",
|
|
23
|
+
"void main() {",
|
|
24
|
+
" vUv = uv;",
|
|
25
|
+
" vUvRefraction = textureMatrix * vec4( position, 1.0 );",
|
|
26
|
+
" gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
|
|
27
|
+
"}"
|
|
28
|
+
].join("\n"),
|
|
29
|
+
fragmentShader: [
|
|
30
|
+
"uniform vec3 color;",
|
|
31
|
+
"uniform float time;",
|
|
32
|
+
"uniform sampler2D tDiffuse;",
|
|
33
|
+
"uniform sampler2D tDudv;",
|
|
34
|
+
"varying vec2 vUv;",
|
|
35
|
+
"varying vec4 vUvRefraction;",
|
|
36
|
+
"float blendOverlay( float base, float blend ) {",
|
|
37
|
+
" return( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );",
|
|
38
|
+
"}",
|
|
39
|
+
"vec3 blendOverlay( vec3 base, vec3 blend ) {",
|
|
40
|
+
" return vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );",
|
|
41
|
+
"}",
|
|
42
|
+
"void main() {",
|
|
43
|
+
" float waveStrength = 0.1;",
|
|
44
|
+
" float waveSpeed = 0.03;",
|
|
45
|
+
// simple distortion (ripple) via dudv map (see https://www.youtube.com/watch?v=6B7IF6GOu7s)
|
|
46
|
+
" vec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;",
|
|
47
|
+
" distortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );",
|
|
48
|
+
" vec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;",
|
|
49
|
+
// new uv coords
|
|
50
|
+
" vec4 uv = vec4( vUvRefraction );",
|
|
51
|
+
" uv.xy += distortion;",
|
|
52
|
+
" vec4 base = texture2DProj( tDiffuse, uv );",
|
|
53
|
+
" gl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );",
|
|
54
|
+
"}"
|
|
55
|
+
].join("\n")
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
WaterRefractionShader
|
|
59
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IUniform, Shader } from 'three';
|
|
2
|
+
declare type Defines = {
|
|
3
|
+
[key: string]: boolean | number | string;
|
|
4
|
+
};
|
|
5
|
+
declare type Uniforms = {
|
|
6
|
+
[key: string]: IUniform;
|
|
7
|
+
};
|
|
8
|
+
export interface IShader<U extends Uniforms, D extends Defines | undefined = undefined> extends Shader {
|
|
9
|
+
defines?: D;
|
|
10
|
+
fragmentShader: string;
|
|
11
|
+
uniforms: U;
|
|
12
|
+
vertexShader: string;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
class FlakesTexture {
|
|
4
|
+
constructor(width = 512, height = 512) {
|
|
5
|
+
const canvas = document.createElement("canvas");
|
|
6
|
+
canvas.width = width;
|
|
7
|
+
canvas.height = height;
|
|
8
|
+
const context = canvas.getContext("2d");
|
|
9
|
+
context.fillStyle = "rgb(127,127,255)";
|
|
10
|
+
context.fillRect(0, 0, width, height);
|
|
11
|
+
for (let i = 0; i < 4e3; i++) {
|
|
12
|
+
const x = Math.random() * width;
|
|
13
|
+
const y = Math.random() * height;
|
|
14
|
+
const r = Math.random() * 3 + 3;
|
|
15
|
+
let nx = Math.random() * 2 - 1;
|
|
16
|
+
let ny = Math.random() * 2 - 1;
|
|
17
|
+
let nz = 1.5;
|
|
18
|
+
const l = Math.sqrt(nx * nx + ny * ny + nz * nz);
|
|
19
|
+
nx /= l;
|
|
20
|
+
ny /= l;
|
|
21
|
+
nz /= l;
|
|
22
|
+
context.fillStyle = "rgb(" + (nx * 127 + 127) + "," + (ny * 127 + 127) + "," + nz * 255 + ")";
|
|
23
|
+
context.beginPath();
|
|
24
|
+
context.arc(x, y, r, 0, Math.PI * 2);
|
|
25
|
+
context.fill();
|
|
26
|
+
}
|
|
27
|
+
return canvas;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.FlakesTexture = FlakesTexture;
|