@ino-cesium/effects 0.0.13 → 0.0.15

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/index.d.ts CHANGED
@@ -1,34 +1,33 @@
1
- import * as cesium from 'cesium';
2
- import { Viewer, Color, PostProcessStage, PostProcessStageComposite, Cartesian4, CustomShader } from 'cesium';
1
+ import * as Cesium from 'cesium';
3
2
 
4
- declare const createHighLightStage: (viewer: Viewer, color?: Color) => {
5
- stage: PostProcessStage | cesium.PostProcessStageComposite;
3
+ declare const createHighLightStage: (viewer: Cesium.Viewer, color?: Cesium.Color) => {
4
+ stage: Cesium.PostProcessStage | Cesium.PostProcessStageComposite;
6
5
  remove: () => void;
7
6
  };
8
7
  interface IHighLightStageOptions {
9
- viewer: Viewer;
10
- color?: Color;
8
+ viewer: Cesium.Viewer;
9
+ color?: Cesium.Color;
11
10
  }
12
11
 
13
- declare const createSkylineStage: (viewer: Viewer) => {
14
- stage: PostProcessStageComposite;
12
+ declare const createSkylineStage: (viewer: Cesium.Viewer) => {
13
+ stage: Cesium.PostProcessStageComposite;
15
14
  remove: () => void;
16
15
  };
17
16
 
18
- declare const createOutlineStage: (viewer: Viewer, color?: Color) => {
19
- stage: cesium.PostProcessStage | cesium.PostProcessStageComposite;
17
+ declare const createOutlineStage: (viewer: Cesium.Viewer, color?: Cesium.Color) => {
18
+ stage: Cesium.PostProcessStage | Cesium.PostProcessStageComposite;
20
19
  remove: () => void;
21
20
  };
22
21
 
23
22
  declare const createSnowCoverStage: (options: ISnowCoverStageOptions) => {
24
- stage: cesium.PostProcessStage;
23
+ stage: Cesium.PostProcessStage;
25
24
  remove: () => void;
26
25
  };
27
26
  interface ISnowCoverStageOptions {
28
27
  /**
29
28
  * 应用积雪效果的 Cesium Viewer 实例。
30
29
  */
31
- viewer: Viewer;
30
+ viewer: Cesium.Viewer;
32
31
  /**
33
32
  * 要应用积雪效果的模型。
34
33
  */
@@ -47,14 +46,14 @@ interface ISnowCoverStageOptions {
47
46
  * @param options.speed 雪的移动速度
48
47
  */
49
48
  declare const createSnowStage: (options: ISnowStageOptions) => {
50
- stage: PostProcessStage | cesium.PostProcessStageComposite;
49
+ stage: Cesium.PostProcessStage | Cesium.PostProcessStageComposite;
51
50
  remove: () => void;
52
51
  };
53
52
  /**
54
53
  * 下雪特效参数
55
54
  */
56
55
  interface ISnowStageOptions {
57
- viewer: Viewer;
56
+ viewer: Cesium.Viewer;
58
57
  /**
59
58
  * 雪的密度
60
59
  */
@@ -66,11 +65,11 @@ interface ISnowStageOptions {
66
65
  }
67
66
 
68
67
  declare const createHeightFogStage: (options: IHeightFogStageOptions) => {
69
- stage: PostProcessStage | cesium.PostProcessStageComposite;
68
+ stage: Cesium.PostProcessStage | Cesium.PostProcessStageComposite;
70
69
  remove: () => void;
71
70
  };
72
71
  interface IHeightFogStageOptions {
73
- viewer: Viewer;
72
+ viewer: Cesium.Viewer;
74
73
  height?: number;
75
74
  alpha?: number;
76
75
  EPSILON12?: number;
@@ -80,46 +79,49 @@ interface IHeightFogStageOptions {
80
79
  }
81
80
 
82
81
  declare const createFogStage: (options: IFogStageOptions) => {
83
- stage: PostProcessStage | cesium.PostProcessStageComposite;
82
+ stage: Cesium.PostProcessStage | Cesium.PostProcessStageComposite;
84
83
  remove: () => void;
85
84
  };
86
85
  interface IFogStageOptions {
87
- viewer: Viewer;
88
- fogColor?: Color;
89
- fogByDistance?: Cartesian4;
86
+ viewer: Cesium.Viewer;
87
+ fogColor?: Cesium.Color;
88
+ fogByDistance?: Cesium.Cartesian4;
90
89
  }
91
90
 
92
- declare const createBloomTargetStage: (viewer: Viewer) => {
93
- stage: PostProcessStage | PostProcessStageComposite;
91
+ declare const createBloomTargetStage: (viewer: Cesium.Viewer) => {
92
+ stage: Cesium.PostProcessStage | Cesium.PostProcessStageComposite;
94
93
  remove: () => void;
95
94
  };
96
95
 
97
96
  declare const createRainStage: (options: IRainStageOptions) => {
98
- stage: PostProcessStage | cesium.PostProcessStageComposite;
97
+ stage: Cesium.PostProcessStage | Cesium.PostProcessStageComposite;
99
98
  remove: () => void;
100
99
  };
101
100
  interface IRainStageOptions {
102
- viewer: Viewer;
101
+ viewer: Cesium.Viewer;
103
102
  speed?: number;
104
103
  size?: number;
105
104
  direction?: number;
106
105
  }
107
106
 
108
- declare const createRainCoverStage: (viewer: Viewer) => {
109
- stage: cesium.PostProcessStage;
107
+ declare const createRainCoverStage: (options: IRainCoverStage) => {
108
+ stage: Cesium.PostProcessStage;
110
109
  remove: () => void;
111
110
  };
111
+ interface IRainCoverStage {
112
+ viewer: Cesium.Viewer;
113
+ }
112
114
 
113
115
  /**
114
116
  * 创建闪电特效
115
117
  * @param options
116
118
  */
117
119
  declare const createLightningStage: (options: ILightningStageOptions) => {
118
- stage: PostProcessStage | cesium.PostProcessStageComposite;
120
+ stage: Cesium.PostProcessStage | Cesium.PostProcessStageComposite;
119
121
  remove: () => void;
120
122
  };
121
123
  interface ILightningStageOptions {
122
- viewer: Viewer;
124
+ viewer: Cesium.Viewer;
123
125
  /**
124
126
  * 混合系数0-1之间的数
125
127
  */
@@ -130,7 +132,7 @@ interface ILightningStageOptions {
130
132
  fallInterval?: number;
131
133
  }
132
134
 
133
- declare const createLightBandCustomShader: (options: ILightBandStageOptions) => CustomShader;
135
+ declare const createLightBandCustomShader: (options: ILightBandStageOptions) => Cesium.CustomShader;
134
136
  interface ILightBandStageOptions {
135
137
  /**
136
138
  * 建筑最高值,用于计算光带的位置比例
@@ -143,7 +145,7 @@ interface ILightBandStageOptions {
143
145
  /**
144
146
  * 建筑颜色
145
147
  */
146
- color?: Color;
148
+ color?: Cesium.Color;
147
149
  /**
148
150
  * 光带的移动速度 默认为1 越大越慢
149
151
  */
@@ -154,18 +156,18 @@ interface ILightBandStageOptions {
154
156
  lineWidth?: number;
155
157
  }
156
158
 
157
- declare const createDroneAnimCustomShader: (options: IDroneAnimOptions) => CustomShader;
159
+ declare const createDroneAnimCustomShader: (options: IDroneAnimOptions) => Cesium.CustomShader;
158
160
  interface IDroneAnimOptions {
159
161
  /**
160
162
  * 颜色
161
163
  */
162
- color?: Color;
164
+ color?: Cesium.Color;
163
165
  }
164
166
 
165
- declare const createOutLineEffect: (viewer: Viewer) => {
166
- stage: cesium.PostProcessStage | cesium.PostProcessStageComposite;
167
+ declare const createOutLineEffect: (viewer: Cesium.Viewer) => {
168
+ stage: Cesium.PostProcessStage | Cesium.PostProcessStageComposite;
167
169
  remove: () => void;
168
170
  };
169
171
 
170
172
  export { createBloomTargetStage, createDroneAnimCustomShader, createFogStage, createHeightFogStage, createHighLightStage, createLightBandCustomShader, createLightningStage, createOutLineEffect, createOutlineStage, createRainCoverStage, createRainStage, createSkylineStage, createSnowCoverStage, createSnowStage };
171
- export type { IDroneAnimOptions, IFogStageOptions, IHeightFogStageOptions, IHighLightStageOptions, ILightBandStageOptions, ILightningStageOptions, IRainStageOptions, ISnowCoverStageOptions, ISnowStageOptions };
173
+ export type { IDroneAnimOptions, IFogStageOptions, IHeightFogStageOptions, IHighLightStageOptions, ILightBandStageOptions, ILightningStageOptions, IRainCoverStage, IRainStageOptions, ISnowCoverStageOptions, ISnowStageOptions };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import*as e from"cesium";import{Color as n,PostProcessStage as o,PostProcessStageLibrary as t,PostProcessStageComposite as r,Cartesian4 as a,CustomShader as i,UniformType as l}from"cesium";const s=(e,t=n.YELLOW)=>{const r=e.scene.postProcessStages.add(new o({fragmentShader:"\n uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n uniform vec4 highlight;\n void main() {\n vec4 color = texture(colorTexture, v_textureCoordinates);\n if (czm_selected()) {\n vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n out_FragColor = mix(color, vec4(highlighted,0.5), 0.3);\n } else {\n out_FragColor = color;\n }\n }\n ",uniforms:{highlight:()=>t}}));r.selected=[];return{stage:r,remove:()=>{e.scene.postProcessStages.remove(r)}}},c=e=>{const n=t.createEdgeDetectionStage(),a=new o({name:"skyline",fragmentShader:"\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n in vec2 v_textureCoordinates;\n void main() { float depth = czm_readDepth(depthTexture, v_textureCoordinates);\n vec4 color = texture(colorTexture, v_textureCoordinates);\n if (depth < 1.0 - 0.000001) {\n out_FragColor = color;\n } else {\n out_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n }\n }"}),i=new o({name:"mix",fragmentShader:"\n uniform sampler2D colorTexture;\n uniform sampler2D redTexture;\n uniform sampler2D silhouetteTexture;\n in vec2 v_textureCoordinates;\n\n void main() {\n vec4 redColor = texture(redTexture, v_textureCoordinates);\n vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates);\n vec4 color = texture(colorTexture, v_textureCoordinates);\n if (redColor.r == 1.0) {\n out_FragColor = mix(color, vec4(5.0, 0.0, 0.0, 1.0), silhouetteColor.a);\n } else {\n out_FragColor = color;\n }\n }",uniforms:{redTexture:a.name,silhouetteTexture:n.name}}),l=new r({stages:[n,a,i],inputPreviousStageTexture:!1,uniforms:n.uniforms});e.scene.postProcessStages.add(l);return{stage:l,remove:()=>{e.scene.postProcessStages.remove(l)}}},u=(e,o=n.YELLOW)=>{const r=e.scene.postProcessStages,a=t.createEdgeDetectionStage();a.uniforms.color=o,a.uniforms.length=1,a.selected=[];const i=t.createEdgeDetectionStage();i.uniforms.color=o,i.selected=[];const l=r.add(t.createSilhouetteStage([a,i]));l.selected=[];return{stage:l,remove:()=>{e.scene.postProcessStages.remove(l)}}},d=n=>{const o=n.viewer,t=new e.PostProcessStage({name:"SnowEffectCover",fragmentShader:"\n vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth)\n {\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);\n return eyeCoordinate.xyz / eyeCoordinate.w;\n }\n vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset, sampler2D depthMap) {\n vec2 glFragCoordXY = gl_FragCoord.xy;\n float upOrRightLogDepth = czm_unpackDepth(texture(depthMap, (glFragCoordXY + positiveOffset) / czm_viewport.zw));\n float downOrLeftLogDepth = czm_unpackDepth(texture(depthMap, (glFragCoordXY - positiveOffset) / czm_viewport.zw));\n bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);\n\n float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);\n float useDownOrLeft = float(useUpOrRight == 0.0);\n vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);\n vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);\n return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;\n }\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n uniform float intensity;\n in vec2 v_textureCoordinates;\n void main(void)\n {\n vec4 sceneColor = texture(colorTexture, v_textureCoordinates);\n\n float logDepthOrDepth = czm_unpackDepth(texture(depthTexture, v_textureCoordinates));\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;\n vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\n vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0), depthTexture);\n vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0), depthTexture);\n vec3 normalEC = normalize(cross(leftRight, downUp));\n vec3 normalMC = normalize((czm_inverseView * vec4(normalEC, 0.0)).xyz);\n vec3 ellipsoidNormal = normalize(worldCoordinate);\n float dotProd = dot(ellipsoidNormal, normalMC);\n if(dotProd < 0.3){\n out_FragColor = sceneColor;\n } else {\n out_FragColor = mix(sceneColor, vec4(1.0), dotProd * intensity);\n }\n if (czm_selected()) {\n out_FragColor = sceneColor;\n }\n }\n ",forcePowerOfTwo:!1,textureScale:1,uniforms:{intensity:()=>n.intensity||.8}});o.scene.postProcessStages.add(t);return t.selected=[],{stage:t,remove:()=>{o.scene.postProcessStages.remove(t)}}},v=e=>{const n=e.viewer,t=n.scene.postProcessStages.add(new o({fragmentShader:"\n uniform sampler2D colorTexture; //输入的场景渲染照片\n in vec2 v_textureCoordinates;\n uniform float speed;\n uniform float scale;\n\n float snow(vec2 uv, float thisScale) {\n float time = czm_frameNumber * speed / 1000.0;\n float wMars3D = smoothstep(1.0, 0.0, -uv.y * (thisScale / 10.0));\n if(wMars3D < 0.1)\n return 0.0;\n uv += time / thisScale;\n uv.y += time * 2.0 / thisScale;\n uv.x += sin(uv.y + time * 0.5) / thisScale;\n uv *= thisScale;\n\n vec2 s = floor(uv), f = fract(uv), p;\n float k = 3.0, d;\n p = 0.5 + 0.35 * sin(11.0 * fract(sin((s + p + thisScale) * mat2(7, 3, 6, 5)) * 5.0)) - f;\n d = length(p);\n k = min(d, k);\n k = smoothstep(0.0, k, sin(f.x + f.y) * 0.01);\n return k * wMars3D;\n }\n void main(void) {\n vec2 resolution = czm_viewport.zw;\n vec2 uv = (gl_FragCoord.xy * 2. - resolution.xy) / min(resolution.x, resolution.y);\n\n float c = 0.0;\n float step = 1.0/(scale*0.1);\n for(float i = 1.0; i < 12.0; i += 1.0) {\n c += snow(uv, i*step);\n }\n vec3 finalColor = vec3(c); //屏幕上雪的颜色\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor, 1.0), 0.5); //将雪和三维场景融合\n }",uniforms:{scale:()=>e.scale||5,speed:()=>e.speed||16}}));t.selected=[];return{stage:t,remove:()=>{n.scene.postProcessStages.remove(t)}}},f=e=>{const n=e.viewer.scene.postProcessStages.add(new o({fragmentShader:"\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n uniform float alpha;\n uniform float height;\n uniform vec3 oneOverRadii;\n uniform vec3 oneOverRadiiSquared;\n uniform float centerToleranceSquared;\n uniform float EPSILON12;\n uniform float earthRadius;\n\n in vec2 v_textureCoordinates;\n out vec4 glColor;\n\n vec4 toEye(in vec2 uv, in float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\n float getDepth(in vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n }\n\n\n vec3 getWorldCoordinateFromDepth(in vec4 currD){\n float depth = czm_unpackDepth(currD);\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);\n vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;\n vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\n return worldCoordinate;\n }\n\n float magnitude(in vec3 v){\n return sqrt(v.x * v.x + v.y * v.y + v.z * v.z);\n }\n\n // 沿大地表面法线缩放提供的笛卡尔位置,使其位于该椭球体的表面上\n vec3 scaleToGeodeticSurface(in vec3 cartesian){\n float positionX = cartesian.x;\n float positionY = cartesian.y;\n float positionZ = cartesian.z;\n float x2 = cartesian.x * cartesian.x * oneOverRadii.x * oneOverRadii.x;\n float y2 = cartesian.y * cartesian.y * oneOverRadii.y * oneOverRadii.y;\n float z2 = cartesian.z * cartesian.z * oneOverRadii.z * oneOverRadii.z;\n\n float squaredNorm = x2 + y2 + z2;\n float ratio = sqrt(1.0 / squaredNorm);\n vec3 intersection = cartesian * ratio;\n\n float oneOverRadiiSquaredX = oneOverRadiiSquared.x;\n float oneOverRadiiSquaredY = oneOverRadiiSquared.y;\n float oneOverRadiiSquaredZ = oneOverRadiiSquared.z;\n\n vec3 gradient = vec3(intersection.x * oneOverRadiiSquaredX * 2.0,intersection.y * oneOverRadiiSquaredY * 2.0,intersection.z * oneOverRadiiSquaredZ * 2.0);\n\n float lambda = ((1.0 - ratio) * magnitude(cartesian) ) / (0.5 * magnitude(gradient));\n float correction = 0.0;\n float func = 0.0;\n float denominator = 0.0;\n float xMultiplier = 0.0;\n float yMultiplier = 0.0;\n float zMultiplier = 0.0;\n float xMultiplier2 = 0.0;\n float yMultiplier2 = 0.0;\n float zMultiplier2 = 0.0;\n float xMultiplier3 = 0.0;\n float yMultiplier3 = 0.0;\n float zMultiplier3 = 0.0;\n do {\n lambda -= correction;\n\n xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX);\n yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY);\n zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ);\n\n xMultiplier2 = xMultiplier * xMultiplier;\n yMultiplier2 = yMultiplier * yMultiplier;\n zMultiplier2 = zMultiplier * zMultiplier;\n\n xMultiplier3 = xMultiplier2 * xMultiplier;\n yMultiplier3 = yMultiplier2 * yMultiplier;\n zMultiplier3 = zMultiplier2 * zMultiplier;\n\n float func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0;\n\n float denominator =\n x2 * xMultiplier3 * oneOverRadiiSquaredX +\n y2 * yMultiplier3 * oneOverRadiiSquaredY +\n z2 * zMultiplier3 * oneOverRadiiSquaredZ;\n\n float derivative = -2.0 * denominator;\n\n correction = func / derivative;\n } while (abs(func) > EPSILON12);\n return vec3(positionX * xMultiplier, positionY * yMultiplier, positionZ * zMultiplier);\n }\n\n vec3 multiplyComponents(in vec3 left,in vec3 right){\n return vec3(left.x * right.x, left.y * right.y, left.z * right.z);\n }\n\n\n // 将世界坐标转为经纬度高度\n vec3 getCartographicFromCartesian3(in vec3 cartesian){\n vec3 p = scaleToGeodeticSurface(cartesian);\n vec3 n = multiplyComponents(p,oneOverRadiiSquared);\n n = normalize(n);\n vec3 h = cartesian - p;\n\n float longitude = atan(n.y, n.x);\n float latitude = asin(n.z);\n float height = sign(dot(h, cartesian)) * magnitude(h);\n\n return vec3(longitude,latitude,height);\n }\n\n // 计算每个像素点的高度 通过计算相机所在位置的地球半径作为每个点的地球半径,然后用每个点的length减去半径得到近似的高度\n float getHeight(in vec4 currD){\n // 传入每个点的世界坐标\n float altitude = 0.0;\n float depth = czm_unpackDepth(currD);\n if (depth == 0.0) {\n altitude = czm_infinity;\n }\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);\n float distance = -eyeCoordinate.z / eyeCoordinate.w;\n vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;\n vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\n altitude = length(worldCoordinate.xyz) - earthRadius;\n return altitude;\n }\n\n void main(){\n vec4 color = texture(colorTexture, v_textureCoordinates);\n vec4 currD = texture(depthTexture, v_textureCoordinates);\n if(currD.r>=1.0){\n glColor = color;\n return;\n }\n // 此方法有问题 会闪烁\n float depth = getDepth(currD);\n vec4 positionEC = toEye(v_textureCoordinates, depth);\n vec4 positionWC = czm_inverseView * positionEC;\n // 获取当前点的高度\n // vec3 positionWC = getWorldCoordinateFromDepth(currD);\n vec3 cartographic = getCartographicFromCartesian3(vec3(positionWC.x,positionWC.y,positionWC.z));\n // 高度加了10之后 就不闪烁了\n float pointHeight = cartographic.z + 10.;\n // 当前点高度越高,雾浓度越小,高度达到设定高度,雾浓度为0,同时乘以深度,距离越远,浓度越大\n float fog = (height/pointHeight - 1.);\n fog = clamp(fog, 0.0, 1.0);\n glColor = mix(color,vec4(1.0,1.,1.,1),fog*alpha);\n }",uniforms:{EPSILON12:()=>e.EPSILON12||1e-12,alpha:()=>e.alpha||.88,centerToleranceSquared:()=>e.centerToleranceSquared||.1,height:()=>e.height||100,oneOverRadii:()=>e.oneOverRadii||{x:1.567855942887398e-7,y:1.567855942887398e-7,z:1.573130351105623e-7},oneOverRadiiSquared:()=>e.oneOverRadiiSquared||{x:2458172257647332e-29,y:2458172257647332e-29,z:24747391015697002e-30}}}));n.selected=[];return{stage:n,remove:()=>{e.viewer.scene.postProcessStages.remove(n)}}},m=e=>{const t=e.viewer.scene.postProcessStages.add(new o({fragmentShader:"\nfloat getDistance(sampler2D depthTexture, vec2 texCoords) {\n float depth = czm_unpackDepth(texture(depthTexture, texCoords));\n if(depth == 0.0) {\n return czm_infinity;\n }\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);\n return -eyeCoordinate.z / eyeCoordinate.w;\n}\nfloat interpolateByDistanceMars3D(vec4 nearFarScalar, float distance) {\n float startDistance = nearFarScalar.x;\n float startValue = nearFarScalar.y;\n float endDistance = nearFarScalar.z;\n float endValue = nearFarScalar.w;\n float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);\n return mix(startValue, endValue, t);\n}\nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) {\n return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);\n}\nuniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nuniform vec4 fogByDistance;\nuniform vec4 fogColor;\nin vec2 v_textureCoordinates;\nvoid main(void) {\n float distance = getDistance(depthTexture, v_textureCoordinates);\n vec4 sceneColor = texture(colorTexture, v_textureCoordinates);\n float blendAmount = interpolateByDistanceMars3D(fogByDistance, distance);\n vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);\n out_FragColor = alphaBlend(finalFogColor, sceneColor);\n}\n ",uniforms:{fogColor:()=>e.fogColor||n.WHITE,fogByDistance:()=>e.fogByDistance||new a(100,0,9e3,.9)}}));t.selected=[];return{stage:t,remove:()=>{e.viewer.scene.postProcessStages.remove(t)}}},p=e=>{const t=new r({name:"undefinedcontrast_bias_blur",stages:[new o({name:"undefinedcontrast_bias",fragmentShader:"\n uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n uniform float contrast;\n uniform float brightness;\n void main(void)\n {\n vec4 texture1 = texture(colorTexture, v_textureCoordinates);\n vec3 sceneColor = texture1.rgb;\n\n sceneColor = czm_RGBToHSB(sceneColor);\n sceneColor.z += brightness;\n sceneColor = czm_HSBToRGB(sceneColor);\n float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));\n sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);\n out_FragColor = vec4(sceneColor, texture1.a);\n }\n ",uniforms:{contrast:()=>128,brightness:()=>-.3}}),new r({name:"undefined_blur_comp",stages:[new o({name:"undefinedhigh",fragmentShader:"\n uniform sampler2D colorTexture;\n uniform float threshold;\n uniform float smoothWidth;\n\n in vec2 v_textureCoordinates;\n void main() {\n vec4 marstexel = texture( colorTexture, v_textureCoordinates );\n\n #ifdef CZM_SELECTED_FEATURE\n if (!czm_selected()) {\n marstexel = vec4(0.);\n }\n #endif\n\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\n float marsv = dot( marstexel.xyz, luma );\n float alpha = smoothstep(threshold, threshold + smoothWidth, marsv);\n\n vec4 outputColor = vec4(0.0,0.0,0.0,0.0);\n out_FragColor = mix( outputColor, marstexel, alpha );\n }\n ",uniforms:{threshold:()=>0,smoothWidth:()=>.01}})]})]}),a=e.scene.postProcessStages.add(new r({name:"bloom_target",inputPreviousStageTexture:!1,stages:[t,new o({name:"undefinedgenerate_composite",fragmentShader:"\n uniform sampler2D colorTexture;\n uniform sampler2D bloomTexture;\n uniform float ratio;\n uniform vec4 color;\n in vec2 v_textureCoordinates;\n void main(void)\n {\n vec4 color1 = texture(colorTexture, v_textureCoordinates);\n vec4 bloom = texture(bloomTexture, v_textureCoordinates);\n bloom *= color;\n if (czm_selected()) {\n bloom *= ratio;\n out_FragColor = bloom + color1;\n } else {\n out_FragColor = color1;\n }\n }\n ",uniforms:{bloomTexture:()=>"undefinedcontrast_bias_blur",color:()=>n.GREEN,ratio:()=>2}})]}));a.enabled=!1;return a.selected=[],{stage:a,remove:()=>{e.scene.postProcessStages.remove(a)}}},x=e=>{const n=e.viewer.scene.postProcessStages.add(new o({fragmentShader:"\n uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n uniform float speed;\n uniform float size;\n uniform float direction;\n\n float hash(float x) {\n return fract(sin(x * 133.3) * 13.13);\n }\n\n void main(void) {\n\n float time = czm_frameNumber * speed / 1000.0;\n vec2 resolution = czm_viewport.zw;\n\n vec2 uv = (gl_FragCoord.xy * 2. - resolution.xy) / min(resolution.x, resolution.y);\n vec3 finalColor = vec3(.6, .7, .8);//粒子的颜色\n\n float siMars3D = sin(direction), co = cos(direction);\n uv *= mat2(co, -siMars3D, siMars3D, co);\n uv *= length(uv + vec2(0, 4.9))*(20.0/size) + 1.0;\n\n float v = 1. - sin(hash(floor(uv.x * 100.0)) * 2.0);\n float b = clamp(abs(sin(20.0 * time * v + uv.y * (5. / (2.0 + v)))) - .95, 0.0, 1.0) * 20.0;\n finalColor *= v * b; //屏幕上雨的颜色\n\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor, 1.0), 0.5); //将雨和三维场景融合\n }\n ",uniforms:{speed:()=>e.speed||16,size:()=>e.size||20,direction:()=>360+(e.direction||30)}}));n.selected=[];return{stage:n,remove:()=>{e.viewer.scene.postProcessStages.remove(n)}}},g=n=>{const o=new e.PostProcessStage({fragmentShader:"\n#extension GL_OES_standard_derivatives:enable\nuniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nin vec2 v_textureCoordinates;\nvec4 toEye(in vec2 uv, in float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n}\nfloat getDepth(in vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nvec3 guussColor(vec2 uv){\n vec2 pixelSize = 1.0 / czm_viewport.zw;\n float dx0 = -pixelSize.x;\n float dy0 = -pixelSize.y;\n float dx1 = pixelSize.x;\n float dy1 = pixelSize.y;\n vec4 gc = (\n texture(colorTexture, uv)+\n texture(colorTexture, uv + vec2(dx0, dy0)) +\n texture(colorTexture, uv + vec2(0.0, dy0)) +\n texture(colorTexture, uv + vec2(dx1, dy0)) +\n texture(colorTexture, uv + vec2(dx0, 0.0)) +\n texture(colorTexture, uv + vec2(dx1, 0.0)) +\n texture(colorTexture, uv + vec2(dx0, dy1)) +\n texture(colorTexture, uv + vec2(0.0, dy1)) +\n texture(colorTexture, uv + vec2(dx1, dy1))\n ) * (1.0 / 9.0);\n return gc.rgb;\n}\nvoid main(){\n float offset = 0.0;\n vec4 color = texture(colorTexture, v_textureCoordinates);\n vec4 currD = texture(depthTexture, v_textureCoordinates);\n if(currD.r>=1.0){\n out_FragColor = color;\n return;\n }\n float depth = getDepth(currD);\n\n vec4 positionEC = toEye(v_textureCoordinates, depth);\n vec3 dx = dFdx(positionEC.xyz);\n vec3 dy = dFdy(positionEC.xyz);\n vec3 normal = normalize(cross(dx,dy));\n\n vec4 positionWC = normalize(czm_inverseView * positionEC);\n vec3 normalWC = normalize(czm_inverseViewRotation * normal);\n float fotNumWC = dot(positionWC.xyz,normalWC);\n if(fotNumWC<=0.5){\n out_FragColor = color;\n return;\n }\n\n vec3 viewDir = normalize(positionEC.xyz);\n vec3 reflectDir = reflect(viewDir, normal);\n vec3 viewReflectDir = reflectDir;\n\n float step = 0.05;\n int stepNum = int(20.0 / step);\n vec3 pos;\n vec3 albedo;\n bool jd = false;\n for(int i = 1;i <= 400;i++)\n {\n float delta = step * float(i) + offset;\n pos = positionEC.xyz + viewReflectDir * delta;\n float d = -pos.z;\n\n vec4 tmp = czm_projection * vec4(pos,1.0);\n vec3 screenPos = tmp.xyz / tmp.w;\n vec2 uv = vec2(screenPos.x, screenPos.y) * 0.5 + vec2(0.5, 0.5);\n\n if(uv.x > 0.0 && uv.x < 1.0 && uv.y > 0.0 && uv.y < 1.0){\n float dd = getDepth(texture(depthTexture, uv));\n vec4 jzc = toEye(uv, dd);\n dd = -jzc.z;\n if(d>dd){\n if(abs(abs(d) - abs(dd)) <=step){\n jd = true;\n // albedo = texture(colorTexture, uv).rgb;\n albedo = guussColor(uv);\n }\n break;\n }\n }\n }\n if(jd){\n out_FragColor = vec4(mix(color.xyz,albedo,0.5),1.0);\n }else{\n out_FragColor = color;\n }\n}\n",uniforms:{}});n.scene.postProcessStages.add(o);return{stage:o,remove:()=>{n.scene.postProcessStages.remove(o)}}},h=e=>{const n=e.viewer.scene.postProcessStages.add(new o({fragmentShader:"\n float hash(float x)\n {\n return fract(21654.6512 * sin(385.51 * x));\n }\n float hash(vec2 p)\n {\n return fract(1654.65157 * sin(15.5134763 * p.x + 45.5173247 * p.y + 5.21789));\n }\n vec2 hash2(vec2 p)\n {\n return vec2(hash(p * .754), hash(1.5743 * p + 4.5476351));\n }\n vec2 add = vec2(1.0, 0.0);\n vec2 noise2(vec2 x)\n {\n vec2 p = floor(x);\n vec2 f = fract(x);\n f = f * f * (3.0 - 2.0 * f);\n vec2 res = mix(mix(hash2(p),\n hash2(p + add.xy), f.x),\n mix(hash2(p + add.yx), hash2(p + add.xx), f.x), f.y);\n return res;\n }\n vec2 fbm2(vec2 x)\n {\n vec2 r = vec2(0.0);\n float a = 1.0;\n for (int i = 0; i < 8; i++)\n {\n r += noise2(x) * a;\n x *= 2.;\n a *= .5;\n }\n return r;\n }\n float dseg(vec2 ba, vec2 pa)\n {\n float h = clamp(dot(pa, ba) / dot(ba, ba), -0.2, 1.);\n return length(pa - ba * h);\n }\n uniform sampler2D colorTexture;\n uniform float fallInterval;\n uniform float mixFactor;\n in vec2 v_textureCoordinates;\n void main(void){\n vec2 uv = gl_FragCoord.xy;\n float iTime = czm_frameNumber * fallInterval * clamp(fallInterval * 0.1, 0.01, 0.1);\n vec2 p = uv / czm_viewport.zw;\n vec2 d;\n vec2 tgt = vec2(1., -1.);\n float c = 0.;\n if (p.y >= 0.)\n c = (1. - (fbm2((p + .2) * p.y + .1 * iTime)).x) * p.y;\n else\n c = (1. - (fbm2(p + .2 + .1 * iTime)).x) * p.y * p.y;\n vec3 col = vec3(0.);\n vec3 col1 = c * vec3(.3, .5, 1.);\n float mdist = 100000.;\n float t = hash(floor(5. * iTime));\n tgt += 4. * hash2(tgt + t) - 1.5;\n if (hash(t + 2.3) > .6)\n for (int i = 0; i < 100; i++) {\n vec2 dtgt = tgt - p;\n d = .05 * (vec2(-.5, -1.) + hash2(vec2(float(i), t)));\n float dist = dseg(d, dtgt);\n mdist = min(mdist, dist);\n tgt -= d;\n c = exp(-1.2 * dist) + exp(-55. * mdist);\n col = c * vec3(.7, .8, 1.);\n }\n col += col1;\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(col, 0.0), mixFactor);\n}\n ",uniforms:{mixFactor:()=>e.mixFactor||.1,fallInterval:()=>e.fallInterval||.8}}));n.selected=[];return{stage:n,remove:()=>{e.viewer.scene.postProcessStages.remove(n)}}},C=e=>new i({vertexShaderText:_,fragmentShaderText:y,uniforms:{maxValue:{type:l.FLOAT,value:e.maxValue||0},minValue:{type:l.FLOAT,value:e.minValue||1},uColor:{type:l.VEC4,value:e.color||n.PURPLE},speed:{type:l.FLOAT,value:e.speed||2},lineWidth:{type:l.FLOAT,value:e.lineWidth||1}}}),_="\n void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) {\n vsOutput.positionMC += 0.1 * vsInput.attributes.normalMC;\n }\n",y="\n void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material){\n float _baseHeight = minValue; // 物体的基础高度,需要修改成一个合适的建筑基础高度\n float _heightRange = maxValue / 3.0; // 高亮的范围(_baseHeight ~ _baseHeight + _heightRange) 默认是 0-60米\n float _glowRange = maxValue; // 光环的移动范围(高度)\n\n // 建筑基础色\n float vtxf_height = fsInput.attributes.positionMC.z - _baseHeight;\n float vtxf_a11 = fract(czm_frameNumber / 120.0) * 3.14159265 * 2.0;\n float vtxf_a12 = vtxf_height / _heightRange + sin(vtxf_a11) * 0.1;\n material.diffuse *= vec3(vtxf_a12, vtxf_a12, vtxf_a12);\n material.diffuse *= vec3(uColor.r,uColor.g,uColor.b);\n\n // 动态光环\n float vtxf_a13 = fract(czm_frameNumber / (360.0 * speed));\n float vtxf_h = clamp(vtxf_height / _glowRange, 0.0, 1.0);\n vtxf_a13 = abs(vtxf_a13 - 0.5) * 2.0;\n float vtxf_diff = step(lineWidth / 200.0, abs(vtxf_h - vtxf_a13));\n material.diffuse += material.diffuse * (1.0 - vtxf_diff);\n material.alpha = uColor.a;\n }\n",z=e=>new i({fragmentShaderText:w,uniforms:{color:{type:l.VEC4,value:e.color||n.PURPLE}}}),w="\n void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {\n vec4 originColor = vec4(material.diffuse,1.0);\n material.diffuse = vec3(mix(originColor,color,0.3));\n material.alpha = 0.8;\n }\n",S=e=>{const o=e.scene.postProcessStages.add(t.createSilhouetteStage());o.uniforms.color=n.YELLOW,o.selected=[];return{stage:o,remove:()=>{}}};export{p as createBloomTargetStage,z as createDroneAnimCustomShader,m as createFogStage,f as createHeightFogStage,s as createHighLightStage,C as createLightBandCustomShader,h as createLightningStage,S as createOutLineEffect,u as createOutlineStage,g as createRainCoverStage,x as createRainStage,c as createSkylineStage,d as createSnowCoverStage,v as createSnowStage};
1
+ import*as e from"cesium";const n=(n,o=e.Color.YELLOW)=>{const t=n.scene.postProcessStages.add(new e.PostProcessStage({fragmentShader:"\n uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n uniform vec4 highlight;\n void main() {\n vec4 color = texture(colorTexture, v_textureCoordinates);\n if (czm_selected()) {\n vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n out_FragColor = mix(color, vec4(highlighted,0.5), 0.3);\n } else {\n out_FragColor = color;\n }\n }\n ",uniforms:{highlight:()=>o}}));t.selected=[];return{stage:t,remove:()=>{n.scene.postProcessStages.remove(t)}}},o=n=>{const o=e.PostProcessStageLibrary.createEdgeDetectionStage(),t=new e.PostProcessStage({name:"skyline",fragmentShader:"\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n in vec2 v_textureCoordinates;\n void main() { float depth = czm_readDepth(depthTexture, v_textureCoordinates);\n vec4 color = texture(colorTexture, v_textureCoordinates);\n if (depth < 1.0 - 0.000001) {\n out_FragColor = color;\n } else {\n out_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n }\n }"}),r=new e.PostProcessStage({name:"mix",fragmentShader:"\n uniform sampler2D colorTexture;\n uniform sampler2D redTexture;\n uniform sampler2D silhouetteTexture;\n in vec2 v_textureCoordinates;\n\n void main() {\n vec4 redColor = texture(redTexture, v_textureCoordinates);\n vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates);\n vec4 color = texture(colorTexture, v_textureCoordinates);\n if (redColor.r == 1.0) {\n out_FragColor = mix(color, vec4(5.0, 0.0, 0.0, 1.0), silhouetteColor.a);\n } else {\n out_FragColor = color;\n }\n }",uniforms:{redTexture:t.name,silhouetteTexture:o.name}}),a=new e.PostProcessStageComposite({stages:[o,t,r],inputPreviousStageTexture:!1,uniforms:o.uniforms});n.scene.postProcessStages.add(a);return{stage:a,remove:()=>{n.scene.postProcessStages.remove(a)}}},t=(n,o=e.Color.YELLOW)=>{const t=n.scene.postProcessStages,r=e.PostProcessStageLibrary.createEdgeDetectionStage();r.uniforms.color=o,r.uniforms.length=1,r.selected=[];const a=e.PostProcessStageLibrary.createEdgeDetectionStage();a.uniforms.color=o,a.selected=[];const i=t.add(e.PostProcessStageLibrary.createSilhouetteStage([r,a]));i.selected=[];return{stage:i,remove:()=>{n.scene.postProcessStages.remove(i)}}},r=n=>{const o=n.viewer,t=new e.PostProcessStage({name:"SnowEffectCover",fragmentShader:"\n vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth)\n {\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);\n return eyeCoordinate.xyz / eyeCoordinate.w;\n }\n vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset, sampler2D depthMap) {\n vec2 glFragCoordXY = gl_FragCoord.xy;\n float upOrRightLogDepth = czm_unpackDepth(texture(depthMap, (glFragCoordXY + positiveOffset) / czm_viewport.zw));\n float downOrLeftLogDepth = czm_unpackDepth(texture(depthMap, (glFragCoordXY - positiveOffset) / czm_viewport.zw));\n bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);\n\n float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);\n float useDownOrLeft = float(useUpOrRight == 0.0);\n vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);\n vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);\n return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;\n }\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n uniform float intensity;\n in vec2 v_textureCoordinates;\n void main(void)\n {\n vec4 sceneColor = texture(colorTexture, v_textureCoordinates);\n\n float logDepthOrDepth = czm_unpackDepth(texture(depthTexture, v_textureCoordinates));\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;\n vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\n vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0), depthTexture);\n vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0), depthTexture);\n vec3 normalEC = normalize(cross(leftRight, downUp));\n vec3 normalMC = normalize((czm_inverseView * vec4(normalEC, 0.0)).xyz);\n vec3 ellipsoidNormal = normalize(worldCoordinate);\n float dotProd = dot(ellipsoidNormal, normalMC);\n if(dotProd < 0.3){\n out_FragColor = sceneColor;\n } else {\n out_FragColor = mix(sceneColor, vec4(1.0), dotProd * intensity);\n }\n if (czm_selected()) {\n out_FragColor = sceneColor;\n }\n }\n ",forcePowerOfTwo:!1,textureScale:1,uniforms:{intensity:()=>n.intensity||.8}});o.scene.postProcessStages.add(t);return t.selected=[],{stage:t,remove:()=>{o.scene.postProcessStages.remove(t)}}},a=n=>{const o=n.viewer,t=o.scene.postProcessStages.add(new e.PostProcessStage({fragmentShader:"\n uniform sampler2D colorTexture; //输入的场景渲染照片\n in vec2 v_textureCoordinates;\n uniform float speed;\n uniform float scale;\n\n float snow(vec2 uv, float thisScale) {\n float time = czm_frameNumber * speed / 1000.0;\n float wMars3D = smoothstep(1.0, 0.0, -uv.y * (thisScale / 10.0));\n if(wMars3D < 0.1)\n return 0.0;\n uv += time / thisScale;\n uv.y += time * 2.0 / thisScale;\n uv.x += sin(uv.y + time * 0.5) / thisScale;\n uv *= thisScale;\n\n vec2 s = floor(uv), f = fract(uv), p;\n float k = 3.0, d;\n p = 0.5 + 0.35 * sin(11.0 * fract(sin((s + p + thisScale) * mat2(7, 3, 6, 5)) * 5.0)) - f;\n d = length(p);\n k = min(d, k);\n k = smoothstep(0.0, k, sin(f.x + f.y) * 0.01);\n return k * wMars3D;\n }\n void main(void) {\n vec2 resolution = czm_viewport.zw;\n vec2 uv = (gl_FragCoord.xy * 2. - resolution.xy) / min(resolution.x, resolution.y);\n\n float c = 0.0;\n float step = 1.0/(scale*0.1);\n for(float i = 1.0; i < 12.0; i += 1.0) {\n c += snow(uv, i*step);\n }\n vec3 finalColor = vec3(c); //屏幕上雪的颜色\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor, 1.0), 0.5); //将雪和三维场景融合\n }",uniforms:{scale:()=>n.scale||5,speed:()=>n.speed||16}}));t.selected=[];return{stage:t,remove:()=>{o.scene.postProcessStages.remove(t)}}},i=n=>{const o=n.viewer.scene.postProcessStages.add(new e.PostProcessStage({fragmentShader:"\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n uniform float alpha;\n uniform float height;\n uniform vec3 oneOverRadii;\n uniform vec3 oneOverRadiiSquared;\n uniform float centerToleranceSquared;\n uniform float EPSILON12;\n uniform float earthRadius;\n\n in vec2 v_textureCoordinates;\n out vec4 glColor;\n\n vec4 toEye(in vec2 uv, in float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\n float getDepth(in vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n }\n\n\n vec3 getWorldCoordinateFromDepth(in vec4 currD){\n float depth = czm_unpackDepth(currD);\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);\n vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;\n vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\n return worldCoordinate;\n }\n\n float magnitude(in vec3 v){\n return sqrt(v.x * v.x + v.y * v.y + v.z * v.z);\n }\n\n // 沿大地表面法线缩放提供的笛卡尔位置,使其位于该椭球体的表面上\n vec3 scaleToGeodeticSurface(in vec3 cartesian){\n float positionX = cartesian.x;\n float positionY = cartesian.y;\n float positionZ = cartesian.z;\n float x2 = cartesian.x * cartesian.x * oneOverRadii.x * oneOverRadii.x;\n float y2 = cartesian.y * cartesian.y * oneOverRadii.y * oneOverRadii.y;\n float z2 = cartesian.z * cartesian.z * oneOverRadii.z * oneOverRadii.z;\n\n float squaredNorm = x2 + y2 + z2;\n float ratio = sqrt(1.0 / squaredNorm);\n vec3 intersection = cartesian * ratio;\n\n float oneOverRadiiSquaredX = oneOverRadiiSquared.x;\n float oneOverRadiiSquaredY = oneOverRadiiSquared.y;\n float oneOverRadiiSquaredZ = oneOverRadiiSquared.z;\n\n vec3 gradient = vec3(intersection.x * oneOverRadiiSquaredX * 2.0,intersection.y * oneOverRadiiSquaredY * 2.0,intersection.z * oneOverRadiiSquaredZ * 2.0);\n\n float lambda = ((1.0 - ratio) * magnitude(cartesian) ) / (0.5 * magnitude(gradient));\n float correction = 0.0;\n float func = 0.0;\n float denominator = 0.0;\n float xMultiplier = 0.0;\n float yMultiplier = 0.0;\n float zMultiplier = 0.0;\n float xMultiplier2 = 0.0;\n float yMultiplier2 = 0.0;\n float zMultiplier2 = 0.0;\n float xMultiplier3 = 0.0;\n float yMultiplier3 = 0.0;\n float zMultiplier3 = 0.0;\n do {\n lambda -= correction;\n\n xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX);\n yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY);\n zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ);\n\n xMultiplier2 = xMultiplier * xMultiplier;\n yMultiplier2 = yMultiplier * yMultiplier;\n zMultiplier2 = zMultiplier * zMultiplier;\n\n xMultiplier3 = xMultiplier2 * xMultiplier;\n yMultiplier3 = yMultiplier2 * yMultiplier;\n zMultiplier3 = zMultiplier2 * zMultiplier;\n\n float func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0;\n\n float denominator =\n x2 * xMultiplier3 * oneOverRadiiSquaredX +\n y2 * yMultiplier3 * oneOverRadiiSquaredY +\n z2 * zMultiplier3 * oneOverRadiiSquaredZ;\n\n float derivative = -2.0 * denominator;\n\n correction = func / derivative;\n } while (abs(func) > EPSILON12);\n return vec3(positionX * xMultiplier, positionY * yMultiplier, positionZ * zMultiplier);\n }\n\n vec3 multiplyComponents(in vec3 left,in vec3 right){\n return vec3(left.x * right.x, left.y * right.y, left.z * right.z);\n }\n\n\n // 将世界坐标转为经纬度高度\n vec3 getCartographicFromCartesian3(in vec3 cartesian){\n vec3 p = scaleToGeodeticSurface(cartesian);\n vec3 n = multiplyComponents(p,oneOverRadiiSquared);\n n = normalize(n);\n vec3 h = cartesian - p;\n\n float longitude = atan(n.y, n.x);\n float latitude = asin(n.z);\n float height = sign(dot(h, cartesian)) * magnitude(h);\n\n return vec3(longitude,latitude,height);\n }\n\n // 计算每个像素点的高度 通过计算相机所在位置的地球半径作为每个点的地球半径,然后用每个点的length减去半径得到近似的高度\n float getHeight(in vec4 currD){\n // 传入每个点的世界坐标\n float altitude = 0.0;\n float depth = czm_unpackDepth(currD);\n if (depth == 0.0) {\n altitude = czm_infinity;\n }\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);\n float distance = -eyeCoordinate.z / eyeCoordinate.w;\n vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;\n vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\n altitude = length(worldCoordinate.xyz) - earthRadius;\n return altitude;\n }\n\n void main(){\n vec4 color = texture(colorTexture, v_textureCoordinates);\n vec4 currD = texture(depthTexture, v_textureCoordinates);\n if(currD.r>=1.0){\n glColor = color;\n return;\n }\n // 此方法有问题 会闪烁\n float depth = getDepth(currD);\n vec4 positionEC = toEye(v_textureCoordinates, depth);\n vec4 positionWC = czm_inverseView * positionEC;\n // 获取当前点的高度\n // vec3 positionWC = getWorldCoordinateFromDepth(currD);\n vec3 cartographic = getCartographicFromCartesian3(vec3(positionWC.x,positionWC.y,positionWC.z));\n // 高度加了10之后 就不闪烁了\n float pointHeight = cartographic.z + 10.;\n // 当前点高度越高,雾浓度越小,高度达到设定高度,雾浓度为0,同时乘以深度,距离越远,浓度越大\n float fog = (height/pointHeight - 1.);\n fog = clamp(fog, 0.0, 1.0);\n glColor = mix(color,vec4(1.0,1.,1.,1),fog*alpha);\n }",uniforms:{EPSILON12:()=>n.EPSILON12||1e-12,alpha:()=>n.alpha||.88,centerToleranceSquared:()=>n.centerToleranceSquared||.1,height:()=>n.height||100,oneOverRadii:()=>n.oneOverRadii||{x:1.567855942887398e-7,y:1.567855942887398e-7,z:1.573130351105623e-7},oneOverRadiiSquared:()=>n.oneOverRadiiSquared||{x:2458172257647332e-29,y:2458172257647332e-29,z:24747391015697002e-30}}}));o.selected=[];return{stage:o,remove:()=>{n.viewer.scene.postProcessStages.remove(o)}}},s=n=>{const o=n.viewer.scene.postProcessStages.add(new e.PostProcessStage({fragmentShader:"\nfloat getDistance(sampler2D depthTexture, vec2 texCoords) {\n float depth = czm_unpackDepth(texture(depthTexture, texCoords));\n if(depth == 0.0) {\n return czm_infinity;\n }\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);\n return -eyeCoordinate.z / eyeCoordinate.w;\n}\nfloat interpolateByDistanceMars3D(vec4 nearFarScalar, float distance) {\n float startDistance = nearFarScalar.x;\n float startValue = nearFarScalar.y;\n float endDistance = nearFarScalar.z;\n float endValue = nearFarScalar.w;\n float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);\n return mix(startValue, endValue, t);\n}\nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) {\n return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);\n}\nuniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nuniform vec4 fogByDistance;\nuniform vec4 fogColor;\nin vec2 v_textureCoordinates;\nvoid main(void) {\n float distance = getDistance(depthTexture, v_textureCoordinates);\n vec4 sceneColor = texture(colorTexture, v_textureCoordinates);\n float blendAmount = interpolateByDistanceMars3D(fogByDistance, distance);\n vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);\n out_FragColor = alphaBlend(finalFogColor, sceneColor);\n}\n ",uniforms:{fogColor:()=>n.fogColor||e.Color.WHITE,fogByDistance:()=>n.fogByDistance||new e.Cartesian4(100,0,9e3,.9)}}));o.selected=[];return{stage:o,remove:()=>{n.viewer.scene.postProcessStages.remove(o)}}},l=n=>{const o=new e.PostProcessStageComposite({name:"undefinedcontrast_bias_blur",stages:[new e.PostProcessStage({name:"undefinedcontrast_bias",fragmentShader:"\n uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n uniform float contrast;\n uniform float brightness;\n void main(void)\n {\n vec4 texture1 = texture(colorTexture, v_textureCoordinates);\n vec3 sceneColor = texture1.rgb;\n\n sceneColor = czm_RGBToHSB(sceneColor);\n sceneColor.z += brightness;\n sceneColor = czm_HSBToRGB(sceneColor);\n float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));\n sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);\n out_FragColor = vec4(sceneColor, texture1.a);\n }\n ",uniforms:{contrast:()=>128,brightness:()=>-.3}}),new e.PostProcessStageComposite({name:"undefined_blur_comp",stages:[new e.PostProcessStage({name:"undefinedhigh",fragmentShader:"\n uniform sampler2D colorTexture;\n uniform float threshold;\n uniform float smoothWidth;\n\n in vec2 v_textureCoordinates;\n void main() {\n vec4 marstexel = texture( colorTexture, v_textureCoordinates );\n\n #ifdef CZM_SELECTED_FEATURE\n if (!czm_selected()) {\n marstexel = vec4(0.);\n }\n #endif\n\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\n float marsv = dot( marstexel.xyz, luma );\n float alpha = smoothstep(threshold, threshold + smoothWidth, marsv);\n\n vec4 outputColor = vec4(0.0,0.0,0.0,0.0);\n out_FragColor = mix( outputColor, marstexel, alpha );\n }\n ",uniforms:{threshold:()=>0,smoothWidth:()=>.01}})]})]}),t=n.scene.postProcessStages.add(new e.PostProcessStageComposite({name:"bloom_target",inputPreviousStageTexture:!1,stages:[o,new e.PostProcessStage({name:"undefinedgenerate_composite",fragmentShader:"\n uniform sampler2D colorTexture;\n uniform sampler2D bloomTexture;\n uniform float ratio;\n uniform vec4 color;\n in vec2 v_textureCoordinates;\n void main(void)\n {\n vec4 color1 = texture(colorTexture, v_textureCoordinates);\n vec4 bloom = texture(bloomTexture, v_textureCoordinates);\n bloom *= color;\n if (czm_selected()) {\n bloom *= ratio;\n out_FragColor = bloom + color1;\n } else {\n out_FragColor = color1;\n }\n }\n ",uniforms:{bloomTexture:()=>"undefinedcontrast_bias_blur",color:()=>e.Color.GREEN,ratio:()=>2}})]}));t.enabled=!1;return t.selected=[],{stage:t,remove:()=>{n.scene.postProcessStages.remove(t)}}},c=n=>{const o=n.viewer.scene.postProcessStages.add(new e.PostProcessStage({fragmentShader:"\n uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n uniform float speed;\n uniform float size;\n uniform float direction;\n\n float hash(float x) {\n return fract(sin(x * 133.3) * 13.13);\n }\n\n void main(void) {\n\n float time = czm_frameNumber * speed / 1000.0;\n vec2 resolution = czm_viewport.zw;\n\n vec2 uv = (gl_FragCoord.xy * 2. - resolution.xy) / min(resolution.x, resolution.y);\n vec3 finalColor = vec3(.6, .7, .8);//粒子的颜色\n\n float siMars3D = sin(direction), co = cos(direction);\n uv *= mat2(co, -siMars3D, siMars3D, co);\n uv *= length(uv + vec2(0, 4.9))*(20.0/size) + 1.0;\n\n float v = 1. - sin(hash(floor(uv.x * 100.0)) * 2.0);\n float b = clamp(abs(sin(20.0 * time * v + uv.y * (5. / (2.0 + v)))) - .95, 0.0, 1.0) * 20.0;\n finalColor *= v * b; //屏幕上雨的颜色\n\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor, 1.0), 0.5); //将雨和三维场景融合\n }\n ",uniforms:{speed:()=>n.speed||16,size:()=>n.size||20,direction:()=>360+(n.direction||30)}}));o.selected=[];return{stage:o,remove:()=>{n.viewer.scene.postProcessStages.remove(o)}}},u=n=>{const o=n.viewer,t=new e.PostProcessStage({fragmentShader:"\n#extension GL_OES_standard_derivatives:enable\nuniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nin vec2 v_textureCoordinates;\nvec4 toEye(in vec2 uv, in float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n}\nfloat getDepth(in vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\nvec3 guussColor(vec2 uv){\n vec2 pixelSize = 1.0 / czm_viewport.zw;\n float dx0 = -pixelSize.x;\n float dy0 = -pixelSize.y;\n float dx1 = pixelSize.x;\n float dy1 = pixelSize.y;\n vec4 gc = (\n texture(colorTexture, uv)+\n texture(colorTexture, uv + vec2(dx0, dy0)) +\n texture(colorTexture, uv + vec2(0.0, dy0)) +\n texture(colorTexture, uv + vec2(dx1, dy0)) +\n texture(colorTexture, uv + vec2(dx0, 0.0)) +\n texture(colorTexture, uv + vec2(dx1, 0.0)) +\n texture(colorTexture, uv + vec2(dx0, dy1)) +\n texture(colorTexture, uv + vec2(0.0, dy1)) +\n texture(colorTexture, uv + vec2(dx1, dy1))\n ) * (1.0 / 9.0);\n return gc.rgb;\n}\nvoid main(){\n float offset = 0.0;\n vec4 color = texture(colorTexture, v_textureCoordinates);\n vec4 currD = texture(depthTexture, v_textureCoordinates);\n if(currD.r>=1.0){\n out_FragColor = color;\n return;\n }\n float depth = getDepth(currD);\n\n vec4 positionEC = toEye(v_textureCoordinates, depth);\n vec3 dx = dFdx(positionEC.xyz);\n vec3 dy = dFdy(positionEC.xyz);\n vec3 normal = normalize(cross(dx,dy));\n\n vec4 positionWC = normalize(czm_inverseView * positionEC);\n vec3 normalWC = normalize(czm_inverseViewRotation * normal);\n float fotNumWC = dot(positionWC.xyz,normalWC);\n if(fotNumWC<=0.5){\n out_FragColor = color;\n return;\n }\n\n vec3 viewDir = normalize(positionEC.xyz);\n vec3 reflectDir = reflect(viewDir, normal);\n vec3 viewReflectDir = reflectDir;\n\n float step = 0.05;\n int stepNum = int(20.0 / step);\n vec3 pos;\n vec3 albedo;\n bool jd = false;\n for(int i = 1;i <= 400;i++)\n {\n float delta = step * float(i) + offset;\n pos = positionEC.xyz + viewReflectDir * delta;\n float d = -pos.z;\n\n vec4 tmp = czm_projection * vec4(pos,1.0);\n vec3 screenPos = tmp.xyz / tmp.w;\n vec2 uv = vec2(screenPos.x, screenPos.y) * 0.5 + vec2(0.5, 0.5);\n\n if(uv.x > 0.0 && uv.x < 1.0 && uv.y > 0.0 && uv.y < 1.0){\n float dd = getDepth(texture(depthTexture, uv));\n vec4 jzc = toEye(uv, dd);\n dd = -jzc.z;\n if(d>dd){\n if(abs(abs(d) - abs(dd)) <=step){\n jd = true;\n // albedo = texture(colorTexture, uv).rgb;\n albedo = guussColor(uv);\n }\n break;\n }\n }\n }\n if(jd){\n out_FragColor = vec4(mix(color.xyz,albedo,0.5),1.0);\n }else{\n out_FragColor = color;\n }\n}\n",uniforms:{}});o.scene.postProcessStages.add(t);return{stage:t,remove:()=>{o.scene.postProcessStages.remove(t)}}},d=n=>{const o=n.viewer.scene.postProcessStages.add(new e.PostProcessStage({fragmentShader:"\n float hash(float x)\n {\n return fract(21654.6512 * sin(385.51 * x));\n }\n float hash(vec2 p)\n {\n return fract(1654.65157 * sin(15.5134763 * p.x + 45.5173247 * p.y + 5.21789));\n }\n vec2 hash2(vec2 p)\n {\n return vec2(hash(p * .754), hash(1.5743 * p + 4.5476351));\n }\n vec2 add = vec2(1.0, 0.0);\n vec2 noise2(vec2 x)\n {\n vec2 p = floor(x);\n vec2 f = fract(x);\n f = f * f * (3.0 - 2.0 * f);\n vec2 res = mix(mix(hash2(p),\n hash2(p + add.xy), f.x),\n mix(hash2(p + add.yx), hash2(p + add.xx), f.x), f.y);\n return res;\n }\n vec2 fbm2(vec2 x)\n {\n vec2 r = vec2(0.0);\n float a = 1.0;\n for (int i = 0; i < 8; i++)\n {\n r += noise2(x) * a;\n x *= 2.;\n a *= .5;\n }\n return r;\n }\n float dseg(vec2 ba, vec2 pa)\n {\n float h = clamp(dot(pa, ba) / dot(ba, ba), -0.2, 1.);\n return length(pa - ba * h);\n }\n uniform sampler2D colorTexture;\n uniform float fallInterval;\n uniform float mixFactor;\n in vec2 v_textureCoordinates;\n void main(void){\n vec2 uv = gl_FragCoord.xy;\n float iTime = czm_frameNumber * fallInterval * clamp(fallInterval * 0.1, 0.01, 0.1);\n vec2 p = uv / czm_viewport.zw;\n vec2 d;\n vec2 tgt = vec2(1., -1.);\n float c = 0.;\n if (p.y >= 0.)\n c = (1. - (fbm2((p + .2) * p.y + .1 * iTime)).x) * p.y;\n else\n c = (1. - (fbm2(p + .2 + .1 * iTime)).x) * p.y * p.y;\n vec3 col = vec3(0.);\n vec3 col1 = c * vec3(.3, .5, 1.);\n float mdist = 100000.;\n float t = hash(floor(5. * iTime));\n tgt += 4. * hash2(tgt + t) - 1.5;\n if (hash(t + 2.3) > .6)\n for (int i = 0; i < 100; i++) {\n vec2 dtgt = tgt - p;\n d = .05 * (vec2(-.5, -1.) + hash2(vec2(float(i), t)));\n float dist = dseg(d, dtgt);\n mdist = min(mdist, dist);\n tgt -= d;\n c = exp(-1.2 * dist) + exp(-55. * mdist);\n col = c * vec3(.7, .8, 1.);\n }\n col += col1;\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(col, 0.0), mixFactor);\n}\n ",uniforms:{mixFactor:()=>n.mixFactor||.1,fallInterval:()=>n.fallInterval||.8}}));o.selected=[];return{stage:o,remove:()=>{n.viewer.scene.postProcessStages.remove(o)}}},v=n=>new e.CustomShader({vertexShaderText:f,fragmentShaderText:m,uniforms:{maxValue:{type:e.UniformType.FLOAT,value:n.maxValue||0},minValue:{type:e.UniformType.FLOAT,value:n.minValue||1},uColor:{type:e.UniformType.VEC4,value:n.color||e.Color.PURPLE},speed:{type:e.UniformType.FLOAT,value:n.speed||2},lineWidth:{type:e.UniformType.FLOAT,value:n.lineWidth||1}}}),f="\n void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) {\n vsOutput.positionMC += 0.1 * vsInput.attributes.normalMC;\n }\n",m="\n void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material){\n float _baseHeight = minValue; // 物体的基础高度,需要修改成一个合适的建筑基础高度\n float _heightRange = maxValue / 3.0; // 高亮的范围(_baseHeight ~ _baseHeight + _heightRange) 默认是 0-60米\n float _glowRange = maxValue; // 光环的移动范围(高度)\n\n // 建筑基础色\n float vtxf_height = fsInput.attributes.positionMC.z - _baseHeight;\n float vtxf_a11 = fract(czm_frameNumber / 120.0) * 3.14159265 * 2.0;\n float vtxf_a12 = vtxf_height / _heightRange + sin(vtxf_a11) * 0.1;\n material.diffuse *= vec3(vtxf_a12, vtxf_a12, vtxf_a12);\n material.diffuse *= vec3(uColor.r,uColor.g,uColor.b);\n\n // 动态光环\n float vtxf_a13 = fract(czm_frameNumber / (360.0 * speed));\n float vtxf_h = clamp(vtxf_height / _glowRange, 0.0, 1.0);\n vtxf_a13 = abs(vtxf_a13 - 0.5) * 2.0;\n float vtxf_diff = step(lineWidth / 200.0, abs(vtxf_h - vtxf_a13));\n material.diffuse += material.diffuse * (1.0 - vtxf_diff);\n material.alpha = uColor.a;\n }\n",p=n=>new e.CustomShader({fragmentShaderText:g,uniforms:{color:{type:e.UniformType.VEC4,value:n.color||e.Color.PURPLE}}}),g="\n void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {\n vec4 originColor = vec4(material.diffuse,1.0);\n material.diffuse = vec3(mix(originColor,color,0.3));\n material.alpha = 0.8;\n }\n",x=n=>{const o=n.scene.postProcessStages.add(e.PostProcessStageLibrary.createSilhouetteStage());o.uniforms.color=e.Color.YELLOW,o.selected=[];return{stage:o,remove:()=>{}}};export{l as createBloomTargetStage,p as createDroneAnimCustomShader,s as createFogStage,i as createHeightFogStage,n as createHighLightStage,v as createLightBandCustomShader,d as createLightningStage,x as createOutLineEffect,t as createOutlineStage,u as createRainCoverStage,c as createRainStage,o as createSkylineStage,r as createSnowCoverStage,a as createSnowStage};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ino-cesium/effects",
3
3
  "type": "module",
4
- "version": "0.0.13",
4
+ "version": "0.0.15",
5
5
  "author": "koino",
6
6
  "keywords": [
7
7
  "cesium",
@@ -9,7 +9,7 @@
9
9
  "ino-cesium-effects"
10
10
  ],
11
11
  "exports": {
12
- ".": "./dist/index.js"
12
+ ".": "./src/index.ts"
13
13
  },
14
14
  "typesVersions": {
15
15
  "*": {
@@ -31,9 +31,8 @@
31
31
  "cesium": "*"
32
32
  },
33
33
  "dependencies": {
34
- "@ino-cesium/common": "0.0.13"
34
+ "@ino-cesium/common": "0.0.15"
35
35
  },
36
- "types": "./dist/index.d.ts",
37
36
  "scripts": {
38
37
  "build": "rimraf dist && rollup -c",
39
38
  "clean": "rimraf dist",