You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
2.7 KiB
9 lines
2.7 KiB
// All material copyright Esri, All Rights Reserved, unless otherwise specified. |
|
// See https://js.arcgis.com/4.30/esri/copyright.txt for details. |
|
//>>built |
|
define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/mathUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/ellipsoidUtils ./atmosphereUtils ../../../chunks/Fog.glsl ./FogTechnique ./weather ../webgl-engine/lib/DefaultVertexBufferLayouts ../webgl-engine/lib/glUtil3D ../../webgl/enums".split(" "), |
|
function(c,e,p,q,h,C,D,E,r,f,k,t,u,v,w,l,x,y,z){c.Fog=class extends p{constructor(a){super(a);this._passParameters=new v.FogPassParameters;this._vao=y.createQuadVAO(a.context.renderContext.rctx,x.Pos2Tex);this._technique=new w.FogTechnique(a);a=t.getReferenceEllipsoid(a.view.spatialReference);this._planetRadius=a.radius;this._atmosphereRadius=a.radius+u.atmosphereHeight}destroy(){this._technique.release();this._vao.dispose()}set strength(a){this._passParameters.fogStrength=a}get strength(){return this._passParameters.fogStrength}render(a, |
|
b){this._update(a,b);if(!(0>=this._passParameters.fogAmount)){var d=this._technique;if(d.compiled){var g=a.offscreenRenderingHelper;g.renderDepthDetached(()=>{this._passParameters.depthTexture=g.depthTexture;const A=a.rctx.bindTechnique(d,a.bindParameters,this._passParameters);this._renderFog(A,a)})}else this.context.requestRender()}}_renderFog(a,b){b=b.rctx;b.bindVAO(this._vao);a.assertCompatibleVertexAttributeLocations(this._vao);b.drawArrays(z.PrimitiveType.TRIANGLE_STRIP,0,4)}_update(a,b){var d= |
|
a.bindParameters.camera;f.normalize(m,d.eye);a=Math.max(0,f.dot(m,a.bindParameters.lighting.mainLight.direction));const g=b.color;f.scale(n,g,.1);f.lerp(this._passParameters.fogColor,n,g,a);d=f.length(d.eye);this._passParameters.atmosphereC=d*d-this._atmosphereRadius*this._atmosphereRadius;this._passParameters.fogAmount=(1-q.smoothstep(.95*l.weatherHeightLimit,1*l.weatherHeightLimit,Math.abs(d-this._planetRadius)))*b.amount;this._passParameters.fogStrength=b.strength}};e.__decorate([h.property({constructOnly:!0})], |
|
c.Fog.prototype,"context",void 0);e.__decorate([h.property({constructOnly:!0})],c.Fog.prototype,"view",void 0);e.__decorate([h.property({constructOnly:!0})],c.Fog.prototype,"rctx",void 0);e.__decorate([h.property({constructOnly:!0})],c.Fog.prototype,"viewingMode",void 0);c.Fog=e.__decorate([r.subclass("esri.views.3d.environment.Fog")],c.Fog);class B{constructor(){this.color=k.create();this.amount=this.strength=0}}const m=k.create(),n=k.create();c.FogParameters=B;Object.defineProperty(c,Symbol.toStringTag, |
|
{value:"Module"})}); |