@anov/3d-ability 0.0.142 → 0.0.144
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/business/Animation/motion/index.js +56 -35
- package/dist/business/Animation/motion/index.js.map +1 -1
- package/dist/business/Animation/type.js +2 -2
- package/dist/business/Area/Fence/FenceBase.js +187 -146
- package/dist/business/Area/Fence/FenceBase.js.map +1 -1
- package/dist/business/Area/Fence/fence_base_01.js +112 -120
- package/dist/business/Area/Fence/fence_base_01.js.map +1 -1
- package/dist/business/Area/Fence/fence_feeting_01.js +130 -218
- package/dist/business/Area/Fence/fence_feeting_01.js.map +1 -1
- package/dist/business/Area/Fence/fence_roll_01.js +130 -140
- package/dist/business/Area/Fence/fence_roll_01.js.map +1 -1
- package/dist/business/Area/FillArea/FillAreaBase.js +126 -87
- package/dist/business/Area/FillArea/FillAreaBase.js.map +1 -1
- package/dist/business/Area/FillArea/fillArea_face_01.js +98 -72
- package/dist/business/Area/FillArea/fillArea_face_01.js.map +1 -1
- package/dist/business/Area/FillArea/fillArea_line_01.js +94 -66
- package/dist/business/Area/FillArea/fillArea_line_01.js.map +1 -1
- package/dist/business/Area/index.js +483 -267
- package/dist/business/Area/index.js.map +1 -1
- package/dist/business/Area/tool.js +26 -14
- package/dist/business/Area/tool.js.map +1 -1
- package/dist/business/Base/ObjectLayer.js +46 -21
- package/dist/business/Base/ObjectLayer.js.map +1 -1
- package/dist/business/Batch/index.js +234 -189
- package/dist/business/Batch/index.js.map +1 -1
- package/dist/business/Box/index.js +81 -52
- package/dist/business/Box/index.js.map +1 -1
- package/dist/business/Cylinder/index.js +79 -51
- package/dist/business/Cylinder/index.js.map +1 -1
- package/dist/business/Flyline/bubble/CircleBubble.js +9 -1
- package/dist/business/Flyline/bubble/CircleBubble.js.map +1 -1
- package/dist/business/Flyline/bubble/index.js +21 -7
- package/dist/business/Flyline/bubble/index.js.map +1 -1
- package/dist/business/Flyline/index.js +162 -96
- package/dist/business/Flyline/index.js.map +1 -1
- package/dist/business/Flyline/line/ArcLine.js +291 -208
- package/dist/business/Flyline/line/ArcLine.js.map +1 -1
- package/dist/business/Flyline/line/index.js +22 -8
- package/dist/business/Flyline/line/index.js.map +1 -1
- package/dist/business/HeatMap/HeatMap.js +467 -380
- package/dist/business/HeatMap/HeatMap.js.map +1 -1
- package/dist/business/HeatMap/core.js +525 -405
- package/dist/business/HeatMap/core.js.map +1 -1
- package/dist/business/HeatMap/shader.js +3 -69
- package/dist/business/HeatMap/shader.js.map +1 -1
- package/dist/business/InfoPanel/index.js +242 -201
- package/dist/business/InfoPanel/index.js.map +1 -1
- package/dist/business/Line/index.js +88 -55
- package/dist/business/Line/index.js.map +1 -1
- package/dist/business/Mark/KeyframeAnimation.js +176 -145
- package/dist/business/Mark/KeyframeAnimation.js.map +1 -1
- package/dist/business/Mark/index.js +294 -196
- package/dist/business/Mark/index.js.map +1 -1
- package/dist/business/Mark/shader/tanhao.js +3 -36
- package/dist/business/Mark/shader/tanhao.js.map +1 -1
- package/dist/business/Mark/type.js +1 -1
- package/dist/business/MaterialSwitch/MaterialSwitchSystem.js +551 -377
- package/dist/business/MaterialSwitch/MaterialSwitchSystem.js.map +1 -1
- package/dist/business/MaterialSwitch/inject.js +58 -92
- package/dist/business/MaterialSwitch/inject.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/finalFade.js +2 -74
- package/dist/business/MaterialSwitch/shader/finalFade.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/ground.js +16 -95
- package/dist/business/MaterialSwitch/shader/ground.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/groundBase64.js +3 -9
- package/dist/business/MaterialSwitch/shader/groundBase64.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/realFade.js +9 -48
- package/dist/business/MaterialSwitch/shader/realFade.js.map +1 -1
- package/dist/business/Plane/index.js +78 -51
- package/dist/business/Plane/index.js.map +1 -1
- package/dist/business/Poi/index.js +336 -248
- package/dist/business/Poi/index.js.map +1 -1
- package/dist/business/Poi/link/Cylinder.js +89 -56
- package/dist/business/Poi/link/Cylinder.js.map +1 -1
- package/dist/business/Poi/link/Pyramid.js +165 -104
- package/dist/business/Poi/link/Pyramid.js.map +1 -1
- package/dist/business/Poi/link/index.d.ts +1 -1
- package/dist/business/Poi/link/index.js +114 -54
- package/dist/business/Poi/link/index.js.map +1 -1
- package/dist/business/Poi/panel/index.js +373 -315
- package/dist/business/Poi/panel/index.js.map +1 -1
- package/dist/business/Poi/panel/utils.js +10 -5
- package/dist/business/Poi/panel/utils.js.map +1 -1
- package/dist/business/Poi/particle/DoubleCircle.js +107 -71
- package/dist/business/Poi/particle/DoubleCircle.js.map +1 -1
- package/dist/business/Poi/particle/DynamicCircle.js +111 -75
- package/dist/business/Poi/particle/DynamicCircle.js.map +1 -1
- package/dist/business/Poi/particle/SingleCircle.js +98 -62
- package/dist/business/Poi/particle/SingleCircle.js.map +1 -1
- package/dist/business/Poi/particle/index.js +117 -49
- package/dist/business/Poi/particle/index.js.map +1 -1
- package/dist/business/Poi/shader/circle.js +3 -31
- package/dist/business/Poi/shader/circle.js.map +1 -1
- package/dist/business/Poi/shader/cylinder.js +3 -37
- package/dist/business/Poi/shader/cylinder.js.map +1 -1
- package/dist/business/Poi/shader/doubleCircle.js +3 -55
- package/dist/business/Poi/shader/doubleCircle.js.map +1 -1
- package/dist/business/Poi/shader/dynamicCircle.js +3 -67
- package/dist/business/Poi/shader/dynamicCircle.js.map +1 -1
- package/dist/business/Poi/title/Border.js +27 -7
- package/dist/business/Poi/title/Border.js.map +1 -1
- package/dist/business/Poi/title/Ellipse.js +27 -7
- package/dist/business/Poi/title/Ellipse.js.map +1 -1
- package/dist/business/Poi/title/index.js +292 -208
- package/dist/business/Poi/title/index.js.map +1 -1
- package/dist/business/Poi/tools.js +17 -18
- package/dist/business/Poi/tools.js.map +1 -1
- package/dist/business/Sphere/index.js +72 -47
- package/dist/business/Sphere/index.js.map +1 -1
- package/dist/business/Spline/index.js +245 -190
- package/dist/business/Spline/index.js.map +1 -1
- package/dist/business/SplitBuilding/index.js +536 -327
- package/dist/business/SplitBuilding/index.js.map +1 -1
- package/dist/business/SplitBuilding/type.js +2 -2
- package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js +275 -218
- package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js +177 -132
- package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js +1 -51
- package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js +1 -6
- package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js.map +1 -1
- package/dist/business/TrafficComponents/base.js +55 -32
- package/dist/business/TrafficComponents/base.js.map +1 -1
- package/dist/business/TrafficComponents/utils.js +24 -25
- package/dist/business/TrafficComponents/utils.js.map +1 -1
- package/dist/business/Utils/Curve.js +56 -40
- package/dist/business/Utils/Curve.js.map +1 -1
- package/dist/business/Utils/constant.js +1 -1
- package/dist/business/Utils/constant.js.map +1 -1
- package/dist/business/Utils/defineProps.js +14 -13
- package/dist/business/Utils/defineProps.js.map +1 -1
- package/dist/business/Utils/round-curve.js +153 -127
- package/dist/business/Utils/round-curve.js.map +1 -1
- package/dist/business/VideoPanel/index.js +319 -258
- package/dist/business/VideoPanel/index.js.map +1 -1
- package/dist/business/Water/index.js +108 -78
- package/dist/business/Water/index.js.map +1 -1
- package/dist/business/Water/types.js +1 -1
- package/dist/business/Water/types.js.map +1 -1
- package/dist/core/Camera/PerspectiveCamera/CameraExpand.js +449 -383
- package/dist/core/Camera/PerspectiveCamera/CameraExpand.js.map +1 -1
- package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js +142 -107
- package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js.map +1 -1
- package/dist/core/Controls/FirstViewControl/index.js +96 -84
- package/dist/core/Controls/FirstViewControl/index.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/action/input.js +98 -77
- package/dist/core/Controls/ThirdViewControl/action/input.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/config/constants.js +1 -1
- package/dist/core/Controls/ThirdViewControl/config/constants.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/index.js +28 -19
- package/dist/core/Controls/ThirdViewControl/index.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/animation.js +155 -126
- package/dist/core/Controls/ThirdViewControl/player/animation.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/camera.js +63 -47
- package/dist/core/Controls/ThirdViewControl/player/camera.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/control.js +49 -39
- package/dist/core/Controls/ThirdViewControl/player/control.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player.js +91 -66
- package/dist/core/Controls/ThirdViewControl/player.js.map +1 -1
- package/dist/core/Controls/base.js +30 -14
- package/dist/core/Controls/base.js.map +1 -1
- package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js +131 -92
- package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js.map +1 -1
- package/dist/core/Debug/PerformanceInfo/Performance.js +47 -22
- package/dist/core/Debug/PerformanceInfo/Performance.js.map +1 -1
- package/dist/core/Light/PointLight/PointLightExt.js +21 -4
- package/dist/core/Light/PointLight/PointLightExt.js.map +1 -1
- package/dist/core/Material/FinirMaterial/FinirMaterial.js +57 -37
- package/dist/core/Material/FinirMaterial/FinirMaterial.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js +153 -116
- package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/shader/fragment.js +1 -95
- package/dist/core/Material/PristineGridMaterial/shader/fragment.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/shader/vertex.js +1 -26
- package/dist/core/Material/PristineGridMaterial/shader/vertex.js.map +1 -1
- package/dist/core/Material/SurfaceMaterial/index.js +172 -76
- package/dist/core/Material/SurfaceMaterial/index.js.map +1 -1
- package/dist/core/Material/decorators.js +11 -6
- package/dist/core/Material/decorators.js.map +1 -1
- package/dist/core/PostEffects/addACESFilmicToneMappingPass.js +12 -16
- package/dist/core/PostEffects/addACESFilmicToneMappingPass.js.map +1 -1
- package/dist/core/PostEffects/addBrightnessContrastPass.js +13 -17
- package/dist/core/PostEffects/addBrightnessContrastPass.js.map +1 -1
- package/dist/core/PostEffects/bloomPass.js +10 -17
- package/dist/core/PostEffects/bloomPass.js.map +1 -1
- package/dist/core/PostEffects/bloomSelect.js +43 -60
- package/dist/core/PostEffects/bloomSelect.js.map +1 -1
- package/dist/core/PostEffects/colorifyPass.js +13 -17
- package/dist/core/PostEffects/colorifyPass.js.map +1 -1
- package/dist/core/PostEffects/index.js +22 -28
- package/dist/core/PostEffects/index.js.map +1 -1
- package/dist/core/PostEffects/outlinePass.js +50 -37
- package/dist/core/PostEffects/outlinePass.js.map +1 -1
- package/dist/core/PostEffects/postprocessing.js +12 -14
- package/dist/core/PostEffects/postprocessing.js.map +1 -1
- package/dist/core/PostEffects/saoPass.js +10 -15
- package/dist/core/PostEffects/saoPass.js.map +1 -1
- package/dist/core/PostEffects/shader/colorify.js +3 -22
- package/dist/core/PostEffects/shader/colorify.js.map +1 -1
- package/dist/core/PostEffects/shader/gammaCorrectionShader.js +3 -27
- package/dist/core/PostEffects/shader/gammaCorrectionShader.js.map +1 -1
- package/dist/core/PostEffects/shader/mapping.js +3 -66
- package/dist/core/PostEffects/shader/mapping.js.map +1 -1
- package/dist/core/PostEffects/shader/thermalMaging.js +3 -28
- package/dist/core/PostEffects/shader/thermalMaging.js.map +1 -1
- package/dist/core/SceneEffect/grow/grow.js +101 -85
- package/dist/core/SceneEffect/grow/grow.js.map +1 -1
- package/dist/core/SceneEffect/grow/style_down.js +77 -60
- package/dist/core/SceneEffect/grow/style_down.js.map +1 -1
- package/dist/core/SceneEffect/grow/style_up.js +81 -64
- package/dist/core/SceneEffect/grow/style_up.js.map +1 -1
- package/dist/core/SceneEffect/grow/type.js +2 -2
- package/dist/core/SceneEffect/grow/type.js.map +1 -1
- package/dist/core/WeatherSystem/DynamicWeatherSystem.js +76 -51
- package/dist/core/WeatherSystem/DynamicWeatherSystem.js.map +1 -1
- package/dist/core/WeatherSystem/hdr/index.js +105 -69
- package/dist/core/WeatherSystem/hdr/index.js.map +1 -1
- package/dist/core/WeatherSystem/index.js +124 -77
- package/dist/core/WeatherSystem/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/fog/index.js +80 -52
- package/dist/core/WeatherSystem/objects/fog/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/index.js +84 -72
- package/dist/core/WeatherSystem/objects/rain/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/lineRain.js +118 -88
- package/dist/core/WeatherSystem/objects/rain/lineRain.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/plane.js +146 -116
- package/dist/core/WeatherSystem/objects/rain/plane.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/point.js +148 -100
- package/dist/core/WeatherSystem/objects/rain/point.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/cloud.js +104 -71
- package/dist/core/WeatherSystem/objects/sky/cloud.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/index.js +84 -66
- package/dist/core/WeatherSystem/objects/sky/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/outline.js +45 -25
- package/dist/core/WeatherSystem/objects/sky/outline.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/cloud.js +3 -74
- package/dist/core/WeatherSystem/shaders/cloud.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/fog.js +3 -103
- package/dist/core/WeatherSystem/shaders/fog.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/rain.js +7 -206
- package/dist/core/WeatherSystem/shaders/rain.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/sky.js +3 -87
- package/dist/core/WeatherSystem/shaders/sky.js.map +1 -1
- package/dist/core/WeatherSystem/sky/index.js +135 -104
- package/dist/core/WeatherSystem/sky/index.js.map +1 -1
- package/dist/core/WeatherSystem/utils/constant.js +38 -44
- package/dist/core/WeatherSystem/utils/constant.js.map +1 -1
- package/dist/core/WeatherSystem/utils/math.js +25 -18
- package/dist/core/WeatherSystem/utils/math.js.map +1 -1
- package/dist/core/WeatherSystem/utils/type.js +1 -1
- package/dist/core/WeatherSystem/utils/type.js.map +1 -1
- package/dist/core/WeatherSystem/weather/index.js +141 -96
- package/dist/core/WeatherSystem/weather/index.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["use","BlendFunction","DepthDownsamplingPass","EdgeDetectionMode","EffectComposer","EffectPass","NormalPass","PredicationMode","RenderPass","SMAAEffect","SMAAPreset","SSAOEffect","TextureEffect","useComposerFrame","initPostEffectsV2","scene","renderer","camera","composer","addPass","normalPass","depthDownsamplingPass","normalBuffer","texture","resolutionScale","normalDepthBuffer","smaaEffect","preset","MEDIUM","edgeDetectionMode","COLOR","predicationMode","DEPTH","edgeDetectionMaterial","setEdgeDetectionThreshold","ssaoEffect","blendFunction","MULTIPLY","distanceScaling","depthAwareUpsampling","samples","rings","distanceThreshold","distanceFalloff","rangeThreshold","rangeFalloff","luminanceInfluence","minRadiusScale","radius","intensity","bias","fade","color","textureEffect","SKIP","effectPass","render"],"sources":["../../../src/core/PostEffects/postprocessing.ts"],"sourcesContent":["import { type Camera, type Scene, type WebGLRenderer, use } from '@anov/3d-core'\nimport { BlendFunction, DepthDownsamplingPass, EdgeDetectionMode, EffectComposer, EffectPass, NormalPass, PredicationMode, RenderPass, SMAAEffect, SMAAPreset, SSAOEffect, TextureEffect } from 'postprocessing'\n\nconst { useComposerFrame } = use\n\nexport const initPostEffectsV2 = (\n scene: Scene,\n renderer: WebGLRenderer,\n camera: Camera,\n) => {\n const composer = new EffectComposer(renderer)\n composer.addPass(new RenderPass(scene, camera))\n\n const normalPass = new NormalPass(scene, camera)\n const depthDownsamplingPass = new DepthDownsamplingPass({\n normalBuffer: normalPass.texture,\n resolutionScale: 0.5,\n })\n\n const normalDepthBuffer = depthDownsamplingPass.texture\n\n const smaaEffect = new SMAAEffect({\n preset: SMAAPreset.MEDIUM,\n edgeDetectionMode: EdgeDetectionMode.COLOR,\n predicationMode: PredicationMode.DEPTH,\n })\n\n smaaEffect.edgeDetectionMaterial.setEdgeDetectionThreshold(0.01)\n\n const ssaoEffect = new SSAOEffect(camera, normalPass.texture, {\n blendFunction: BlendFunction.MULTIPLY,\n distanceScaling: true,\n depthAwareUpsampling: true,\n normalDepthBuffer,\n samples: 9,\n rings: 7,\n distanceThreshold: 0.02, // Render up to a distance of ~20 world units\n distanceFalloff: 0.0025, // with an additional ~2.5 units of falloff.\n rangeThreshold: 0.0003, // Occlusion proximity of ~0.3 world units\n rangeFalloff: 0.0001, // with ~0.1 units of falloff.\n luminanceInfluence: 0.7,\n minRadiusScale: 0.33,\n radius: 0.1,\n intensity: 1.33,\n bias: 0.025,\n fade: 0.01,\n color: null,\n resolutionScale: 0.5,\n })\n\n const textureEffect = new TextureEffect({\n blendFunction: BlendFunction.SKIP,\n texture: depthDownsamplingPass.texture,\n })\n\n const effectPass = new EffectPass(camera, smaaEffect, ssaoEffect, textureEffect)\n\n composer.addPass(normalPass)\n composer.addPass(depthDownsamplingPass)\n composer.addPass(effectPass)\n\n useComposerFrame(() => {\n composer.render()\n })\n}"],"mappings":"AAAA,SAAsDA,GAAG,QAAQ,eAAe;AAChF,SAASC,aAAa,EAAEC,qBAAqB,EAAEC,iBAAiB,EAAEC,cAAc,EAAEC,UAAU,EAAEC,UAAU,EAAEC,eAAe,EAAEC,UAAU,EAAEC,UAAU,EAAEC,UAAU,EAAEC,UAAU,EAAEC,aAAa,QAAQ,gBAAgB;AAEhN,
|
|
1
|
+
{"version":3,"names":["use","BlendFunction","DepthDownsamplingPass","EdgeDetectionMode","EffectComposer","EffectPass","NormalPass","PredicationMode","RenderPass","SMAAEffect","SMAAPreset","SSAOEffect","TextureEffect","useComposerFrame","initPostEffectsV2","scene","renderer","camera","composer","addPass","normalPass","depthDownsamplingPass","normalBuffer","texture","resolutionScale","normalDepthBuffer","smaaEffect","preset","MEDIUM","edgeDetectionMode","COLOR","predicationMode","DEPTH","edgeDetectionMaterial","setEdgeDetectionThreshold","ssaoEffect","blendFunction","MULTIPLY","distanceScaling","depthAwareUpsampling","samples","rings","distanceThreshold","distanceFalloff","rangeThreshold","rangeFalloff","luminanceInfluence","minRadiusScale","radius","intensity","bias","fade","color","textureEffect","SKIP","effectPass","render"],"sources":["../../../src/core/PostEffects/postprocessing.ts"],"sourcesContent":["import { type Camera, type Scene, type WebGLRenderer, use } from '@anov/3d-core'\nimport { BlendFunction, DepthDownsamplingPass, EdgeDetectionMode, EffectComposer, EffectPass, NormalPass, PredicationMode, RenderPass, SMAAEffect, SMAAPreset, SSAOEffect, TextureEffect } from 'postprocessing'\n\nconst { useComposerFrame } = use\n\nexport const initPostEffectsV2 = (\n scene: Scene,\n renderer: WebGLRenderer,\n camera: Camera,\n) => {\n const composer = new EffectComposer(renderer)\n composer.addPass(new RenderPass(scene, camera))\n\n const normalPass = new NormalPass(scene, camera)\n const depthDownsamplingPass = new DepthDownsamplingPass({\n normalBuffer: normalPass.texture,\n resolutionScale: 0.5,\n })\n\n const normalDepthBuffer = depthDownsamplingPass.texture\n\n const smaaEffect = new SMAAEffect({\n preset: SMAAPreset.MEDIUM,\n edgeDetectionMode: EdgeDetectionMode.COLOR,\n predicationMode: PredicationMode.DEPTH,\n })\n\n smaaEffect.edgeDetectionMaterial.setEdgeDetectionThreshold(0.01)\n\n const ssaoEffect = new SSAOEffect(camera, normalPass.texture, {\n blendFunction: BlendFunction.MULTIPLY,\n distanceScaling: true,\n depthAwareUpsampling: true,\n normalDepthBuffer,\n samples: 9,\n rings: 7,\n distanceThreshold: 0.02, // Render up to a distance of ~20 world units\n distanceFalloff: 0.0025, // with an additional ~2.5 units of falloff.\n rangeThreshold: 0.0003, // Occlusion proximity of ~0.3 world units\n rangeFalloff: 0.0001, // with ~0.1 units of falloff.\n luminanceInfluence: 0.7,\n minRadiusScale: 0.33,\n radius: 0.1,\n intensity: 1.33,\n bias: 0.025,\n fade: 0.01,\n color: null,\n resolutionScale: 0.5,\n })\n\n const textureEffect = new TextureEffect({\n blendFunction: BlendFunction.SKIP,\n texture: depthDownsamplingPass.texture,\n })\n\n const effectPass = new EffectPass(camera, smaaEffect, ssaoEffect, textureEffect)\n\n composer.addPass(normalPass)\n composer.addPass(depthDownsamplingPass)\n composer.addPass(effectPass)\n\n useComposerFrame(() => {\n composer.render()\n })\n}"],"mappings":"AAAA,SAAsDA,GAAG,QAAQ,eAAe;AAChF,SAASC,aAAa,EAAEC,qBAAqB,EAAEC,iBAAiB,EAAEC,cAAc,EAAEC,UAAU,EAAEC,UAAU,EAAEC,eAAe,EAAEC,UAAU,EAAEC,UAAU,EAAEC,UAAU,EAAEC,UAAU,EAAEC,aAAa,QAAQ,gBAAgB;AAEhN,IAAQC,gBAAgB,GAAKb,GAAG,CAAxBa,gBAAgB;AAExB,OAAO,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAC5BC,KAAY,EACZC,QAAuB,EACvBC,MAAc,EACX;EACH,IAAMC,QAAQ,GAAG,IAAId,cAAc,CAACY,QAAQ,CAAC;EAC7CE,QAAQ,CAACC,OAAO,CAAC,IAAIX,UAAU,CAACO,KAAK,EAAEE,MAAM,CAAC,CAAC;EAE/C,IAAMG,UAAU,GAAG,IAAId,UAAU,CAACS,KAAK,EAAEE,MAAM,CAAC;EAChD,IAAMI,qBAAqB,GAAG,IAAInB,qBAAqB,CAAC;IACtDoB,YAAY,EAAEF,UAAU,CAACG,OAAO;IAChCC,eAAe,EAAE;EACnB,CAAC,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AAqB,CAAC;EACvCH,QAAQ,CAACC,OAAO,CAACoC,UAAU,CAAC;EAE5B1C,gBAAgB,CAAC,YAAM;IACrBK,QAAQ,CAACsC,MAAM,CAAC,CAAC;EACnB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
import { OutputPass, lib, use, utils } from '@anov/3d-core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} = utils;
|
|
5
|
-
const {
|
|
6
|
-
SAOPass
|
|
7
|
-
} = lib;
|
|
2
|
+
var storeManagement = utils.storeManagement;
|
|
3
|
+
var SAOPass = lib.SAOPass;
|
|
8
4
|
|
|
9
5
|
/**
|
|
10
6
|
* add ssao 环境光遮蔽
|
|
11
7
|
* @returns
|
|
12
8
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
scene,
|
|
16
|
-
camera
|
|
17
|
-
|
|
18
|
-
const composer = storeManagement.get('composer');
|
|
9
|
+
var addSAOPass = function addSAOPass() {
|
|
10
|
+
var _use$useScene = use.useScene(),
|
|
11
|
+
scene = _use$useScene.scene,
|
|
12
|
+
camera = _use$useScene.camera;
|
|
13
|
+
var composer = storeManagement.get('composer');
|
|
19
14
|
if (!scene || !camera) throw new Error('scene or camera is not defined,');
|
|
20
15
|
if (!composer) throw new Error('composer is not defined, please initPostEffects first');
|
|
21
|
-
|
|
16
|
+
var saoPass = new SAOPass(scene, camera);
|
|
22
17
|
composer.addPass(saoPass);
|
|
23
|
-
|
|
18
|
+
var outputPass = new OutputPass();
|
|
24
19
|
composer.addPass(outputPass);
|
|
25
|
-
return ()
|
|
20
|
+
return function () {
|
|
26
21
|
composer.removePass(saoPass);
|
|
27
22
|
composer.removePass(outputPass);
|
|
28
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["OutputPass","lib","use","utils","storeManagement","SAOPass","addSAOPass","
|
|
1
|
+
{"version":3,"names":["OutputPass","lib","use","utils","storeManagement","SAOPass","addSAOPass","_use$useScene","useScene","scene","camera","composer","get","Error","saoPass","addPass","outputPass","removePass"],"sources":["../../../src/core/PostEffects/saoPass.ts"],"sourcesContent":["import { OutputPass, lib, use, utils } from '@anov/3d-core'\n\nconst { storeManagement } = utils\nconst { SAOPass } = lib\n\n/**\n * add ssao 环境光遮蔽\n * @returns\n */\nconst addSAOPass = () => {\n const { scene, camera } = use.useScene()\n const composer = storeManagement.get('composer') as lib.EffectComposer | undefined\n\n if (!scene || !camera)\n throw new Error('scene or camera is not defined,')\n\n if (!composer)\n throw new Error('composer is not defined, please initPostEffects first')\n\n const saoPass = new SAOPass(scene, camera)\n composer.addPass(saoPass)\n\n const outputPass = new OutputPass()\n composer.addPass(outputPass)\n\n return () => {\n composer.removePass(saoPass)\n composer.removePass(outputPass)\n }\n}\n\nexport default addSAOPass\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,GAAG,EAAEC,GAAG,EAAEC,KAAK,QAAQ,eAAe;AAE3D,IAAQC,eAAe,GAAKD,KAAK,CAAzBC,eAAe;AACvB,IAAQC,OAAO,GAAKJ,GAAG,CAAfI,OAAO;;AAEf;AACA;AACA;AACA;AACA,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAA,EAAS;EACvB,IAAAC,aAAA,GAA0BL,GAAG,CAACM,QAAQ,CAAC,CAAC;IAAhCC,KAAK,GAAAF,aAAA,CAALE,KAAK;IAAEC,MAAM,GAAAH,aAAA,CAANG,MAAM;EACrB,IAAMC,QAAQ,GAAGP,eAAe,CAACQ,GAAG,CAAC,UAAU,CAAmC;EAElF,IAAI,CAACH,KAAK,IAAI,CAACC,MAAM,EACnB,MAAM,IAAIG,KAAK,CAAC,iCAAiC,CAAC;EAEpD,IAAI,CAACF,QAAQ,EACX,MAAM,IAAIE,KAAK,CAAC,uDAAuD,CAAC;EAE1E,IAAMC,OAAO,GAAG,IAAIT,OAAO,CAACI,KAAK,EAAEC,MAAM,CAAC;EAC1CC,QAAQ,CAACI,OAAO,CAACD,OAAO,CAAC;EAEzB,IAAME,UAAU,GAAG,IAAIhB,UAAU,CAAC,CAAC;EACnCW,QAAQ,CAACI,OAAO,CAACC,UAAU,CAAC;EAE5B,OAAO,YAAM;IACXL,QAAQ,CAACM,UAAU,CAACH,OAAO,CAAC;IAC5BH,QAAQ,CAACM,UAAU,CAACD,UAAU,CAAC;EACjC,CAAC;AACH,CAAC;AAED,eAAeV,UAAU"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-tabs */
|
|
2
2
|
import { Color } from '@anov/3d-core';
|
|
3
|
-
|
|
3
|
+
var ColorifyShader = {
|
|
4
4
|
uniforms: {
|
|
5
5
|
tDiffuse: {
|
|
6
6
|
value: null
|
|
@@ -12,27 +12,8 @@ const ColorifyShader = {
|
|
|
12
12
|
value: 1.0
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
|
-
vertexShader: /* glsl
|
|
16
|
-
|
|
17
|
-
void main() {
|
|
18
|
-
vUv = uv;
|
|
19
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
20
|
-
}`,
|
|
21
|
-
fragmentShader: /* glsl */`
|
|
22
|
-
uniform vec3 color;
|
|
23
|
-
uniform sampler2D tDiffuse;
|
|
24
|
-
uniform float alpha;
|
|
25
|
-
|
|
26
|
-
varying vec2 vUv;
|
|
27
|
-
|
|
28
|
-
void main() {
|
|
29
|
-
vec4 texel = texture2D( tDiffuse, vUv );
|
|
30
|
-
vec3 luma = vec3( 0.299, 0.587, 0.114 );
|
|
31
|
-
float v = dot( texel.xyz, luma );
|
|
32
|
-
gl_FragColor = vec4( v * color, texel.w );
|
|
33
|
-
gl_FragColor = mix( texel, gl_FragColor, alpha );
|
|
34
|
-
|
|
35
|
-
}`
|
|
15
|
+
vertexShader: /* glsl */"\n\t varying vec2 vUv;\n\t\tvoid main() {\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t}",
|
|
16
|
+
fragmentShader: /* glsl */"\n\t\tuniform vec3 color;\n\t\tuniform sampler2D tDiffuse;\n uniform float alpha;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tvec3 luma = vec3( 0.299, 0.587, 0.114 );\n\t\t\tfloat v = dot( texel.xyz, luma );\n\t\t\tgl_FragColor = vec4( v * color, texel.w );\n gl_FragColor = mix( texel, gl_FragColor, alpha );\n\n\t\t}"
|
|
36
17
|
};
|
|
37
18
|
export default ColorifyShader;
|
|
38
19
|
//# sourceMappingURL=colorify.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Color","ColorifyShader","uniforms","tDiffuse","value","color","alpha","vertexShader","fragmentShader"],"sources":["../../../../src/core/PostEffects/shader/colorify.ts"],"sourcesContent":["/* eslint-disable no-tabs */\nimport { Color } from '@anov/3d-core'\n\nconst ColorifyShader = {\n uniforms: {\n tDiffuse: { value: null },\n color: { value: new Color(0xFFFFFF) },\n alpha: { value: 1.0 },\n\n },\n\n vertexShader: /* glsl */`\n\t varying vec2 vUv;\n\t\tvoid main() {\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t}`,\n\n fragmentShader: /* glsl */`\n\t\tuniform vec3 color;\n\t\tuniform sampler2D tDiffuse;\n uniform float alpha;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tvec3 luma = vec3( 0.299, 0.587, 0.114 );\n\t\t\tfloat v = dot( texel.xyz, luma );\n\t\t\tgl_FragColor = vec4( v * color, texel.w );\n gl_FragColor = mix( texel, gl_FragColor, alpha );\n\n\t\t}`,\n}\n\nexport default ColorifyShader"],"mappings":"AAAA;AACA,SAASA,KAAK,QAAQ,eAAe;AAErC,
|
|
1
|
+
{"version":3,"names":["Color","ColorifyShader","uniforms","tDiffuse","value","color","alpha","vertexShader","fragmentShader"],"sources":["../../../../src/core/PostEffects/shader/colorify.ts"],"sourcesContent":["/* eslint-disable no-tabs */\nimport { Color } from '@anov/3d-core'\n\nconst ColorifyShader = {\n uniforms: {\n tDiffuse: { value: null },\n color: { value: new Color(0xFFFFFF) },\n alpha: { value: 1.0 },\n\n },\n\n vertexShader: /* glsl */`\n\t varying vec2 vUv;\n\t\tvoid main() {\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t}`,\n\n fragmentShader: /* glsl */`\n\t\tuniform vec3 color;\n\t\tuniform sampler2D tDiffuse;\n uniform float alpha;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tvec3 luma = vec3( 0.299, 0.587, 0.114 );\n\t\t\tfloat v = dot( texel.xyz, luma );\n\t\t\tgl_FragColor = vec4( v * color, texel.w );\n gl_FragColor = mix( texel, gl_FragColor, alpha );\n\n\t\t}`,\n}\n\nexport default ColorifyShader"],"mappings":"AAAA;AACA,SAASA,KAAK,QAAQ,eAAe;AAErC,IAAMC,cAAc,GAAG;EACrBC,QAAQ,EAAE;IACRC,QAAQ,EAAE;MAAEC,KAAK,EAAE;IAAK,CAAC;IACzBC,KAAK,EAAE;MAAED,KAAK,EAAE,IAAIJ,KAAK,CAAC,QAAQ;IAAE,CAAC;IACrCM,KAAK,EAAE;MAAEF,KAAK,EAAE;IAAI;EAEtB,CAAC;EAEDG,YAAY,EAAE,iKAKZ;EAEFC,cAAc,EAAE;AAelB,CAAC;AAED,eAAeP,cAAc"}
|
|
@@ -4,39 +4,15 @@
|
|
|
4
4
|
* http://en.wikipedia.org/wiki/gamma_correction
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
var GammaCorrectionShader = {
|
|
8
8
|
name: 'GammaCorrectionShader',
|
|
9
9
|
uniforms: {
|
|
10
10
|
tDiffuse: {
|
|
11
11
|
value: null
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
vertexShader: /* glsl
|
|
15
|
-
|
|
16
|
-
varying vec2 vUv;
|
|
17
|
-
|
|
18
|
-
void main() {
|
|
19
|
-
|
|
20
|
-
vUv = uv;
|
|
21
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
22
|
-
|
|
23
|
-
}`,
|
|
24
|
-
fragmentShader: /* glsl */`
|
|
25
|
-
|
|
26
|
-
uniform sampler2D tDiffuse;
|
|
27
|
-
|
|
28
|
-
varying vec2 vUv;
|
|
29
|
-
|
|
30
|
-
vec4 sRGBTransferOETF1( in vec4 value ) {
|
|
31
|
-
return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.03 - vec3( 0.03 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
|
|
32
|
-
}
|
|
33
|
-
void main() {
|
|
34
|
-
|
|
35
|
-
vec4 tex = texture2D( tDiffuse, vUv );
|
|
36
|
-
|
|
37
|
-
gl_FragColor = sRGBTransferOETF1( tex );
|
|
38
|
-
|
|
39
|
-
}`
|
|
14
|
+
vertexShader: /* glsl */"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",
|
|
15
|
+
fragmentShader: /* glsl */"\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n vec4 sRGBTransferOETF1( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.03 - vec3( 0.03 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n }\n\t\tvoid main() {\n\n\t\t\tvec4 tex = texture2D( tDiffuse, vUv );\n\n\t\t\tgl_FragColor = sRGBTransferOETF1( tex );\n\n\t\t}"
|
|
40
16
|
};
|
|
41
17
|
export default GammaCorrectionShader;
|
|
42
18
|
//# sourceMappingURL=gammaCorrectionShader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GammaCorrectionShader","name","uniforms","tDiffuse","value","vertexShader","fragmentShader"],"sources":["../../../../src/core/PostEffects/shader/gammaCorrectionShader.ts"],"sourcesContent":["/* eslint-disable no-tabs */\n/**\n * Gamma Correction Shader\n * http://en.wikipedia.org/wiki/gamma_correction\n */\n\nconst GammaCorrectionShader = {\n\n name: 'GammaCorrectionShader',\n\n uniforms: {\n\n tDiffuse: { value: null },\n\n },\n\n vertexShader: /* glsl */`\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}`,\n\n fragmentShader: /* glsl */`\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n vec4 sRGBTransferOETF1( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.03 - vec3( 0.03 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n }\n\t\tvoid main() {\n\n\t\t\tvec4 tex = texture2D( tDiffuse, vUv );\n\n\t\t\tgl_FragColor = sRGBTransferOETF1( tex );\n\n\t\t}`,\n\n}\n\nexport default GammaCorrectionShader\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA,
|
|
1
|
+
{"version":3,"names":["GammaCorrectionShader","name","uniforms","tDiffuse","value","vertexShader","fragmentShader"],"sources":["../../../../src/core/PostEffects/shader/gammaCorrectionShader.ts"],"sourcesContent":["/* eslint-disable no-tabs */\n/**\n * Gamma Correction Shader\n * http://en.wikipedia.org/wiki/gamma_correction\n */\n\nconst GammaCorrectionShader = {\n\n name: 'GammaCorrectionShader',\n\n uniforms: {\n\n tDiffuse: { value: null },\n\n },\n\n vertexShader: /* glsl */`\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}`,\n\n fragmentShader: /* glsl */`\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n vec4 sRGBTransferOETF1( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.03 - vec3( 0.03 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n }\n\t\tvoid main() {\n\n\t\t\tvec4 tex = texture2D( tDiffuse, vUv );\n\n\t\t\tgl_FragColor = sRGBTransferOETF1( tex );\n\n\t\t}`,\n\n}\n\nexport default GammaCorrectionShader\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA,IAAMA,qBAAqB,GAAG;EAE5BC,IAAI,EAAE,uBAAuB;EAE7BC,QAAQ,EAAE;IAERC,QAAQ,EAAE;MAAEC,KAAK,EAAE;IAAK;EAE1B,CAAC;EAEDC,YAAY,EAAE,uKASZ;EAEFC,cAAc,EAAE;AAiBlB,CAAC;AAED,eAAeN,qBAAqB"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/* eslint-disable no-tabs */
|
|
8
|
-
|
|
8
|
+
var ACESFilmicToneMappingShader = {
|
|
9
9
|
name: 'ACESFilmicToneMappingShader',
|
|
10
10
|
uniforms: {
|
|
11
11
|
tDiffuse: {
|
|
@@ -15,71 +15,8 @@ const ACESFilmicToneMappingShader = {
|
|
|
15
15
|
value: 1.0
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
-
vertexShader: /* glsl
|
|
19
|
-
|
|
20
|
-
varying vec2 vUv;
|
|
21
|
-
|
|
22
|
-
void main() {
|
|
23
|
-
|
|
24
|
-
vUv = uv;
|
|
25
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
26
|
-
|
|
27
|
-
}`,
|
|
28
|
-
fragmentShader: /* glsl */`
|
|
29
|
-
|
|
30
|
-
#define saturate(a) clamp( a, 0.0, 1.0 )
|
|
31
|
-
|
|
32
|
-
uniform sampler2D tDiffuse;
|
|
33
|
-
|
|
34
|
-
uniform float exposure;
|
|
35
|
-
|
|
36
|
-
varying vec2 vUv;
|
|
37
|
-
|
|
38
|
-
// vec3 RRTAndODTFit( vec3 v ) {
|
|
39
|
-
|
|
40
|
-
// vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
|
|
41
|
-
// vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
|
|
42
|
-
// return a / b;
|
|
43
|
-
|
|
44
|
-
// }
|
|
45
|
-
|
|
46
|
-
// vec3 ACESFilmicToneMapping( vec3 color ) {
|
|
47
|
-
|
|
48
|
-
// // sRGB => XYZ => D65_2_D60 => AP1 => RRT_SAT
|
|
49
|
-
// const mat3 ACESInputMat = mat3(
|
|
50
|
-
// vec3( 0.59719, 0.07600, 0.02840 ), // transposed from source
|
|
51
|
-
// vec3( 0.35458, 0.90834, 0.13383 ),
|
|
52
|
-
// vec3( 0.04823, 0.01566, 0.83777 )
|
|
53
|
-
// );
|
|
54
|
-
|
|
55
|
-
// // ODT_SAT => XYZ => D60_2_D65 => sRGB
|
|
56
|
-
// const mat3 ACESOutputMat = mat3(
|
|
57
|
-
// vec3( 1.60475, -0.10208, -0.00327 ), // transposed from source
|
|
58
|
-
// vec3( -0.53108, 1.10813, -0.07276 ),
|
|
59
|
-
// vec3( -0.07367, -0.00605, 1.07602 )
|
|
60
|
-
// );
|
|
61
|
-
|
|
62
|
-
// color = ACESInputMat * color;
|
|
63
|
-
|
|
64
|
-
// // Apply RRT and ODT
|
|
65
|
-
// color = RRTAndODTFit( color );
|
|
66
|
-
|
|
67
|
-
// color = ACESOutputMat * color;
|
|
68
|
-
|
|
69
|
-
// // Clamp to [0, 1]
|
|
70
|
-
// return saturate( color );
|
|
71
|
-
|
|
72
|
-
// }
|
|
73
|
-
|
|
74
|
-
void main() {
|
|
75
|
-
|
|
76
|
-
vec4 tex = texture2D( tDiffuse, vUv );
|
|
77
|
-
|
|
78
|
-
tex.rgb *= exposure / 0.6; // pre-exposed, outside of the tone mapping function
|
|
79
|
-
|
|
80
|
-
gl_FragColor = vec4( ACESFilmicToneMapping( tex.rgb ), tex.a );
|
|
81
|
-
|
|
82
|
-
}`
|
|
18
|
+
vertexShader: /* glsl */"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",
|
|
19
|
+
fragmentShader: /* glsl */"\n\n\t\t#define saturate(a) clamp( a, 0.0, 1.0 )\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tuniform float exposure;\n\n\t\tvarying vec2 vUv;\n\n\t\t// vec3 RRTAndODTFit( vec3 v ) {\n\n\t\t// \tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\t\t// \tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\t\t// \treturn a / b;\n\n\t\t// }\n\n\t\t// vec3 ACESFilmicToneMapping( vec3 color ) {\n\n\t\t// // sRGB => XYZ => D65_2_D60 => AP1 => RRT_SAT\n\t\t// \tconst mat3 ACESInputMat = mat3(\n\t\t// \t\tvec3( 0.59719, 0.07600, 0.02840 ), // transposed from source\n\t\t// \t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\t// \t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t\t// \t);\n\n\t\t// // ODT_SAT => XYZ => D60_2_D65 => sRGB\n\t\t// \tconst mat3 ACESOutputMat = mat3(\n\t\t// \t\tvec3( 1.60475, -0.10208, -0.00327 ), // transposed from source\n\t\t// \t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\t// \t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t\t// \t);\n\n\t\t// \tcolor = ACESInputMat * color;\n\n\t\t// // Apply RRT and ODT\n\t\t// \tcolor = RRTAndODTFit( color );\n\n\t\t// \tcolor = ACESOutputMat * color;\n\n\t\t// // Clamp to [0, 1]\n\t\t// \treturn saturate( color );\n\n\t\t// }\n\n\t\tvoid main() {\n\n\t\t\tvec4 tex = texture2D( tDiffuse, vUv );\n\n\t\t\ttex.rgb *= exposure / 0.6; // pre-exposed, outside of the tone mapping function\n\n\t\t\tgl_FragColor = vec4( ACESFilmicToneMapping( tex.rgb ), tex.a );\n\n\t\t}"
|
|
83
20
|
};
|
|
84
21
|
export default ACESFilmicToneMappingShader;
|
|
85
22
|
//# sourceMappingURL=mapping.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ACESFilmicToneMappingShader","name","uniforms","tDiffuse","value","exposure","vertexShader","fragmentShader"],"sources":["../../../../src/core/PostEffects/shader/mapping.ts"],"sourcesContent":["/**\n *\n * ACES Filmic Tone Mapping Shader by Stephen Hill\n * source: https://github.com/mrdoob/three.js/blob/3bffaf229d9646a61b9c7087d255c2360d1d2856/examples/jsm/shaders/ACESFilmicToneMappingShader.js\n */\n\n/* eslint-disable no-tabs */\nconst ACESFilmicToneMappingShader = {\n\n name: 'ACESFilmicToneMappingShader',\n\n uniforms: {\n\n tDiffuse: { value: null },\n exposure: { value: 1.0 },\n\n },\n\n vertexShader: /* glsl */`\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}`,\n\n fragmentShader: /* glsl */`\n\n\t\t#define saturate(a) clamp( a, 0.0, 1.0 )\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tuniform float exposure;\n\n\t\tvarying vec2 vUv;\n\n\t\t// vec3 RRTAndODTFit( vec3 v ) {\n\n\t\t// \tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\t\t// \tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\t\t// \treturn a / b;\n\n\t\t// }\n\n\t\t// vec3 ACESFilmicToneMapping( vec3 color ) {\n\n\t\t// // sRGB => XYZ => D65_2_D60 => AP1 => RRT_SAT\n\t\t// \tconst mat3 ACESInputMat = mat3(\n\t\t// \t\tvec3( 0.59719, 0.07600, 0.02840 ), // transposed from source\n\t\t// \t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\t// \t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t\t// \t);\n\n\t\t// // ODT_SAT => XYZ => D60_2_D65 => sRGB\n\t\t// \tconst mat3 ACESOutputMat = mat3(\n\t\t// \t\tvec3( 1.60475, -0.10208, -0.00327 ), // transposed from source\n\t\t// \t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\t// \t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t\t// \t);\n\n\t\t// \tcolor = ACESInputMat * color;\n\n\t\t// // Apply RRT and ODT\n\t\t// \tcolor = RRTAndODTFit( color );\n\n\t\t// \tcolor = ACESOutputMat * color;\n\n\t\t// // Clamp to [0, 1]\n\t\t// \treturn saturate( color );\n\n\t\t// }\n\n\t\tvoid main() {\n\n\t\t\tvec4 tex = texture2D( tDiffuse, vUv );\n\n\t\t\ttex.rgb *= exposure / 0.6; // pre-exposed, outside of the tone mapping function\n\n\t\t\tgl_FragColor = vec4( ACESFilmicToneMapping( tex.rgb ), tex.a );\n\n\t\t}`,\n\n}\n\nexport default ACESFilmicToneMappingShader"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA,
|
|
1
|
+
{"version":3,"names":["ACESFilmicToneMappingShader","name","uniforms","tDiffuse","value","exposure","vertexShader","fragmentShader"],"sources":["../../../../src/core/PostEffects/shader/mapping.ts"],"sourcesContent":["/**\n *\n * ACES Filmic Tone Mapping Shader by Stephen Hill\n * source: https://github.com/mrdoob/three.js/blob/3bffaf229d9646a61b9c7087d255c2360d1d2856/examples/jsm/shaders/ACESFilmicToneMappingShader.js\n */\n\n/* eslint-disable no-tabs */\nconst ACESFilmicToneMappingShader = {\n\n name: 'ACESFilmicToneMappingShader',\n\n uniforms: {\n\n tDiffuse: { value: null },\n exposure: { value: 1.0 },\n\n },\n\n vertexShader: /* glsl */`\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}`,\n\n fragmentShader: /* glsl */`\n\n\t\t#define saturate(a) clamp( a, 0.0, 1.0 )\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tuniform float exposure;\n\n\t\tvarying vec2 vUv;\n\n\t\t// vec3 RRTAndODTFit( vec3 v ) {\n\n\t\t// \tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\t\t// \tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\t\t// \treturn a / b;\n\n\t\t// }\n\n\t\t// vec3 ACESFilmicToneMapping( vec3 color ) {\n\n\t\t// // sRGB => XYZ => D65_2_D60 => AP1 => RRT_SAT\n\t\t// \tconst mat3 ACESInputMat = mat3(\n\t\t// \t\tvec3( 0.59719, 0.07600, 0.02840 ), // transposed from source\n\t\t// \t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\t// \t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t\t// \t);\n\n\t\t// // ODT_SAT => XYZ => D60_2_D65 => sRGB\n\t\t// \tconst mat3 ACESOutputMat = mat3(\n\t\t// \t\tvec3( 1.60475, -0.10208, -0.00327 ), // transposed from source\n\t\t// \t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\t// \t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t\t// \t);\n\n\t\t// \tcolor = ACESInputMat * color;\n\n\t\t// // Apply RRT and ODT\n\t\t// \tcolor = RRTAndODTFit( color );\n\n\t\t// \tcolor = ACESOutputMat * color;\n\n\t\t// // Clamp to [0, 1]\n\t\t// \treturn saturate( color );\n\n\t\t// }\n\n\t\tvoid main() {\n\n\t\t\tvec4 tex = texture2D( tDiffuse, vUv );\n\n\t\t\ttex.rgb *= exposure / 0.6; // pre-exposed, outside of the tone mapping function\n\n\t\t\tgl_FragColor = vec4( ACESFilmicToneMapping( tex.rgb ), tex.a );\n\n\t\t}`,\n\n}\n\nexport default ACESFilmicToneMappingShader"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAMA,2BAA2B,GAAG;EAElCC,IAAI,EAAE,6BAA6B;EAEnCC,QAAQ,EAAE;IAERC,QAAQ,EAAE;MAAEC,KAAK,EAAE;IAAK,CAAC;IACzBC,QAAQ,EAAE;MAAED,KAAK,EAAE;IAAI;EAEzB,CAAC;EAEDE,YAAY,EAAE,uKASZ;EAEFC,cAAc,EAAE;AAwDlB,CAAC;AAED,eAAeP,2BAA2B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector2, Vector3 } from '@anov/3d-core';
|
|
2
|
-
|
|
2
|
+
var thermalMagingShader = {
|
|
3
3
|
uniforms: {
|
|
4
4
|
tDiffuse: {
|
|
5
5
|
value: null
|
|
@@ -11,33 +11,8 @@ const thermalMagingShader = {
|
|
|
11
11
|
value: [new Vector3(234.0, 51.0, 61.0), new Vector3(235.0, 70.0, 105.0), new Vector3(178.0, 119.0, 37.0), new Vector3(247.0, 206.0, 70.0), new Vector3(149.0, 232.0, 71.0), new Vector3(103.0, 200.0, 250.0), new Vector3(68.0, 132.0, 245.0), new Vector3(40.0, 3.0, 143.0), new Vector3(18.0, 5.0, 62.0)]
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
vertexShader: /* glsl
|
|
15
|
-
varying vec2 vUv
|
|
16
|
-
void main() {
|
|
17
|
-
vUv = uv;
|
|
18
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
19
|
-
}
|
|
20
|
-
`,
|
|
21
|
-
fragmentShader: /* glsl */`
|
|
22
|
-
uniform sampler2D tDiffuse;
|
|
23
|
-
uniform vec3 colorLevels[9];
|
|
24
|
-
varying vec2 vUv;
|
|
25
|
-
|
|
26
|
-
void main() {
|
|
27
|
-
vec4 color = texture2D(tDiffuse, vUv);
|
|
28
|
-
|
|
29
|
-
color.rgb += vec3(1.0, 0.0, 0.5) * color.rgb * 0.2;
|
|
30
|
-
|
|
31
|
-
float lum = dot(color.rgb, vec3(0.3, 0.59, 0.11));
|
|
32
|
-
lum = 1.0 - lum;
|
|
33
|
-
|
|
34
|
-
float d = 1.0 / 9.0;
|
|
35
|
-
int i = int(lum / d);
|
|
36
|
-
i = clamp(i, 0, 8);
|
|
37
|
-
|
|
38
|
-
gl_FragColor = vec4(colorLevels[i] / 255.0, 1.0);
|
|
39
|
-
}
|
|
40
|
-
`
|
|
14
|
+
vertexShader: /* glsl */"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",
|
|
15
|
+
fragmentShader: /* glsl */"\n uniform sampler2D tDiffuse;\n uniform vec3 colorLevels[9];\n varying vec2 vUv;\n\n void main() {\n vec4 color = texture2D(tDiffuse, vUv);\n\n color.rgb += vec3(1.0, 0.0, 0.5) * color.rgb * 0.2;\n\n float lum = dot(color.rgb, vec3(0.3, 0.59, 0.11));\n lum = 1.0 - lum;\n\n float d = 1.0 / 9.0;\n int i = int(lum / d);\n i = clamp(i, 0, 8);\n\n gl_FragColor = vec4(colorLevels[i] / 255.0, 1.0);\n }\n "
|
|
41
16
|
};
|
|
42
17
|
export default thermalMagingShader;
|
|
43
18
|
//# sourceMappingURL=thermalMaging.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Vector2","Vector3","thermalMagingShader","uniforms","tDiffuse","value","iResolution","colorLevels","vertexShader","fragmentShader"],"sources":["../../../../src/core/PostEffects/shader/thermalMaging.ts"],"sourcesContent":["import { Vector2, Vector3 } from '@anov/3d-core'\n\nconst thermalMagingShader = {\n uniforms: {\n tDiffuse: { value: null },\n iResolution: { value: new Vector2(1, 1) },\n colorLevels: { value: [new Vector3(234.0, 51.0, 61.0), new Vector3(235.0, 70.0, 105.0), new Vector3(178.0, 119.0, 37.0), new Vector3(247.0, 206.0, 70.0), new Vector3(149.0, 232.0, 71.0), new Vector3(103.0, 200.0, 250.0), new Vector3(68.0, 132.0, 245.0), new Vector3(40.0, 3.0, 143.0), new Vector3(18.0, 5.0, 62.0)] },\n },\n vertexShader: /* glsl */`\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n `,\n fragmentShader: /* glsl */`\n uniform sampler2D tDiffuse;\n uniform vec3 colorLevels[9];\n varying vec2 vUv;\n\n void main() {\n vec4 color = texture2D(tDiffuse, vUv);\n\n color.rgb += vec3(1.0, 0.0, 0.5) * color.rgb * 0.2;\n\n float lum = dot(color.rgb, vec3(0.3, 0.59, 0.11));\n lum = 1.0 - lum;\n\n float d = 1.0 / 9.0;\n int i = int(lum / d);\n i = clamp(i, 0, 8);\n\n gl_FragColor = vec4(colorLevels[i] / 255.0, 1.0);\n }\n `,\n}\n\nexport default thermalMagingShader\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,OAAO,QAAQ,eAAe;AAEhD,
|
|
1
|
+
{"version":3,"names":["Vector2","Vector3","thermalMagingShader","uniforms","tDiffuse","value","iResolution","colorLevels","vertexShader","fragmentShader"],"sources":["../../../../src/core/PostEffects/shader/thermalMaging.ts"],"sourcesContent":["import { Vector2, Vector3 } from '@anov/3d-core'\n\nconst thermalMagingShader = {\n uniforms: {\n tDiffuse: { value: null },\n iResolution: { value: new Vector2(1, 1) },\n colorLevels: { value: [new Vector3(234.0, 51.0, 61.0), new Vector3(235.0, 70.0, 105.0), new Vector3(178.0, 119.0, 37.0), new Vector3(247.0, 206.0, 70.0), new Vector3(149.0, 232.0, 71.0), new Vector3(103.0, 200.0, 250.0), new Vector3(68.0, 132.0, 245.0), new Vector3(40.0, 3.0, 143.0), new Vector3(18.0, 5.0, 62.0)] },\n },\n vertexShader: /* glsl */`\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n `,\n fragmentShader: /* glsl */`\n uniform sampler2D tDiffuse;\n uniform vec3 colorLevels[9];\n varying vec2 vUv;\n\n void main() {\n vec4 color = texture2D(tDiffuse, vUv);\n\n color.rgb += vec3(1.0, 0.0, 0.5) * color.rgb * 0.2;\n\n float lum = dot(color.rgb, vec3(0.3, 0.59, 0.11));\n lum = 1.0 - lum;\n\n float d = 1.0 / 9.0;\n int i = int(lum / d);\n i = clamp(i, 0, 8);\n\n gl_FragColor = vec4(colorLevels[i] / 255.0, 1.0);\n }\n `,\n}\n\nexport default thermalMagingShader\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,OAAO,QAAQ,eAAe;AAEhD,IAAMC,mBAAmB,GAAG;EAC1BC,QAAQ,EAAE;IACRC,QAAQ,EAAE;MAAEC,KAAK,EAAE;IAAK,CAAC;IACzBC,WAAW,EAAE;MAAED,KAAK,EAAE,IAAIL,OAAO,CAAC,CAAC,EAAE,CAAC;IAAE,CAAC;IACzCO,WAAW,EAAE;MAAEF,KAAK,EAAE,CAAC,IAAIJ,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAIA,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,IAAIA,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAIA,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAIA,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAIA,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,IAAIA,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,IAAIA,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,IAAIA,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC;IAAE;EAC7T,CAAC;EACDO,YAAY,EAAE,2LAMX;EACHC,cAAc,EAAE;AAoBlB,CAAC;AAED,eAAeP,mBAAmB"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
1
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" ==
|
|
3
|
-
function _toPrimitive(t, r) { if ("object" !=
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
8
|
import { Box3, Object3D, Vector3, use } from '@anov/3d-core';
|
|
5
9
|
import { EEaseType, ESceneGrowType } from "./type";
|
|
6
10
|
import { GrowStyleDown, GrowStyleUp } from "./growStyle";
|
|
7
11
|
|
|
8
12
|
// 生长动画对象
|
|
9
|
-
export
|
|
10
|
-
|
|
13
|
+
export var Grow = /*#__PURE__*/function () {
|
|
14
|
+
function Grow(opt) {
|
|
15
|
+
_classCallCheck(this, Grow);
|
|
11
16
|
_defineProperty(this, "objs", void 0);
|
|
12
17
|
_defineProperty(this, "option", void 0);
|
|
13
18
|
_defineProperty(this, "growStyle", void 0);
|
|
@@ -19,93 +24,104 @@ export class Grow {
|
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
// 生长
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// 消退
|
|
33
|
-
out(callback) {
|
|
34
|
-
// 出场事件
|
|
35
|
-
this.option.onGrowOutStart && this.option.onGrowOutStart();
|
|
36
|
-
this.growStyle.getTimeLine().eventCallback('onReverseComplete', () => {
|
|
37
|
-
this.option.onGrowOutCompleted && this.option.onGrowOutCompleted();
|
|
38
|
-
callback && callback();
|
|
39
|
-
});
|
|
40
|
-
this.growStyle.out();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// 初始化
|
|
44
|
-
init(opt) {
|
|
45
|
-
this.option = {
|
|
46
|
-
tag: '*',
|
|
47
|
-
// 可选,进场对象Tag, 默认 "*" 所有可见MESH对象,
|
|
48
|
-
type: ESceneGrowType.Up,
|
|
49
|
-
// 可选,进场动画类型,默认 ESceneGrowType.Up向上生长
|
|
50
|
-
time: 0.5,
|
|
51
|
-
// 可选,单对象进场时间,默认0.5秒
|
|
52
|
-
gapTime: 0.2,
|
|
53
|
-
// 可选,多个对象之间间隔事件,默认0.2秒
|
|
54
|
-
ease: EEaseType.SineInOut,
|
|
55
|
-
// 可选,默认缓入缓出
|
|
56
|
-
center: null,
|
|
57
|
-
// 可选,生长中心位置,默认包围盒中心点
|
|
58
|
-
scale: 1,
|
|
59
|
-
// 可选,倍速,默认为1。
|
|
60
|
-
distance: 1000,
|
|
61
|
-
// 可选,初始化UP/DOWN起始距离,默认1000
|
|
62
|
-
isRotate: true,
|
|
63
|
-
// 可选,初始化UP/DOWN起始旋转角度,默认true
|
|
64
|
-
isScale: true // 可选,初始化UP/DOWN起始缩放大小,默认true
|
|
65
|
-
};
|
|
66
|
-
Object.assign(this.option, opt);
|
|
67
|
-
// ------- 1.初始化目标对象 --------
|
|
68
|
-
this.objs.length = 0;
|
|
69
|
-
// 获取所有对象
|
|
70
|
-
if (this.option.tag === '*') {
|
|
71
|
-
use.useScene().scene.traverseVisible(object => {
|
|
72
|
-
if (object instanceof Object3D) this.objs.push(object);
|
|
27
|
+
_createClass(Grow, [{
|
|
28
|
+
key: "in",
|
|
29
|
+
value: function _in(callback) {
|
|
30
|
+
var _this = this;
|
|
31
|
+
// 入场事件
|
|
32
|
+
this.option.onGrowInStart && this.option.onGrowInStart();
|
|
33
|
+
this.growStyle.getTimeLine().eventCallback('onComplete', function () {
|
|
34
|
+
_this.option.onGrowInCompleted && _this.option.onGrowInCompleted();
|
|
35
|
+
callback && callback();
|
|
73
36
|
});
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
37
|
+
this.growStyle.in();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 消退
|
|
41
|
+
}, {
|
|
42
|
+
key: "out",
|
|
43
|
+
value: function out(callback) {
|
|
44
|
+
var _this2 = this;
|
|
45
|
+
// 出场事件
|
|
46
|
+
this.option.onGrowOutStart && this.option.onGrowOutStart();
|
|
47
|
+
this.growStyle.getTimeLine().eventCallback('onReverseComplete', function () {
|
|
48
|
+
_this2.option.onGrowOutCompleted && _this2.option.onGrowOutCompleted();
|
|
49
|
+
callback && callback();
|
|
78
50
|
});
|
|
51
|
+
this.growStyle.out();
|
|
79
52
|
}
|
|
80
53
|
|
|
81
|
-
//
|
|
82
|
-
|
|
83
|
-
|
|
54
|
+
// 初始化
|
|
55
|
+
}, {
|
|
56
|
+
key: "init",
|
|
57
|
+
value: function init(opt) {
|
|
58
|
+
var _this3 = this;
|
|
59
|
+
this.option = {
|
|
60
|
+
tag: '*',
|
|
61
|
+
// 可选,进场对象Tag, 默认 "*" 所有可见MESH对象,
|
|
62
|
+
type: ESceneGrowType.Up,
|
|
63
|
+
// 可选,进场动画类型,默认 ESceneGrowType.Up向上生长
|
|
64
|
+
time: 0.5,
|
|
65
|
+
// 可选,单对象进场时间,默认0.5秒
|
|
66
|
+
gapTime: 0.2,
|
|
67
|
+
// 可选,多个对象之间间隔事件,默认0.2秒
|
|
68
|
+
ease: EEaseType.SineInOut,
|
|
69
|
+
// 可选,默认缓入缓出
|
|
70
|
+
center: null,
|
|
71
|
+
// 可选,生长中心位置,默认包围盒中心点
|
|
72
|
+
scale: 1,
|
|
73
|
+
// 可选,倍速,默认为1。
|
|
74
|
+
distance: 1000,
|
|
75
|
+
// 可选,初始化UP/DOWN起始距离,默认1000
|
|
76
|
+
isRotate: true,
|
|
77
|
+
// 可选,初始化UP/DOWN起始旋转角度,默认true
|
|
78
|
+
isScale: true // 可选,初始化UP/DOWN起始缩放大小,默认true
|
|
79
|
+
};
|
|
80
|
+
Object.assign(this.option, opt);
|
|
81
|
+
// ------- 1.初始化目标对象 --------
|
|
82
|
+
this.objs.length = 0;
|
|
83
|
+
// 获取所有对象
|
|
84
|
+
if (this.option.tag === '*') {
|
|
85
|
+
use.useScene().scene.traverseVisible(function (object) {
|
|
86
|
+
if (object instanceof Object3D) _this3.objs.push(object);
|
|
87
|
+
});
|
|
88
|
+
} else {
|
|
89
|
+
// 获取指定tag对象
|
|
90
|
+
use.useScene().scene.traverseVisible(function (object) {
|
|
91
|
+
if (object instanceof Object3D && object.userData.tag && Array.isArray(object.userData.tag) && object.userData.tag.includes(_this3.option.tag)) _this3.objs.push(object);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// ------- 2.中心点 ------------
|
|
96
|
+
if (!this.option.center) {
|
|
97
|
+
var boundingBox = new Box3();
|
|
84
98
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
99
|
+
// 将每个物体的边界框扩展到包围盒中
|
|
100
|
+
for (var i = 0; i < this.objs.length; i++) {
|
|
101
|
+
var object = this.objs[i];
|
|
102
|
+
boundingBox.expandByObject(object);
|
|
103
|
+
}
|
|
104
|
+
// 计算包围盒的中心点
|
|
105
|
+
var center = new Vector3();
|
|
106
|
+
this.option.center = boundingBox.getCenter(center);
|
|
89
107
|
}
|
|
90
|
-
// 计算包围盒的中心点
|
|
91
|
-
const center = new Vector3();
|
|
92
|
-
this.option.center = boundingBox.getCenter(center);
|
|
93
|
-
}
|
|
94
108
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
109
|
+
// ------- 2.初始化目标对象 生长前状态 --------
|
|
110
|
+
switch (this.option.type) {
|
|
111
|
+
case ESceneGrowType.Up:
|
|
112
|
+
this.growStyle = new GrowStyleUp(this.objs, this.option);
|
|
113
|
+
break;
|
|
114
|
+
case ESceneGrowType.Down:
|
|
115
|
+
this.growStyle = new GrowStyleDown(this.objs, this.option);
|
|
116
|
+
break;
|
|
117
|
+
default:
|
|
118
|
+
this.growStyle = new GrowStyleUp(this.objs, this.option);
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
this.growStyle.init();
|
|
122
|
+
this.option.onGrowInitCompleted && this.option.onGrowInitCompleted();
|
|
106
123
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
124
|
+
}]);
|
|
125
|
+
return Grow;
|
|
126
|
+
}();
|
|
111
127
|
//# sourceMappingURL=grow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Box3","Object3D","Vector3","use","EEaseType","ESceneGrowType","GrowStyleDown","GrowStyleUp","Grow","
|
|
1
|
+
{"version":3,"names":["Box3","Object3D","Vector3","use","EEaseType","ESceneGrowType","GrowStyleDown","GrowStyleUp","Grow","opt","_classCallCheck","_defineProperty","objs","option","growStyle","init","_createClass","key","value","_in","callback","_this","onGrowInStart","getTimeLine","eventCallback","onGrowInCompleted","in","out","_this2","onGrowOutStart","onGrowOutCompleted","_this3","tag","type","Up","time","gapTime","ease","SineInOut","center","scale","distance","isRotate","isScale","Object","assign","length","useScene","scene","traverseVisible","object","push","userData","Array","isArray","includes","boundingBox","i","expandByObject","getCenter","Down","onGrowInitCompleted"],"sources":["../../../../src/core/SceneEffect/grow/grow.ts"],"sourcesContent":["import { Box3, Object3D, Vector3, gsap, use } from '@anov/3d-core'\nimport type { GrowOption, IGrowStyle } from './type'\nimport { EEaseType, ESceneGrowType } from './type'\nimport { GrowStyleDown, GrowStyleUp } from './growStyle'\n\n// 生长动画对象\nexport class Grow {\n private objs: Array<Object3D>\n private option: GrowOption\n private growStyle: IGrowStyle\n\n constructor(opt?: GrowOption) {\n this.objs = []\n this.option = {}\n // @ts-ignore\n this.growStyle = null\n this.init(opt || {})\n }\n\n // 生长\n in(callback: () => void) {\n // 入场事件\n this.option.onGrowInStart && this.option.onGrowInStart()\n\n this.growStyle.getTimeLine().eventCallback('onComplete', () => {\n this.option.onGrowInCompleted && this.option.onGrowInCompleted()\n callback && callback()\n })\n\n this.growStyle.in()\n }\n\n // 消退\n out(callback: () => void) {\n // 出场事件\n this.option.onGrowOutStart && this.option.onGrowOutStart()\n\n this.growStyle.getTimeLine().eventCallback('onReverseComplete', () => {\n this.option.onGrowOutCompleted && this.option.onGrowOutCompleted()\n\n callback && callback()\n })\n\n this.growStyle.out()\n }\n\n // 初始化\n init(opt: GrowOption) {\n this.option = {\n tag: '*', // 可选,进场对象Tag, 默认 \"*\" 所有可见MESH对象,\n type: ESceneGrowType.Up, // 可选,进场动画类型,默认 ESceneGrowType.Up向上生长\n time: 0.5, // 可选,单对象进场时间,默认0.5秒\n gapTime: 0.2, // 可选,多个对象之间间隔事件,默认0.2秒\n ease: EEaseType.SineInOut, // 可选,默认缓入缓出\n center: null, // 可选,生长中心位置,默认包围盒中心点\n scale: 1, // 可选,倍速,默认为1。\n distance: 1000, // 可选,初始化UP/DOWN起始距离,默认1000\n isRotate: true, // 可选,初始化UP/DOWN起始旋转角度,默认true\n isScale: true, // 可选,初始化UP/DOWN起始缩放大小,默认true\n }\n Object.assign(this.option, opt)\n // ------- 1.初始化目标对象 --------\n this.objs.length = 0\n // 获取所有对象\n if (this.option.tag === '*') {\n use.useScene().scene!.traverseVisible((object) => {\n if (object instanceof Object3D)\n this.objs.push(object)\n })\n }\n else { // 获取指定tag对象\n use.useScene().scene!.traverseVisible((object) => {\n if (object instanceof Object3D && object.userData.tag && Array.isArray(object.userData.tag) && object.userData.tag.includes(this.option.tag))\n this.objs.push(object)\n })\n }\n\n // ------- 2.中心点 ------------\n if (!this.option.center) {\n const boundingBox = new Box3()\n\n // 将每个物体的边界框扩展到包围盒中\n for (let i = 0; i < this.objs.length; i++) {\n const object = this.objs[i]\n boundingBox.expandByObject(object)\n }\n // 计算包围盒的中心点\n const center = new Vector3()\n this.option.center = boundingBox.getCenter(center)\n }\n\n // ------- 2.初始化目标对象 生长前状态 --------\n switch (this.option.type) {\n case ESceneGrowType.Up:\n this.growStyle = new GrowStyleUp(this.objs, this.option)\n break\n case ESceneGrowType.Down:\n this.growStyle = new GrowStyleDown(this.objs, this.option)\n break\n default:\n this.growStyle = new GrowStyleUp(this.objs, this.option)\n break\n }\n this.growStyle.init()\n this.option.onGrowInitCompleted && this.option.onGrowInitCompleted()\n }\n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