@ohos-ports/react-three-drei 10.7.7-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +852 -0
- package/core/AccumulativeShadows.cjs.js +1 -0
- package/core/AccumulativeShadows.d.ts +59 -0
- package/core/AccumulativeShadows.js +310 -0
- package/core/AdaptiveDpr.cjs.js +1 -0
- package/core/AdaptiveDpr.d.ts +3 -0
- package/core/AdaptiveDpr.js +28 -0
- package/core/AdaptiveEvents.cjs.js +1 -0
- package/core/AdaptiveEvents.d.ts +1 -0
- package/core/AdaptiveEvents.js +20 -0
- package/core/ArcballControls.cjs.js +1 -0
- package/core/ArcballControls.d.ts +15 -0
- package/core/ArcballControls.js +67 -0
- package/core/AsciiRenderer.cjs.js +1 -0
- package/core/AsciiRenderer.d.ts +11 -0
- package/core/AsciiRenderer.js +66 -0
- package/core/BBAnchor.cjs.js +1 -0
- package/core/BBAnchor.d.ts +7 -0
- package/core/BBAnchor.js +37 -0
- package/core/Backdrop.cjs.js +1 -0
- package/core/Backdrop.d.ts +15 -0
- package/core/Backdrop.js +33 -0
- package/core/BakeShadows.cjs.js +1 -0
- package/core/BakeShadows.d.ts +1 -0
- package/core/BakeShadows.js +16 -0
- package/core/Billboard.cjs.js +1 -0
- package/core/Billboard.d.ts +10 -0
- package/core/Billboard.js +53 -0
- package/core/Bounds.cjs.js +1 -0
- package/core/Bounds.d.ts +36 -0
- package/core/Bounds.js +254 -0
- package/core/Bvh.cjs.js +1 -0
- package/core/Bvh.d.ts +19 -0
- package/core/Bvh.js +92 -0
- package/core/CameraControls.cjs.js +1 -0
- package/core/CameraControls.d.ts +48 -0
- package/core/CameraControls.js +151 -0
- package/core/CameraShake.cjs.js +1 -0
- package/core/CameraShake.d.ts +17 -0
- package/core/CameraShake.js +57 -0
- package/core/CatmullRomLine.cjs.js +1 -0
- package/core/CatmullRomLine.d.ts +10 -0
- package/core/CatmullRomLine.js +42 -0
- package/core/Caustics.cjs.js +1 -0
- package/core/Caustics.d.ts +32 -0
- package/core/Caustics.js +388 -0
- package/core/Center.cjs.js +1 -0
- package/core/Center.d.ts +33 -0
- package/core/Center.js +67 -0
- package/core/Clone.cjs.js +1 -0
- package/core/Clone.d.ts +15 -0
- package/core/Clone.js +100 -0
- package/core/Cloud.cjs.js +1 -0
- package/core/Cloud.d.ts +97 -0
- package/core/Cloud.js +231 -0
- package/core/ComputedAttribute.cjs.js +1 -0
- package/core/ComputedAttribute.d.ts +8 -0
- package/core/ComputedAttribute.js +33 -0
- package/core/ContactShadows.cjs.js +1 -0
- package/core/ContactShadows.d.ts +18 -0
- package/core/ContactShadows.js +114 -0
- package/core/CubeCamera.cjs.js +1 -0
- package/core/CubeCamera.d.ts +21 -0
- package/core/CubeCamera.js +86 -0
- package/core/CubeTexture.cjs.js +1 -0
- package/core/CubeTexture.d.ts +14 -0
- package/core/CubeTexture.js +25 -0
- package/core/CubicBezierLine.cjs.js +1 -0
- package/core/CubicBezierLine.d.ts +12 -0
- package/core/CubicBezierLine.js +28 -0
- package/core/CurveModifier.cjs.js +1 -0
- package/core/CurveModifier.d.ts +11 -0
- package/core/CurveModifier.js +27 -0
- package/core/Decal.cjs.js +1 -0
- package/core/Decal.d.ts +16 -0
- package/core/Decal.js +128 -0
- package/core/Detailed.cjs.js +1 -0
- package/core/Detailed.d.ts +10 -0
- package/core/Detailed.js +33 -0
- package/core/DetectGPU.cjs.js +1 -0
- package/core/DetectGPU.d.ts +7 -0
- package/core/DetectGPU.js +14 -0
- package/core/DeviceOrientationControls.cjs.js +1 -0
- package/core/DeviceOrientationControls.d.ts +10 -0
- package/core/DeviceOrientationControls.js +51 -0
- package/core/Edges.cjs.js +1 -0
- package/core/Edges.d.ts +13 -0
- package/core/Edges.js +38 -0
- package/core/Effects.cjs.js +1 -0
- package/core/Effects.d.ts +25 -0
- package/core/Effects.js +91 -0
- package/core/Environment.cjs.js +1 -0
- package/core/Environment.d.ts +37 -0
- package/core/Environment.js +189 -0
- package/core/Example.cjs.js +1 -0
- package/core/Example.d.ts +13 -0
- package/core/Example.js +46 -0
- package/core/Fbo.cjs.js +1 -0
- package/core/Fbo.d.ts +22 -0
- package/core/Fbo.js +63 -0
- package/core/Fbx.cjs.js +1 -0
- package/core/Fbx.d.ts +11 -0
- package/core/Fbx.js +23 -0
- package/core/FirstPersonControls.cjs.js +1 -0
- package/core/FirstPersonControls.d.ts +8 -0
- package/core/FirstPersonControls.js +38 -0
- package/core/Fisheye.cjs.js +1 -0
- package/core/Fisheye.d.ts +10 -0
- package/core/Fisheye.js +95 -0
- package/core/Float.cjs.js +1 -0
- package/core/Float.d.ts +14 -0
- package/core/Float.js +37 -0
- package/core/FlyControls.cjs.js +1 -0
- package/core/FlyControls.d.ts +10 -0
- package/core/FlyControls.js +55 -0
- package/core/GizmoHelper.cjs.js +1 -0
- package/core/GizmoHelper.d.ts +16 -0
- package/core/GizmoHelper.js +116 -0
- package/core/GizmoViewcube.cjs.js +1 -0
- package/core/GizmoViewcube.d.ts +14 -0
- package/core/GizmoViewcube.js +133 -0
- package/core/GizmoViewport.cjs.js +1 -0
- package/core/GizmoViewport.d.ts +16 -0
- package/core/GizmoViewport.js +140 -0
- package/core/Gltf.cjs.js +1 -0
- package/core/Gltf.d.ts +27 -0
- package/core/Gltf.js +52 -0
- package/core/GradientTexture.cjs.js +1 -0
- package/core/GradientTexture.d.ts +18 -0
- package/core/GradientTexture.js +54 -0
- package/core/Grid.cjs.js +1 -0
- package/core/Grid.d.ts +26 -0
- package/core/Grid.js +142 -0
- package/core/Helper.cjs.js +1 -0
- package/core/Helper.d.ts +16 -0
- package/core/Helper.js +47 -0
- package/core/Hud.cjs.js +1 -0
- package/core/Hud.d.ts +6 -0
- package/core/Hud.js +55 -0
- package/core/Image.cjs.js +1 -0
- package/core/Image.d.ts +38 -0
- package/core/Image.js +160 -0
- package/core/Instances.cjs.js +1 -0
- package/core/Instances.d.ts +64 -0
- package/core/Instances.js +313 -0
- package/core/Ktx2.cjs.js +1 -0
- package/core/Ktx2.d.ts +14 -0
- package/core/Ktx2.js +48 -0
- package/core/Lightformer.cjs.js +1 -0
- package/core/Lightformer.d.ts +15 -0
- package/core/Lightformer.js +63 -0
- package/core/Line.cjs.js +1 -0
- package/core/Line.d.ts +13 -0
- package/core/Line.js +73 -0
- package/core/MapControls.cjs.js +1 -0
- package/core/MapControls.d.ts +14 -0
- package/core/MapControls.js +63 -0
- package/core/MarchingCubes.cjs.js +1 -0
- package/core/MarchingCubes.d.ts +24 -0
- package/core/MarchingCubes.js +78 -0
- package/core/Mask.cjs.js +1 -0
- package/core/Mask.d.ts +17 -0
- package/core/Mask.js +42 -0
- package/core/MatcapTexture.cjs.js +1 -0
- package/core/MatcapTexture.d.ts +9 -0
- package/core/MatcapTexture.js +51 -0
- package/core/MeshDiscardMaterial.cjs.js +1 -0
- package/core/MeshDiscardMaterial.d.ts +10 -0
- package/core/MeshDiscardMaterial.js +15 -0
- package/core/MeshDistortMaterial.cjs.js +1 -0
- package/core/MeshDistortMaterial.d.ts +39 -0
- package/core/MeshDistortMaterial.js +72 -0
- package/core/MeshPortalMaterial.cjs.js +1 -0
- package/core/MeshPortalMaterial.d.ts +25 -0
- package/core/MeshPortalMaterial.js +467 -0
- package/core/MeshReflectorMaterial.cjs.js +1 -0
- package/core/MeshReflectorMaterial.d.ts +14 -0
- package/core/MeshReflectorMaterial.js +180 -0
- package/core/MeshRefractionMaterial.cjs.js +1 -0
- package/core/MeshRefractionMaterial.d.ts +19 -0
- package/core/MeshRefractionMaterial.js +73 -0
- package/core/MeshTransmissionMaterial.cjs.js +1 -0
- package/core/MeshTransmissionMaterial.d.ts +34 -0
- package/core/MeshTransmissionMaterial.js +402 -0
- package/core/MeshWobbleMaterial.cjs.js +1 -0
- package/core/MeshWobbleMaterial.d.ts +36 -0
- package/core/MeshWobbleMaterial.js +60 -0
- package/core/MotionPathControls.cjs.js +1 -0
- package/core/MotionPathControls.d.ts +33 -0
- package/core/MotionPathControls.js +121 -0
- package/core/MultiMaterial.cjs.js +1 -0
- package/core/MultiMaterial.d.ts +4 -0
- package/core/MultiMaterial.js +29 -0
- package/core/NormalTexture.cjs.js +1 -0
- package/core/NormalTexture.d.ts +14 -0
- package/core/NormalTexture.js +42 -0
- package/core/OrbitControls.cjs.js +1 -0
- package/core/OrbitControls.d.ts +22 -0
- package/core/OrbitControls.js +79 -0
- package/core/OrthographicCamera.cjs.js +1 -0
- package/core/OrthographicCamera.d.ts +14 -0
- package/core/OrthographicCamera.js +76 -0
- package/core/Outlines.cjs.js +1 -0
- package/core/Outlines.d.ts +17 -0
- package/core/Outlines.js +166 -0
- package/core/PerformanceMonitor.cjs.js +1 -0
- package/core/PerformanceMonitor.d.ts +36 -0
- package/core/PerformanceMonitor.js +116 -0
- package/core/PerspectiveCamera.cjs.js +1 -0
- package/core/PerspectiveCamera.d.ts +14 -0
- package/core/PerspectiveCamera.js +72 -0
- package/core/PointMaterial.cjs.js +1 -0
- package/core/PointMaterial.d.ts +8 -0
- package/core/PointMaterial.js +36 -0
- package/core/PointerLockControls.cjs.js +1 -0
- package/core/PointerLockControls.d.ts +15 -0
- package/core/PointerLockControls.js +89 -0
- package/core/Points.cjs.js +1 -0
- package/core/Points.d.ts +31 -0
- package/core/Points.js +202 -0
- package/core/PositionalAudio.cjs.js +1 -0
- package/core/PositionalAudio.d.ts +9 -0
- package/core/PositionalAudio.js +46 -0
- package/core/Preload.cjs.js +1 -0
- package/core/Preload.d.ts +7 -0
- package/core/Preload.js +44 -0
- package/core/Progress.cjs.js +1 -0
- package/core/Progress.d.ts +14 -0
- package/core/Progress.js +55 -0
- package/core/QuadraticBezierLine.cjs.js +1 -0
- package/core/QuadraticBezierLine.d.ts +14 -0
- package/core/QuadraticBezierLine.js +42 -0
- package/core/RenderCubeTexture.cjs.js +1 -0
- package/core/RenderCubeTexture.d.ts +30 -0
- package/core/RenderCubeTexture.js +96 -0
- package/core/RenderTexture.cjs.js +1 -0
- package/core/RenderTexture.d.ts +18 -0
- package/core/RenderTexture.js +105 -0
- package/core/Resize.cjs.js +1 -0
- package/core/Resize.d.ts +17 -0
- package/core/Resize.js +39 -0
- package/core/RoundedBox.cjs.js +1 -0
- package/core/RoundedBox.d.ts +14 -0
- package/core/RoundedBox.js +70 -0
- package/core/Sampler.cjs.js +1 -0
- package/core/Sampler.d.ts +28 -0
- package/core/Sampler.js +75 -0
- package/core/ScreenQuad.cjs.js +1 -0
- package/core/ScreenQuad.d.ts +5 -0
- package/core/ScreenQuad.js +25 -0
- package/core/ScreenSizer.cjs.js +1 -0
- package/core/ScreenSizer.d.ts +7 -0
- package/core/ScreenSizer.js +39 -0
- package/core/ScreenSpace.cjs.js +1 -0
- package/core/ScreenSpace.d.ts +7 -0
- package/core/ScreenSpace.js +25 -0
- package/core/Segments.cjs.js +1 -0
- package/core/Segments.d.ts +29 -0
- package/core/Segments.js +96 -0
- package/core/Shadow.cjs.js +1 -0
- package/core/Shadow.d.ts +12 -0
- package/core/Shadow.js +42 -0
- package/core/ShadowAlpha.cjs.js +1 -0
- package/core/ShadowAlpha.d.ts +7 -0
- package/core/ShadowAlpha.js +108 -0
- package/core/Sky.cjs.js +1 -0
- package/core/Sky.d.ts +16 -0
- package/core/Sky.js +39 -0
- package/core/Sparkles.cjs.js +1 -0
- package/core/Sparkles.d.ts +26 -0
- package/core/Sparkles.js +161 -0
- package/core/Splat.cjs.js +1 -0
- package/core/Splat.d.ts +56 -0
- package/core/Splat.js +506 -0
- package/core/SpotLight.cjs.js +1 -0
- package/core/SpotLight.d.ts +27 -0
- package/core/SpotLight.js +223 -0
- package/core/SpriteAnimator.cjs.js +1 -0
- package/core/SpriteAnimator.d.ts +88 -0
- package/core/SpriteAnimator.js +413 -0
- package/core/Stage.cjs.js +1 -0
- package/core/Stage.d.ts +27 -0
- package/core/Stage.js +133 -0
- package/core/Stars.cjs.js +1 -0
- package/core/Stars.d.ts +22 -0
- package/core/Stars.js +100 -0
- package/core/Stats.cjs.js +1 -0
- package/core/Stats.d.ts +7 -0
- package/core/Stats.js +32 -0
- package/core/StatsGl.cjs.js +1 -0
- package/core/StatsGl.d.ts +14 -0
- package/core/StatsGl.js +44 -0
- package/core/Svg.cjs.js +1 -0
- package/core/Svg.d.ts +13 -0
- package/core/Svg.js +62 -0
- package/core/Text.cjs.js +1 -0
- package/core/Text.d.ts +38 -0
- package/core/Text.js +57 -0
- package/core/Text3D.cjs.js +1 -0
- package/core/Text3D.d.ts +20 -0
- package/core/Text3D.js +74 -0
- package/core/Texture.cjs.js +1 -0
- package/core/Texture.d.ts +20 -0
- package/core/Texture.js +60 -0
- package/core/TrackballControls.cjs.js +1 -0
- package/core/TrackballControls.d.ts +15 -0
- package/core/TrackballControls.js +72 -0
- package/core/Trail.cjs.js +1 -0
- package/core/Trail.d.ts +21 -0
- package/core/Trail.js +150 -0
- package/core/TrailTexture.cjs.js +1 -0
- package/core/TrailTexture.d.ts +19 -0
- package/core/TrailTexture.js +159 -0
- package/core/TransformControls.cjs.js +1 -0
- package/core/TransformControls.d.ts +28 -0
- package/core/TransformControls.js +114 -0
- package/core/VideoTexture.cjs.js +1 -0
- package/core/VideoTexture.d.ts +26 -0
- package/core/VideoTexture.js +111 -0
- package/core/Wireframe.cjs.js +1 -0
- package/core/Wireframe.d.ts +15 -0
- package/core/Wireframe.js +157 -0
- package/core/calculateScaleFactor.cjs.js +1 -0
- package/core/calculateScaleFactor.d.ts +3 -0
- package/core/calculateScaleFactor.js +31 -0
- package/core/index.cjs.js +1 -0
- package/core/index.d.ts +122 -0
- package/core/index.js +150 -0
- package/core/meshBounds.cjs.js +1 -0
- package/core/meshBounds.d.ts +2 -0
- package/core/meshBounds.js +28 -0
- package/core/shaderMaterial.cjs.js +1 -0
- package/core/shaderMaterial.d.ts +9 -0
- package/core/shaderMaterial.js +29 -0
- package/core/shapes.cjs.js +1 -0
- package/core/shapes.d.ts +26 -0
- package/core/shapes.js +65 -0
- package/core/softShadows.cjs.js +1 -0
- package/core/softShadows.d.ts +6 -0
- package/core/softShadows.js +158 -0
- package/core/useAnimations.cjs.js +1 -0
- package/core/useAnimations.d.ts +13 -0
- package/core/useAnimations.js +52 -0
- package/core/useAspect.cjs.js +1 -0
- package/core/useAspect.d.ts +1 -0
- package/core/useAspect.js +10 -0
- package/core/useBoxProjectedEnv.cjs.js +1 -0
- package/core/useBoxProjectedEnv.d.ts +19 -0
- package/core/useBoxProjectedEnv.js +95 -0
- package/core/useCamera.cjs.js +1 -0
- package/core/useCamera.d.ts +3 -0
- package/core/useCamera.js +19 -0
- package/core/useContextBridge.cjs.js +1 -0
- package/core/useContextBridge.d.ts +4 -0
- package/core/useContextBridge.js +20 -0
- package/core/useDepthBuffer.cjs.js +1 -0
- package/core/useDepthBuffer.d.ts +6 -0
- package/core/useDepthBuffer.js +38 -0
- package/core/useEnvironment.cjs.js +1 -0
- package/core/useEnvironment.d.ts +17 -0
- package/core/useEnvironment.js +150 -0
- package/core/useFont.cjs.js +1 -0
- package/core/useFont.d.ts +24 -0
- package/core/useFont.js +24 -0
- package/core/useIntersect.cjs.js +1 -0
- package/core/useIntersect.d.ts +3 -0
- package/core/useIntersect.js +36 -0
- package/core/useSpriteLoader.cjs.js +1 -0
- package/core/useSpriteLoader.d.ts +57 -0
- package/core/useSpriteLoader.js +402 -0
- package/helpers/constants.cjs.js +1 -0
- package/helpers/constants.d.ts +1 -0
- package/helpers/constants.js +6 -0
- package/helpers/deprecated.cjs.js +1 -0
- package/helpers/deprecated.d.ts +5 -0
- package/helpers/deprecated.js +8 -0
- package/helpers/environment-assets.cjs.js +1 -0
- package/helpers/environment-assets.d.ts +13 -0
- package/helpers/environment-assets.js +14 -0
- package/helpers/glsl/DefaultSpotlightShadowShadows.glsl.js +3 -0
- package/helpers/glsl/distort.vert.glsl.js +3 -0
- package/helpers/ts-utils.cjs.js +1 -0
- package/helpers/ts-utils.d.ts +7 -0
- package/helpers/ts-utils.js +1 -0
- package/helpers/useEffectfulState.cjs.js +1 -0
- package/helpers/useEffectfulState.d.ts +4 -0
- package/helpers/useEffectfulState.js +17 -0
- package/index.cjs.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +139 -0
- package/materials/BlurPass.cjs.js +1 -0
- package/materials/BlurPass.d.ts +23 -0
- package/materials/BlurPass.js +72 -0
- package/materials/ConvolutionMaterial.cjs.js +1 -0
- package/materials/ConvolutionMaterial.d.ts +7 -0
- package/materials/ConvolutionMaterial.js +97 -0
- package/materials/DiscardMaterial.cjs.js +1 -0
- package/materials/DiscardMaterial.d.ts +3 -0
- package/materials/DiscardMaterial.js +5 -0
- package/materials/MeshReflectorMaterial.cjs.js +1 -0
- package/materials/MeshReflectorMaterial.d.ts +50 -0
- package/materials/MeshReflectorMaterial.js +256 -0
- package/materials/MeshRefractionMaterial.cjs.js +1 -0
- package/materials/MeshRefractionMaterial.d.ts +18 -0
- package/materials/MeshRefractionMaterial.js +163 -0
- package/materials/SpotLightMaterial.cjs.js +1 -0
- package/materials/SpotLightMaterial.d.ts +4 -0
- package/materials/SpotLightMaterial.js +115 -0
- package/materials/WireframeMaterial.cjs.js +1 -0
- package/materials/WireframeMaterial.d.ts +64 -0
- package/materials/WireframeMaterial.js +217 -0
- package/native/index.cjs.js +1 -0
- package/native/index.d.ts +1 -0
- package/native/index.js +150 -0
- package/native/package.json +5 -0
- package/package.json +83 -0
- package/web/CycleRaycast.cjs.js +1 -0
- package/web/CycleRaycast.d.ts +10 -0
- package/web/CycleRaycast.js +93 -0
- package/web/DragControls.cjs.js +1 -0
- package/web/DragControls.d.ts +17 -0
- package/web/DragControls.js +127 -0
- package/web/FaceControls.cjs.js +1 -0
- package/web/FaceControls.d.ts +29 -0
- package/web/FaceControls.js +236 -0
- package/web/FaceLandmarker.cjs.js +1 -0
- package/web/FaceLandmarker.d.ts +14 -0
- package/web/FaceLandmarker.js +49 -0
- package/web/Facemesh.cjs.js +1 -0
- package/web/Facemesh.d.ts +118 -0
- package/web/Facemesh.js +4538 -0
- package/web/Html.cjs.js +1 -0
- package/web/Html.d.ts +34 -0
- package/web/Html.js +375 -0
- package/web/KeyboardControls.cjs.js +1 -0
- package/web/KeyboardControls.d.ts +37 -0
- package/web/KeyboardControls.js +104 -0
- package/web/Loader.cjs.js +1 -0
- package/web/Loader.d.ts +12 -0
- package/web/Loader.js +101 -0
- package/web/PresentationControls.cjs.js +1 -0
- package/web/PresentationControls.d.ts +16 -0
- package/web/PresentationControls.js +79 -0
- package/web/ScreenVideoTexture.cjs.js +1 -0
- package/web/ScreenVideoTexture.d.ts +17 -0
- package/web/ScreenVideoTexture.js +30 -0
- package/web/ScrollControls.cjs.js +1 -0
- package/web/ScrollControls.d.ts +45 -0
- package/web/ScrollControls.js +237 -0
- package/web/Select.cjs.js +1 -0
- package/web/Select.d.ts +14 -0
- package/web/Select.js +171 -0
- package/web/View.cjs.js +1 -0
- package/web/View.d.ts +34 -0
- package/web/View.js +259 -0
- package/web/WebcamVideoTexture.cjs.js +1 -0
- package/web/WebcamVideoTexture.d.ts +17 -0
- package/web/WebcamVideoTexture.js +33 -0
- package/web/index.cjs.js +1 -0
- package/web/index.d.ts +17 -0
- package/web/index.js +176 -0
- package/web/pivotControls/AxisArrow.cjs.js +1 -0
- package/web/pivotControls/AxisArrow.d.ts +7 -0
- package/web/pivotControls/AxisArrow.js +193 -0
- package/web/pivotControls/AxisRotator.cjs.js +1 -0
- package/web/pivotControls/AxisRotator.d.ts +7 -0
- package/web/pivotControls/AxisRotator.js +220 -0
- package/web/pivotControls/PlaneSlider.cjs.js +1 -0
- package/web/pivotControls/PlaneSlider.d.ts +7 -0
- package/web/pivotControls/PlaneSlider.js +202 -0
- package/web/pivotControls/ScalingSphere.cjs.js +1 -0
- package/web/pivotControls/ScalingSphere.d.ts +7 -0
- package/web/pivotControls/ScalingSphere.js +192 -0
- package/web/pivotControls/context.cjs.js +1 -0
- package/web/pivotControls/context.d.ts +33 -0
- package/web/pivotControls/context.js +5 -0
- package/web/pivotControls/index.cjs.js +1 -0
- package/web/pivotControls/index.d.ts +39 -0
- package/web/pivotControls/index.js +213 -0
- package/web/useCursor.cjs.js +1 -0
- package/web/useCursor.d.ts +1 -0
- package/web/useCursor.js +12 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './web';
|
package/index.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
export { Html } from './web/Html.js';
|
|
2
|
+
export { CycleRaycast } from './web/CycleRaycast.js';
|
|
3
|
+
export { useCursor } from './web/useCursor.js';
|
|
4
|
+
export { Loader } from './web/Loader.js';
|
|
5
|
+
export { DragControls } from './web/DragControls.js';
|
|
6
|
+
export { Scroll, ScrollControls, useScroll } from './web/ScrollControls.js';
|
|
7
|
+
export { PresentationControls } from './web/PresentationControls.js';
|
|
8
|
+
export { KeyboardControls, useKeyboardControls } from './web/KeyboardControls.js';
|
|
9
|
+
export { Select, useSelect } from './web/Select.js';
|
|
10
|
+
export { Billboard } from './core/Billboard.js';
|
|
11
|
+
export { ScreenSpace } from './core/ScreenSpace.js';
|
|
12
|
+
export { ScreenSizer } from './core/ScreenSizer.js';
|
|
13
|
+
export { QuadraticBezierLine } from './core/QuadraticBezierLine.js';
|
|
14
|
+
export { CubicBezierLine } from './core/CubicBezierLine.js';
|
|
15
|
+
export { CatmullRomLine } from './core/CatmullRomLine.js';
|
|
16
|
+
export { Line } from './core/Line.js';
|
|
17
|
+
export { PositionalAudio } from './core/PositionalAudio.js';
|
|
18
|
+
export { Text } from './core/Text.js';
|
|
19
|
+
export { Text3D } from './core/Text3D.js';
|
|
20
|
+
export { Effects, isWebGL2Available } from './core/Effects.js';
|
|
21
|
+
export { GradientTexture, GradientType } from './core/GradientTexture.js';
|
|
22
|
+
export { Image } from './core/Image.js';
|
|
23
|
+
export { Edges } from './core/Edges.js';
|
|
24
|
+
export { Outlines } from './core/Outlines.js';
|
|
25
|
+
export { Trail, useTrail } from './core/Trail.js';
|
|
26
|
+
export { Sampler, useSurfaceSampler } from './core/Sampler.js';
|
|
27
|
+
export { ComputedAttribute } from './core/ComputedAttribute.js';
|
|
28
|
+
export { Clone } from './core/Clone.js';
|
|
29
|
+
export { MarchingCube, MarchingCubes, MarchingPlane } from './core/MarchingCubes.js';
|
|
30
|
+
export { Decal } from './core/Decal.js';
|
|
31
|
+
export { Svg } from './core/Svg.js';
|
|
32
|
+
export { Gltf, useGLTF } from './core/Gltf.js';
|
|
33
|
+
export { AsciiRenderer } from './core/AsciiRenderer.js';
|
|
34
|
+
export { Splat } from './core/Splat.js';
|
|
35
|
+
export { OrthographicCamera } from './core/OrthographicCamera.js';
|
|
36
|
+
export { PerspectiveCamera } from './core/PerspectiveCamera.js';
|
|
37
|
+
export { CubeCamera, useCubeCamera } from './core/CubeCamera.js';
|
|
38
|
+
export { DeviceOrientationControls } from './core/DeviceOrientationControls.js';
|
|
39
|
+
export { FlyControls } from './core/FlyControls.js';
|
|
40
|
+
export { MapControls } from './core/MapControls.js';
|
|
41
|
+
export { OrbitControls } from './core/OrbitControls.js';
|
|
42
|
+
export { TrackballControls } from './core/TrackballControls.js';
|
|
43
|
+
export { ArcballControls } from './core/ArcballControls.js';
|
|
44
|
+
export { TransformControls } from './core/TransformControls.js';
|
|
45
|
+
export { PointerLockControls } from './core/PointerLockControls.js';
|
|
46
|
+
export { FirstPersonControls } from './core/FirstPersonControls.js';
|
|
47
|
+
export { CameraControls } from './core/CameraControls.js';
|
|
48
|
+
export { default as CameraControlsImpl } from 'camera-controls';
|
|
49
|
+
export { MotionPathControls, useMotion } from './core/MotionPathControls.js';
|
|
50
|
+
export { GizmoHelper, useGizmoContext } from './core/GizmoHelper.js';
|
|
51
|
+
export { GizmoViewcube } from './core/GizmoViewcube.js';
|
|
52
|
+
export { GizmoViewport } from './core/GizmoViewport.js';
|
|
53
|
+
export { Grid } from './core/Grid.js';
|
|
54
|
+
export { CubeTexture, useCubeTexture } from './core/CubeTexture.js';
|
|
55
|
+
export { Fbx, useFBX } from './core/Fbx.js';
|
|
56
|
+
export { Ktx2, useKTX2 } from './core/Ktx2.js';
|
|
57
|
+
export { Progress, useProgress } from './core/Progress.js';
|
|
58
|
+
export { IsObject, Texture, useTexture } from './core/Texture.js';
|
|
59
|
+
export { VideoTexture, useVideoTexture } from './core/VideoTexture.js';
|
|
60
|
+
export { useFont } from './core/useFont.js';
|
|
61
|
+
export { checkIfFrameIsEmpty, getFirstFrame, useSpriteLoader } from './core/useSpriteLoader.js';
|
|
62
|
+
export { Helper, useHelper } from './core/Helper.js';
|
|
63
|
+
export { Stats } from './core/Stats.js';
|
|
64
|
+
export { StatsGl } from './core/StatsGl.js';
|
|
65
|
+
export { useDepthBuffer } from './core/useDepthBuffer.js';
|
|
66
|
+
export { useAspect } from './core/useAspect.js';
|
|
67
|
+
export { useCamera } from './core/useCamera.js';
|
|
68
|
+
export { DetectGPU, useDetectGPU } from './core/DetectGPU.js';
|
|
69
|
+
export { Bvh, useBVH } from './core/Bvh.js';
|
|
70
|
+
export { useContextBridge } from './core/useContextBridge.js';
|
|
71
|
+
export { useAnimations } from './core/useAnimations.js';
|
|
72
|
+
export { Fbo, useFBO } from './core/Fbo.js';
|
|
73
|
+
export { useIntersect } from './core/useIntersect.js';
|
|
74
|
+
export { useBoxProjectedEnv } from './core/useBoxProjectedEnv.js';
|
|
75
|
+
export { BBAnchor } from './core/BBAnchor.js';
|
|
76
|
+
export { TrailTexture, useTrailTexture } from './core/TrailTexture.js';
|
|
77
|
+
export { Example } from './core/Example.js';
|
|
78
|
+
export { SpriteAnimator, useSpriteAnimator } from './core/SpriteAnimator.js';
|
|
79
|
+
export { CurveModifier } from './core/CurveModifier.js';
|
|
80
|
+
export { MeshDistortMaterial } from './core/MeshDistortMaterial.js';
|
|
81
|
+
export { MeshWobbleMaterial } from './core/MeshWobbleMaterial.js';
|
|
82
|
+
export { MeshReflectorMaterial } from './core/MeshReflectorMaterial.js';
|
|
83
|
+
export { MeshRefractionMaterial } from './core/MeshRefractionMaterial.js';
|
|
84
|
+
export { MeshTransmissionMaterial } from './core/MeshTransmissionMaterial.js';
|
|
85
|
+
export { MeshDiscardMaterial } from './core/MeshDiscardMaterial.js';
|
|
86
|
+
export { MultiMaterial } from './core/MultiMaterial.js';
|
|
87
|
+
export { PointMaterial, PointMaterialImpl } from './core/PointMaterial.js';
|
|
88
|
+
export { shaderMaterial } from './core/shaderMaterial.js';
|
|
89
|
+
export { SoftShadows } from './core/softShadows.js';
|
|
90
|
+
export { Box, Capsule, Circle, Cone, Cylinder, Dodecahedron, Extrude, Icosahedron, Lathe, Octahedron, Plane, Polyhedron, Ring, Shape, Sphere, Tetrahedron, Torus, TorusKnot, Tube } from './core/shapes.js';
|
|
91
|
+
export { RoundedBox, RoundedBoxGeometry } from './core/RoundedBox.js';
|
|
92
|
+
export { ScreenQuad } from './core/ScreenQuad.js';
|
|
93
|
+
export { Center } from './core/Center.js';
|
|
94
|
+
export { Resize } from './core/Resize.js';
|
|
95
|
+
export { Bounds, useBounds } from './core/Bounds.js';
|
|
96
|
+
export { CameraShake } from './core/CameraShake.js';
|
|
97
|
+
export { Float } from './core/Float.js';
|
|
98
|
+
export { Stage } from './core/Stage.js';
|
|
99
|
+
export { Backdrop } from './core/Backdrop.js';
|
|
100
|
+
export { Shadow } from './core/Shadow.js';
|
|
101
|
+
export { Caustics } from './core/Caustics.js';
|
|
102
|
+
export { ContactShadows } from './core/ContactShadows.js';
|
|
103
|
+
export { AccumulativeShadows, RandomizedLight, accumulativeContext } from './core/AccumulativeShadows.js';
|
|
104
|
+
export { SpotLight, SpotLightShadow } from './core/SpotLight.js';
|
|
105
|
+
export { Environment, EnvironmentCube, EnvironmentMap, EnvironmentPortal } from './core/Environment.js';
|
|
106
|
+
export { Lightformer } from './core/Lightformer.js';
|
|
107
|
+
export { Sky, calcPosFromAngles } from './core/Sky.js';
|
|
108
|
+
export { Stars } from './core/Stars.js';
|
|
109
|
+
export { Cloud, CloudInstance, Clouds } from './core/Cloud.js';
|
|
110
|
+
export { Sparkles } from './core/Sparkles.js';
|
|
111
|
+
export { useEnvironment } from './core/useEnvironment.js';
|
|
112
|
+
export { MatcapTexture, useMatcapTexture } from './core/MatcapTexture.js';
|
|
113
|
+
export { NormalTexture, useNormalTexture } from './core/NormalTexture.js';
|
|
114
|
+
export { Wireframe } from './core/Wireframe.js';
|
|
115
|
+
export { ShadowAlpha } from './core/ShadowAlpha.js';
|
|
116
|
+
export { Point, Points, PointsBuffer, PositionPoint } from './core/Points.js';
|
|
117
|
+
export { Instance, InstancedAttribute, Instances, Merged, PositionMesh, createInstances } from './core/Instances.js';
|
|
118
|
+
export { Segment, SegmentObject, Segments } from './core/Segments.js';
|
|
119
|
+
export { Detailed } from './core/Detailed.js';
|
|
120
|
+
export { Preload } from './core/Preload.js';
|
|
121
|
+
export { BakeShadows } from './core/BakeShadows.js';
|
|
122
|
+
export { meshBounds } from './core/meshBounds.js';
|
|
123
|
+
export { AdaptiveDpr } from './core/AdaptiveDpr.js';
|
|
124
|
+
export { AdaptiveEvents } from './core/AdaptiveEvents.js';
|
|
125
|
+
export { PerformanceMonitor, usePerformanceMonitor } from './core/PerformanceMonitor.js';
|
|
126
|
+
export { RenderTexture } from './core/RenderTexture.js';
|
|
127
|
+
export { RenderCubeTexture } from './core/RenderCubeTexture.js';
|
|
128
|
+
export { Mask, useMask } from './core/Mask.js';
|
|
129
|
+
export { Hud } from './core/Hud.js';
|
|
130
|
+
export { Fisheye } from './core/Fisheye.js';
|
|
131
|
+
export { MeshPortalMaterial } from './core/MeshPortalMaterial.js';
|
|
132
|
+
export { calculateScaleFactor } from './core/calculateScaleFactor.js';
|
|
133
|
+
export { View } from './web/View.js';
|
|
134
|
+
export { PivotControls } from './web/pivotControls/index.js';
|
|
135
|
+
export { ScreenVideoTexture } from './web/ScreenVideoTexture.js';
|
|
136
|
+
export { WebcamVideoTexture } from './web/WebcamVideoTexture.js';
|
|
137
|
+
export { FaceControls, useFaceControls } from './web/FaceControls.js';
|
|
138
|
+
export { FaceLandmarker, FaceLandmarkerDefaults, useFaceLandmarker } from './web/FaceLandmarker.js';
|
|
139
|
+
export { Facemesh, FacemeshDatas, FacemeshEye, FacemeshEyeDefaults } from './web/Facemesh.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three"),t=require("./ConvolutionMaterial.cjs.js");require("../helpers/constants.cjs.js");exports.BlurPass=class{constructor({gl:r,resolution:i,width:n=500,height:s=500,minDepthThreshold:o=0,maxDepthThreshold:a=1,depthScale:l=0,depthToBlurRatioBias:u=.25}){this.renderToScreen=!1,this.renderTargetA=new e.WebGLRenderTarget(i,i,{minFilter:e.LinearFilter,magFilter:e.LinearFilter,stencilBuffer:!1,depthBuffer:!1,type:e.HalfFloatType}),this.renderTargetB=this.renderTargetA.clone(),this.convolutionMaterial=new t.ConvolutionMaterial,this.convolutionMaterial.setTexelSize(1/n,1/s),this.convolutionMaterial.setResolution(new e.Vector2(n,s)),this.scene=new e.Scene,this.camera=new e.Camera,this.convolutionMaterial.uniforms.minDepthThreshold.value=o,this.convolutionMaterial.uniforms.maxDepthThreshold.value=a,this.convolutionMaterial.uniforms.depthScale.value=l,this.convolutionMaterial.uniforms.depthToBlurRatioBias.value=u,this.convolutionMaterial.defines.USE_DEPTH=l>0;const h=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),c=new Float32Array([0,0,2,0,0,2]),d=new e.BufferGeometry;d.setAttribute("position",new e.BufferAttribute(h,3)),d.setAttribute("uv",new e.BufferAttribute(c,2)),this.screen=new e.Mesh(d,this.convolutionMaterial),this.screen.frustumCulled=!1,this.scene.add(this.screen)}render(e,t,r){const i=this.scene,n=this.camera,s=this.renderTargetA,o=this.renderTargetB;let a=this.convolutionMaterial,l=a.uniforms;l.depthBuffer.value=t.depthTexture;const u=a.kernel;let h,c,d,f=t;for(c=0,d=u.length-1;c<d;++c)h=1&c?o:s,l.kernel.value=u[c],l.inputBuffer.value=f.texture,e.setRenderTarget(h),e.render(i,n),f=h;l.kernel.value=u[c],l.inputBuffer.value=f.texture,e.setRenderTarget(this.renderToScreen?null:r),e.render(i,n)}};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Mesh, Scene, WebGLRenderTarget, WebGLRenderer, Camera } from 'three';
|
|
2
|
+
import { ConvolutionMaterial } from './ConvolutionMaterial';
|
|
3
|
+
export interface BlurPassProps {
|
|
4
|
+
gl: WebGLRenderer;
|
|
5
|
+
resolution: number;
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
minDepthThreshold?: number;
|
|
9
|
+
maxDepthThreshold?: number;
|
|
10
|
+
depthScale?: number;
|
|
11
|
+
depthToBlurRatioBias?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare class BlurPass {
|
|
14
|
+
readonly renderTargetA: WebGLRenderTarget;
|
|
15
|
+
readonly renderTargetB: WebGLRenderTarget;
|
|
16
|
+
readonly convolutionMaterial: ConvolutionMaterial;
|
|
17
|
+
readonly scene: Scene;
|
|
18
|
+
readonly camera: Camera;
|
|
19
|
+
readonly screen: Mesh;
|
|
20
|
+
renderToScreen: boolean;
|
|
21
|
+
constructor({ gl, resolution, width, height, minDepthThreshold, maxDepthThreshold, depthScale, depthToBlurRatioBias, }: BlurPassProps);
|
|
22
|
+
render(renderer: any, inputBuffer: any, outputBuffer: any): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { WebGLRenderTarget, LinearFilter, HalfFloatType, Vector2, Scene, Camera, BufferGeometry, BufferAttribute, Mesh } from 'three';
|
|
2
|
+
import { ConvolutionMaterial } from './ConvolutionMaterial.js';
|
|
3
|
+
|
|
4
|
+
class BlurPass {
|
|
5
|
+
constructor({
|
|
6
|
+
gl,
|
|
7
|
+
resolution,
|
|
8
|
+
width = 500,
|
|
9
|
+
height = 500,
|
|
10
|
+
minDepthThreshold = 0,
|
|
11
|
+
maxDepthThreshold = 1,
|
|
12
|
+
depthScale = 0,
|
|
13
|
+
depthToBlurRatioBias = 0.25
|
|
14
|
+
}) {
|
|
15
|
+
this.renderToScreen = false;
|
|
16
|
+
this.renderTargetA = new WebGLRenderTarget(resolution, resolution, {
|
|
17
|
+
minFilter: LinearFilter,
|
|
18
|
+
magFilter: LinearFilter,
|
|
19
|
+
stencilBuffer: false,
|
|
20
|
+
depthBuffer: false,
|
|
21
|
+
type: HalfFloatType
|
|
22
|
+
});
|
|
23
|
+
this.renderTargetB = this.renderTargetA.clone();
|
|
24
|
+
this.convolutionMaterial = new ConvolutionMaterial();
|
|
25
|
+
this.convolutionMaterial.setTexelSize(1.0 / width, 1.0 / height);
|
|
26
|
+
this.convolutionMaterial.setResolution(new Vector2(width, height));
|
|
27
|
+
this.scene = new Scene();
|
|
28
|
+
this.camera = new Camera();
|
|
29
|
+
this.convolutionMaterial.uniforms.minDepthThreshold.value = minDepthThreshold;
|
|
30
|
+
this.convolutionMaterial.uniforms.maxDepthThreshold.value = maxDepthThreshold;
|
|
31
|
+
this.convolutionMaterial.uniforms.depthScale.value = depthScale;
|
|
32
|
+
this.convolutionMaterial.uniforms.depthToBlurRatioBias.value = depthToBlurRatioBias;
|
|
33
|
+
this.convolutionMaterial.defines.USE_DEPTH = depthScale > 0;
|
|
34
|
+
const vertices = new Float32Array([-1, -1, 0, 3, -1, 0, -1, 3, 0]);
|
|
35
|
+
const uvs = new Float32Array([0, 0, 2, 0, 0, 2]);
|
|
36
|
+
const geometry = new BufferGeometry();
|
|
37
|
+
geometry.setAttribute('position', new BufferAttribute(vertices, 3));
|
|
38
|
+
geometry.setAttribute('uv', new BufferAttribute(uvs, 2));
|
|
39
|
+
this.screen = new Mesh(geometry, this.convolutionMaterial);
|
|
40
|
+
this.screen.frustumCulled = false;
|
|
41
|
+
this.scene.add(this.screen);
|
|
42
|
+
}
|
|
43
|
+
render(renderer, inputBuffer, outputBuffer) {
|
|
44
|
+
const scene = this.scene;
|
|
45
|
+
const camera = this.camera;
|
|
46
|
+
const renderTargetA = this.renderTargetA;
|
|
47
|
+
const renderTargetB = this.renderTargetB;
|
|
48
|
+
let material = this.convolutionMaterial;
|
|
49
|
+
let uniforms = material.uniforms;
|
|
50
|
+
uniforms.depthBuffer.value = inputBuffer.depthTexture;
|
|
51
|
+
const kernel = material.kernel;
|
|
52
|
+
let lastRT = inputBuffer;
|
|
53
|
+
let destRT;
|
|
54
|
+
let i, l;
|
|
55
|
+
// Apply the multi-pass blur.
|
|
56
|
+
for (i = 0, l = kernel.length - 1; i < l; ++i) {
|
|
57
|
+
// Alternate between targets.
|
|
58
|
+
destRT = (i & 1) === 0 ? renderTargetA : renderTargetB;
|
|
59
|
+
uniforms.kernel.value = kernel[i];
|
|
60
|
+
uniforms.inputBuffer.value = lastRT.texture;
|
|
61
|
+
renderer.setRenderTarget(destRT);
|
|
62
|
+
renderer.render(scene, camera);
|
|
63
|
+
lastRT = destRT;
|
|
64
|
+
}
|
|
65
|
+
uniforms.kernel.value = kernel[i];
|
|
66
|
+
uniforms.inputBuffer.value = lastRT.texture;
|
|
67
|
+
renderer.setRenderTarget(this.renderToScreen ? null : outputBuffer);
|
|
68
|
+
renderer.render(scene, camera);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { BlurPass };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three"),n=require("../helpers/constants.cjs.js");function r(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,t.get?t:{enumerable:!0,get:function(){return e[r]}})}})),n.default=e,Object.freeze(n)}var t=r(e);class i extends t.ShaderMaterial{constructor(e=new t.Vector2){super({uniforms:{inputBuffer:new t.Uniform(null),depthBuffer:new t.Uniform(null),resolution:new t.Uniform(new t.Vector2),texelSize:new t.Uniform(new t.Vector2),halfTexelSize:new t.Uniform(new t.Vector2),kernel:new t.Uniform(0),scale:new t.Uniform(1),cameraNear:new t.Uniform(0),cameraFar:new t.Uniform(1),minDepthThreshold:new t.Uniform(0),maxDepthThreshold:new t.Uniform(1),depthScale:new t.Uniform(0),depthToBlurRatioBias:new t.Uniform(.25)},fragmentShader:`#include <common>\n #include <dithering_pars_fragment> \n uniform sampler2D inputBuffer;\n uniform sampler2D depthBuffer;\n uniform float cameraNear;\n uniform float cameraFar;\n uniform float minDepthThreshold;\n uniform float maxDepthThreshold;\n uniform float depthScale;\n uniform float depthToBlurRatioBias;\n varying vec2 vUv;\n varying vec2 vUv0;\n varying vec2 vUv1;\n varying vec2 vUv2;\n varying vec2 vUv3;\n\n void main() {\n float depthFactor = 0.0;\n \n #ifdef USE_DEPTH\n vec4 depth = texture2D(depthBuffer, vUv);\n depthFactor = smoothstep(minDepthThreshold, maxDepthThreshold, 1.0-(depth.r * depth.a));\n depthFactor *= depthScale;\n depthFactor = max(0.0, min(1.0, depthFactor + 0.25));\n #endif\n \n vec4 sum = texture2D(inputBuffer, mix(vUv0, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv1, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv2, vUv, depthFactor));\n sum += texture2D(inputBuffer, mix(vUv3, vUv, depthFactor));\n gl_FragColor = sum * 0.25 ;\n\n #include <dithering_fragment>\n #include <tonemapping_fragment>\n #include <${n.version>=154?"colorspace_fragment":"encodings_fragment"}>\n }`,vertexShader:"uniform vec2 texelSize;\n uniform vec2 halfTexelSize;\n uniform float kernel;\n uniform float scale;\n varying vec2 vUv;\n varying vec2 vUv0;\n varying vec2 vUv1;\n varying vec2 vUv2;\n varying vec2 vUv3;\n\n void main() {\n vec2 uv = position.xy * 0.5 + 0.5;\n vUv = uv;\n\n vec2 dUv = (texelSize * vec2(kernel) + halfTexelSize) * scale;\n vUv0 = vec2(uv.x - dUv.x, uv.y + dUv.y);\n vUv1 = vec2(uv.x + dUv.x, uv.y + dUv.y);\n vUv2 = vec2(uv.x + dUv.x, uv.y - dUv.y);\n vUv3 = vec2(uv.x - dUv.x, uv.y - dUv.y);\n\n gl_Position = vec4(position.xy, 1.0, 1.0);\n }",blending:t.NoBlending,depthWrite:!1,depthTest:!1}),this.toneMapped=!1,this.setTexelSize(e.x,e.y),this.kernel=new Float32Array([0,1,2,2,3])}setTexelSize(e,n){this.uniforms.texelSize.value.set(e,n),this.uniforms.halfTexelSize.value.set(e,n).multiplyScalar(.5)}setResolution(e){this.uniforms.resolution.value.copy(e)}}exports.ConvolutionMaterial=i;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export declare class ConvolutionMaterial extends THREE.ShaderMaterial {
|
|
3
|
+
readonly kernel: Float32Array;
|
|
4
|
+
constructor(texelSize?: THREE.Vector2);
|
|
5
|
+
setTexelSize(x: number, y: number): void;
|
|
6
|
+
setResolution(resolution: THREE.Vector2): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { version } from '../helpers/constants.js';
|
|
3
|
+
|
|
4
|
+
class ConvolutionMaterial extends THREE.ShaderMaterial {
|
|
5
|
+
constructor(texelSize = new THREE.Vector2()) {
|
|
6
|
+
super({
|
|
7
|
+
uniforms: {
|
|
8
|
+
inputBuffer: new THREE.Uniform(null),
|
|
9
|
+
depthBuffer: new THREE.Uniform(null),
|
|
10
|
+
resolution: new THREE.Uniform(new THREE.Vector2()),
|
|
11
|
+
texelSize: new THREE.Uniform(new THREE.Vector2()),
|
|
12
|
+
halfTexelSize: new THREE.Uniform(new THREE.Vector2()),
|
|
13
|
+
kernel: new THREE.Uniform(0.0),
|
|
14
|
+
scale: new THREE.Uniform(1.0),
|
|
15
|
+
cameraNear: new THREE.Uniform(0.0),
|
|
16
|
+
cameraFar: new THREE.Uniform(1.0),
|
|
17
|
+
minDepthThreshold: new THREE.Uniform(0.0),
|
|
18
|
+
maxDepthThreshold: new THREE.Uniform(1.0),
|
|
19
|
+
depthScale: new THREE.Uniform(0.0),
|
|
20
|
+
depthToBlurRatioBias: new THREE.Uniform(0.25)
|
|
21
|
+
},
|
|
22
|
+
fragmentShader: `#include <common>
|
|
23
|
+
#include <dithering_pars_fragment>
|
|
24
|
+
uniform sampler2D inputBuffer;
|
|
25
|
+
uniform sampler2D depthBuffer;
|
|
26
|
+
uniform float cameraNear;
|
|
27
|
+
uniform float cameraFar;
|
|
28
|
+
uniform float minDepthThreshold;
|
|
29
|
+
uniform float maxDepthThreshold;
|
|
30
|
+
uniform float depthScale;
|
|
31
|
+
uniform float depthToBlurRatioBias;
|
|
32
|
+
varying vec2 vUv;
|
|
33
|
+
varying vec2 vUv0;
|
|
34
|
+
varying vec2 vUv1;
|
|
35
|
+
varying vec2 vUv2;
|
|
36
|
+
varying vec2 vUv3;
|
|
37
|
+
|
|
38
|
+
void main() {
|
|
39
|
+
float depthFactor = 0.0;
|
|
40
|
+
|
|
41
|
+
#ifdef USE_DEPTH
|
|
42
|
+
vec4 depth = texture2D(depthBuffer, vUv);
|
|
43
|
+
depthFactor = smoothstep(minDepthThreshold, maxDepthThreshold, 1.0-(depth.r * depth.a));
|
|
44
|
+
depthFactor *= depthScale;
|
|
45
|
+
depthFactor = max(0.0, min(1.0, depthFactor + 0.25));
|
|
46
|
+
#endif
|
|
47
|
+
|
|
48
|
+
vec4 sum = texture2D(inputBuffer, mix(vUv0, vUv, depthFactor));
|
|
49
|
+
sum += texture2D(inputBuffer, mix(vUv1, vUv, depthFactor));
|
|
50
|
+
sum += texture2D(inputBuffer, mix(vUv2, vUv, depthFactor));
|
|
51
|
+
sum += texture2D(inputBuffer, mix(vUv3, vUv, depthFactor));
|
|
52
|
+
gl_FragColor = sum * 0.25 ;
|
|
53
|
+
|
|
54
|
+
#include <dithering_fragment>
|
|
55
|
+
#include <tonemapping_fragment>
|
|
56
|
+
#include <${version >= 154 ? 'colorspace_fragment' : 'encodings_fragment'}>
|
|
57
|
+
}`,
|
|
58
|
+
vertexShader: `uniform vec2 texelSize;
|
|
59
|
+
uniform vec2 halfTexelSize;
|
|
60
|
+
uniform float kernel;
|
|
61
|
+
uniform float scale;
|
|
62
|
+
varying vec2 vUv;
|
|
63
|
+
varying vec2 vUv0;
|
|
64
|
+
varying vec2 vUv1;
|
|
65
|
+
varying vec2 vUv2;
|
|
66
|
+
varying vec2 vUv3;
|
|
67
|
+
|
|
68
|
+
void main() {
|
|
69
|
+
vec2 uv = position.xy * 0.5 + 0.5;
|
|
70
|
+
vUv = uv;
|
|
71
|
+
|
|
72
|
+
vec2 dUv = (texelSize * vec2(kernel) + halfTexelSize) * scale;
|
|
73
|
+
vUv0 = vec2(uv.x - dUv.x, uv.y + dUv.y);
|
|
74
|
+
vUv1 = vec2(uv.x + dUv.x, uv.y + dUv.y);
|
|
75
|
+
vUv2 = vec2(uv.x + dUv.x, uv.y - dUv.y);
|
|
76
|
+
vUv3 = vec2(uv.x - dUv.x, uv.y - dUv.y);
|
|
77
|
+
|
|
78
|
+
gl_Position = vec4(position.xy, 1.0, 1.0);
|
|
79
|
+
}`,
|
|
80
|
+
blending: THREE.NoBlending,
|
|
81
|
+
depthWrite: false,
|
|
82
|
+
depthTest: false
|
|
83
|
+
});
|
|
84
|
+
this.toneMapped = false;
|
|
85
|
+
this.setTexelSize(texelSize.x, texelSize.y);
|
|
86
|
+
this.kernel = new Float32Array([0.0, 1.0, 2.0, 2.0, 3.0]);
|
|
87
|
+
}
|
|
88
|
+
setTexelSize(x, y) {
|
|
89
|
+
this.uniforms.texelSize.value.set(x, y);
|
|
90
|
+
this.uniforms.halfTexelSize.value.set(x, y).multiplyScalar(0.5);
|
|
91
|
+
}
|
|
92
|
+
setResolution(resolution) {
|
|
93
|
+
this.uniforms.resolution.value.copy(resolution);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { ConvolutionMaterial };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../core/shaderMaterial.cjs.js");require("three");const r=e.shaderMaterial({},"void main() { }","void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); discard; }");exports.DiscardMaterial=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three");class t extends e.MeshStandardMaterial{constructor(e={}){super(e),this._tDepth={value:null},this._distortionMap={value:null},this._tDiffuse={value:null},this._tDiffuseBlur={value:null},this._textureMatrix={value:null},this._hasBlur={value:!1},this._mirror={value:0},this._mixBlur={value:0},this._blurStrength={value:.5},this._minDepthThreshold={value:.9},this._maxDepthThreshold={value:1},this._depthScale={value:0},this._depthToBlurRatioBias={value:.25},this._distortion={value:1},this._mixContrast={value:1},this.setValues(e)}onBeforeCompile(e){var t;null!=(t=e.defines)&&t.USE_UV||(e.defines.USE_UV=""),e.uniforms.hasBlur=this._hasBlur,e.uniforms.tDiffuse=this._tDiffuse,e.uniforms.tDepth=this._tDepth,e.uniforms.distortionMap=this._distortionMap,e.uniforms.tDiffuseBlur=this._tDiffuseBlur,e.uniforms.textureMatrix=this._textureMatrix,e.uniforms.mirror=this._mirror,e.uniforms.mixBlur=this._mixBlur,e.uniforms.mixStrength=this._blurStrength,e.uniforms.minDepthThreshold=this._minDepthThreshold,e.uniforms.maxDepthThreshold=this._maxDepthThreshold,e.uniforms.depthScale=this._depthScale,e.uniforms.depthToBlurRatioBias=this._depthToBlurRatioBias,e.uniforms.distortion=this._distortion,e.uniforms.mixContrast=this._mixContrast,e.vertexShader=`\n uniform mat4 textureMatrix;\n varying vec4 my_vUv;\n ${e.vertexShader}`,e.vertexShader=e.vertexShader.replace("#include <project_vertex>","#include <project_vertex>\n my_vUv = textureMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );"),e.fragmentShader=`\n uniform sampler2D tDiffuse;\n uniform sampler2D tDiffuseBlur;\n uniform sampler2D tDepth;\n uniform sampler2D distortionMap;\n uniform float distortion;\n uniform float cameraNear;\n\t\t\t uniform float cameraFar;\n uniform bool hasBlur;\n uniform float mixBlur;\n uniform float mirror;\n uniform float mixStrength;\n uniform float minDepthThreshold;\n uniform float maxDepthThreshold;\n uniform float mixContrast;\n uniform float depthScale;\n uniform float depthToBlurRatioBias;\n varying vec4 my_vUv;\n ${e.fragmentShader}`,e.fragmentShader=e.fragmentShader.replace("#include <emissivemap_fragment>","#include <emissivemap_fragment>\n\n float distortionFactor = 0.0;\n #ifdef USE_DISTORTION\n distortionFactor = texture2D(distortionMap, vUv).r * distortion;\n #endif\n\n vec4 new_vUv = my_vUv;\n new_vUv.x += distortionFactor;\n new_vUv.y += distortionFactor;\n\n vec4 base = texture2DProj(tDiffuse, new_vUv);\n vec4 blur = texture2DProj(tDiffuseBlur, new_vUv);\n\n vec4 merge = base;\n\n #ifdef USE_NORMALMAP\n vec2 normal_uv = vec2(0.0);\n vec4 normalColor = texture2D(normalMap, vUv * normalScale);\n vec3 my_normal = normalize( vec3( normalColor.r * 2.0 - 1.0, normalColor.b, normalColor.g * 2.0 - 1.0 ) );\n vec3 coord = new_vUv.xyz / new_vUv.w;\n normal_uv = coord.xy + coord.z * my_normal.xz * 0.05;\n vec4 base_normal = texture2D(tDiffuse, normal_uv);\n vec4 blur_normal = texture2D(tDiffuseBlur, normal_uv);\n merge = base_normal;\n blur = blur_normal;\n #endif\n\n float depthFactor = 0.0001;\n float blurFactor = 0.0;\n\n #ifdef USE_DEPTH\n vec4 depth = texture2DProj(tDepth, new_vUv);\n depthFactor = smoothstep(minDepthThreshold, maxDepthThreshold, 1.0-(depth.r * depth.a));\n depthFactor *= depthScale;\n depthFactor = max(0.0001, min(1.0, depthFactor));\n\n #ifdef USE_BLUR\n blur = blur * min(1.0, depthFactor + depthToBlurRatioBias);\n merge = merge * min(1.0, depthFactor + 0.5);\n #else\n merge = merge * depthFactor;\n #endif\n\n #endif\n\n float reflectorRoughnessFactor = roughness;\n #ifdef USE_ROUGHNESSMAP\n vec4 reflectorTexelRoughness = texture2D( roughnessMap, vUv );\n reflectorRoughnessFactor *= reflectorTexelRoughness.g;\n #endif\n\n #ifdef USE_BLUR\n blurFactor = min(1.0, mixBlur * reflectorRoughnessFactor);\n merge = mix(merge, blur, blurFactor);\n #endif\n\n vec4 newMerge = vec4(0.0, 0.0, 0.0, 1.0);\n newMerge.r = (merge.r - 0.5) * mixContrast + 0.5;\n newMerge.g = (merge.g - 0.5) * mixContrast + 0.5;\n newMerge.b = (merge.b - 0.5) * mixContrast + 0.5;\n\n diffuseColor.rgb = diffuseColor.rgb * ((1.0 - min(1.0, mirror)) + newMerge.rgb * mixStrength);\n ")}get tDiffuse(){return this._tDiffuse.value}set tDiffuse(e){this._tDiffuse.value=e}get tDepth(){return this._tDepth.value}set tDepth(e){this._tDepth.value=e}get distortionMap(){return this._distortionMap.value}set distortionMap(e){this._distortionMap.value=e}get tDiffuseBlur(){return this._tDiffuseBlur.value}set tDiffuseBlur(e){this._tDiffuseBlur.value=e}get textureMatrix(){return this._textureMatrix.value}set textureMatrix(e){this._textureMatrix.value=e}get hasBlur(){return this._hasBlur.value}set hasBlur(e){this._hasBlur.value=e}get mirror(){return this._mirror.value}set mirror(e){this._mirror.value=e}get mixBlur(){return this._mixBlur.value}set mixBlur(e){this._mixBlur.value=e}get mixStrength(){return this._blurStrength.value}set mixStrength(e){this._blurStrength.value=e}get minDepthThreshold(){return this._minDepthThreshold.value}set minDepthThreshold(e){this._minDepthThreshold.value=e}get maxDepthThreshold(){return this._maxDepthThreshold.value}set maxDepthThreshold(e){this._maxDepthThreshold.value=e}get depthScale(){return this._depthScale.value}set depthScale(e){this._depthScale.value=e}get depthToBlurRatioBias(){return this._depthToBlurRatioBias.value}set depthToBlurRatioBias(e){this._depthToBlurRatioBias.value=e}get distortion(){return this._distortion.value}set distortion(e){this._distortion.value=e}get mixContrast(){return this._mixContrast.value}set mixContrast(e){this._mixContrast.value=e}}exports.MeshReflectorMaterial=t;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Matrix4, MeshStandardMaterial, Texture } from 'three';
|
|
2
|
+
export declare class MeshReflectorMaterial extends MeshStandardMaterial {
|
|
3
|
+
private _tDepth;
|
|
4
|
+
private _distortionMap;
|
|
5
|
+
private _tDiffuse;
|
|
6
|
+
private _tDiffuseBlur;
|
|
7
|
+
private _textureMatrix;
|
|
8
|
+
private _hasBlur;
|
|
9
|
+
private _mirror;
|
|
10
|
+
private _mixBlur;
|
|
11
|
+
private _blurStrength;
|
|
12
|
+
private _minDepthThreshold;
|
|
13
|
+
private _maxDepthThreshold;
|
|
14
|
+
private _depthScale;
|
|
15
|
+
private _depthToBlurRatioBias;
|
|
16
|
+
private _distortion;
|
|
17
|
+
private _mixContrast;
|
|
18
|
+
constructor(parameters?: {});
|
|
19
|
+
onBeforeCompile(shader: any): void;
|
|
20
|
+
get tDiffuse(): Texture | null;
|
|
21
|
+
set tDiffuse(v: Texture | null);
|
|
22
|
+
get tDepth(): Texture | null;
|
|
23
|
+
set tDepth(v: Texture | null);
|
|
24
|
+
get distortionMap(): Texture | null;
|
|
25
|
+
set distortionMap(v: Texture | null);
|
|
26
|
+
get tDiffuseBlur(): Texture | null;
|
|
27
|
+
set tDiffuseBlur(v: Texture | null);
|
|
28
|
+
get textureMatrix(): Matrix4 | null;
|
|
29
|
+
set textureMatrix(v: Matrix4 | null);
|
|
30
|
+
get hasBlur(): boolean;
|
|
31
|
+
set hasBlur(v: boolean);
|
|
32
|
+
get mirror(): number;
|
|
33
|
+
set mirror(v: number);
|
|
34
|
+
get mixBlur(): number;
|
|
35
|
+
set mixBlur(v: number);
|
|
36
|
+
get mixStrength(): number;
|
|
37
|
+
set mixStrength(v: number);
|
|
38
|
+
get minDepthThreshold(): number;
|
|
39
|
+
set minDepthThreshold(v: number);
|
|
40
|
+
get maxDepthThreshold(): number;
|
|
41
|
+
set maxDepthThreshold(v: number);
|
|
42
|
+
get depthScale(): number;
|
|
43
|
+
set depthScale(v: number);
|
|
44
|
+
get depthToBlurRatioBias(): number;
|
|
45
|
+
set depthToBlurRatioBias(v: number);
|
|
46
|
+
get distortion(): number;
|
|
47
|
+
set distortion(v: number);
|
|
48
|
+
get mixContrast(): number;
|
|
49
|
+
set mixContrast(v: number);
|
|
50
|
+
}
|