@arcgis/core 5.2.0-next.44 → 5.2.0-next.46
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0e64e20fedfe01a1985f.js +1 -0
- package/assets/esri/core/workers/chunks/15351354afcbf840a23d.js +29 -0
- package/assets/esri/core/workers/chunks/2c0d92c0e3511775401a.js +29 -0
- package/assets/esri/core/workers/chunks/{f1f3fe9d2d96578f4f6b.js → 52efa4ded11c1e71f04f.js} +1 -1
- package/assets/esri/core/workers/chunks/{3252da57b800356116af.js → 68f7eaa3122de7c00adb.js} +1 -1
- package/assets/esri/core/workers/chunks/{e5c19e9b6fa53abdca8c.js → 728ea88e7d4733230e1f.js} +72 -73
- package/assets/esri/core/workers/chunks/{bac4d4a9f3a9b7f6864d.js → 744f34e379484e63277c.js} +2 -2
- package/assets/esri/core/workers/chunks/{fc880b275f5eaf42171e.js → 7777a79f26a06a6c5240.js} +1 -1
- package/assets/esri/core/workers/chunks/{76713b700e053f8bad29.js → 7c2784ebbe17d79f669c.js} +1 -1
- package/assets/esri/core/workers/chunks/{94cebc34e49da1e295ed.js → 8026cc0065f6520c4161.js} +1 -1
- package/assets/esri/core/workers/chunks/{3f4f1595c8a77d072b04.js → 85cd0cd721b27c497b18.js} +1 -1
- package/assets/esri/core/workers/chunks/{549295a5db9bf1536491.js → 8f9fb4e8a7d73db41664.js} +1 -1
- package/assets/esri/core/workers/chunks/{b3cefc1895bfd62fc440.js → 98f575c038da74ced2a6.js} +1 -1
- package/assets/esri/core/workers/chunks/{7684f0c771d312e05bb4.js → ad5c2b0de6713d0a93a4.js} +58 -58
- package/assets/esri/core/workers/chunks/{9b1199104a6822ab7340.js → ae9f9e975d7a9d442fa5.js} +1 -1
- package/assets/esri/core/workers/chunks/b3cd17daf5a297b96705.js +29 -0
- package/assets/esri/core/workers/chunks/{c316234837b7ca406b1c.js → c4b13124a9cfc78c42a6.js} +6 -6
- package/assets/esri/core/workers/chunks/c5e36544b2d1792e4c5f.js +1 -0
- package/assets/esri/core/workers/chunks/{04a167c110fb7811169d.js → cc637aec16918052548e.js} +1 -1
- package/assets/esri/core/workers/chunks/{0a0732ba8271d7dc985c.js → dee4019338a79c1ecd26.js} +1 -1
- package/assets/esri/core/workers/chunks/{96d5fed0235558c0e348.js → e9c48630757bea465b7e.js} +1 -1
- package/assets/esri/core/workers/chunks/{305ee2dd597c48a38e64.js → ed988360264574cd8f6b.js} +1 -1
- package/assets/esri/core/workers/chunks/{2974cddb0b0f67df7d2d.js → f2c8122d31aedc2604ee.js} +1 -1
- package/chunks/CutFillComposition.glsl.js +2 -2
- package/chunks/CutFillReduction.glsl.js +1 -1
- package/chunks/EmissionComposite.glsl.js +2 -0
- package/chunks/FocusAreaColor.glsl.js +1 -1
- package/chunks/Fog.glsl.js +20 -20
- package/chunks/GlobalIllumination.glsl.js +25 -25
- package/chunks/GlowBlur.glsl.js +16 -18
- package/chunks/GlowComposite.glsl.js +35 -0
- package/chunks/Laserline.glsl.js +13 -13
- package/chunks/LaserlinePath.glsl.js +11 -10
- package/chunks/Precipitation.glsl.js +6 -6
- package/chunks/ShadowCastVisualize.glsl.js +2 -2
- package/chunks/ShadowHighlight.glsl.js +3 -3
- package/chunks/Viewshed.glsl.js +3 -3
- package/config.js +1 -1
- package/core/screenUtils.js +1 -1
- package/core/types.d.ts +7 -0
- package/kernel.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/package.json +4 -4
- package/support/revision.js +1 -1
- package/views/3d/environment/CloudyWeather.js +1 -1
- package/views/3d/environment/FoggyWeather.js +1 -1
- package/views/3d/environment/RainyWeather.js +1 -1
- package/views/3d/environment/SnowyWeather.js +1 -1
- package/views/3d/environment/SunnyWeather.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
- package/views/3d/support/debugFlags.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/support/intersectionHitUtils.js +2 -0
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +12 -12
- package/views/3d/webgl-engine/collections/Component/UniformComponentParameters.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/output/getEmissions.glsl.js +8 -0
- package/views/3d/webgl-engine/core/shaderLibrary/util/blendEmission.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaVisualization.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowBlur.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowComposite.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/glow/GlowCompositeTechnique.js +2 -0
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/Laserline.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePath.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/precipitation/Precipitation.js +1 -1
- package/views/3d/webgl-engine/effects/precipitation/PrecipitationTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillComputation.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillVisualization.js +1 -1
- package/views/3d/webgl-engine/lib/EmissionComposite.glsl.js +2 -0
- package/views/3d/webgl-engine/lib/EmissionComposite.js +2 -0
- package/views/3d/webgl-engine/lib/EmissionCompositeTechnique.js +2 -0
- package/views/3d/webgl-engine/lib/HUDIntersectorResult.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/IntersectorResult.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/PolygonIntersectionResults.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/CutFillComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/EmissiveTechniqueConfiguration.js +2 -0
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
- package/views/SceneView.d.ts +4 -3
- package/views/SceneView.js +1 -1
- package/views/support/TextureCompressionWorker.js +1 -1
- package/views/support/TextureCompressionWorkerHandle.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/assets/esri/core/workers/chunks/5b937c405788fd14be8b.js +0 -30
- package/assets/esri/core/workers/chunks/8a01fe8d78ca85ea4784.js +0 -1
- package/assets/esri/core/workers/chunks/a38a7e3a5aa9294ab918.js +0 -30
- package/assets/esri/core/workers/chunks/b75db3b1becf8265ec59.js +0 -30
- package/assets/esri/core/workers/chunks/ca419858910af5505d3d.js +0 -1
- package/chunks/GlowComposition.glsl.js +0 -39
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +0 -9
- package/views/3d/webgl-engine/effects/fog/FogTechniqueConfiguration.js +0 -2
- package/views/3d/webgl-engine/effects/glow/GlowBlurTechniqueConfiguration.js +0 -2
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +0 -2
- package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +0 -2
- package/views/3d/webgl-engine/effects/glow/GlowCompositionTechniqueConfiguration.js +0 -2
- /package/assets/esri/core/workers/chunks/{bac4d4a9f3a9b7f6864d.js.LICENSE.txt → 744f34e379484e63277c.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{property as t,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as n}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeOutput as i}from"../../../webgl.js";import a from"../../../webgl/RenderNode.js";import{If as s,glsl as c}from"../../core/shaderModules/glsl.js";import{Pos2Locations as u}from"../../lib/DefaultVertexBufferLayouts.js";import{floatBlendReductionFactor as l}from"../../shaders/floatBlendScale.glsl.js";import{checkWebGLError as h}from"../../../../webgl/checkWebGLError.js";import{ColorAttachment0 as p,SizedPixelFormat as d,DataType as f}from"../../../../webgl/enums.js";let m=class extends a{constructor(e){super(e),this.destroyedCB=null,this.consumes={required:[i.FINAL]},this.produces=i.FINAL,this.clearColor=n,this._focusedFBOType=7,this._programs=new Map}destroy(){this._programs.clear(),this.destroyedCB()}render(){const e=this.input;if(!this._focusedTexture)return e;const r=this.renderingContext,t=r.boundFramebuffer;r.bindFramebuffer(e.fbo),r.setClearColor(0,0,0,0),r.clear(16384);const o=this._focusedTexture.attachment,n=[g(o)],i=this._ensureProgram(r,!1,n);return r.useProgram(i),r.bindTexture(o,0),i.setUniform1i("colorTex0",0),i.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&i.setUniform2fv("nearFar",this.camera.nearFar),r.setDrawBuffers([p]),r.screen.draw(),r.bindFramebuffer(t),e}getDownscaledFBO(e,r,t,o,n,i){if(n?.startsWith(`${r}\n`)??!1){const r=1/2**e.level;t=e.width*r,o=e.height*r}else i=null;const a="linear depth"===r||r.includes("shadow"),s="overlay highlight"===r||"highlights"===r||"highlight mix"===r,c="highlight coverage"===r,u=e.colorTexture?.descriptor,l=u?.internalFormat,f=[],m=new Array,v=new Array;e.colorAttachments.forEach((r,t)=>{const o=e.getColorTexture(r);if(o){const e=g(o);f.push(e);const{descriptor:r}=o;"float"!==e||r.hasMipmap||r.isImmutable||(o.generateMipmap(),m[t]=!0)}if(t>0){const e=o?.descriptor.internalFormat;return void(e===d.RGBA8&&(o?.debugName?.indexOf("emissive")??-1)>=0?v.push(8):v.push(T(e)))}v.push(a?0:s?1:c?2:i??T(l))});const x=this.renderingContext,{depthStencilTexture:$}=e,b=this._ensureProgram(x,null!=$,f,e.level),C=this.fboCache.acquire(t,o,"fbo visualizer");x.useProgram(b);const R=x.boundFramebuffer;x.bindFramebuffer(C.fbo);const y=new Array;e.colorAttachments.forEach((r,t)=>{const o=`colorTex${t.toFixed()}`;x.bindTexture(e.getColorTexture(r),t),b.setUniform1i(o,t),t>0&&C.acquireColor(p+t,5,"fbo visualizer"),y.push(r)});const w=$?.descriptor.linearFilterDepth??!1;if($){const r=e.colorAttachments.length;$.setShadowFiltering(!1),x.bindTexture($,r),b.setUniform1i("depthTex",r);const t=p+r;t>p&&C.acquireColor(t,5,"fbo visualizer"),y.push(t)}x.gl.drawBuffers(y),h(x.gl);const B=x.getViewport();return x.setViewport(0,0,t,o),x.setClearColor(0,0,0,0),x.clear(16384),x.setBlendingEnabled(!0),x.setBlendFunction(1,771),b.setUniform1iv("inputTypes",v.length>0?v:[7]),b.setUniform2fv("nearFar",this.camera.nearFar),x.screen.draw(),h(x.gl),x.bindFramebuffer(R),x.setViewport(B.x,B.y,B.width,B.height),e.colorAttachments.forEach((t,o)=>{const i=e.getColorTexture(t);m[o]&&i?.clearMipmap(),n===F(r,e,t,!1)&&(this._focusedTexture?.release(),this._focusedTexture=C.getAttachment(t),this._focusedTexture?.retain(),this._focusedFBOType=9===v[o]?T(i?.descriptor.internalFormat):v[o])}),$&&$.setShadowFiltering(w),C}clearFocusedFBO(){this._focusedTexture=r(this._focusedTexture)}getPreviewContent(e,r,t,o){const n=this.renderingContext,i=o.includes("\ndepth"),a=this.fboCache.acquire(e,r,"fbo visualizer"),s=n.boundFramebuffer;n.bindFramebuffer(a?.fbo);const c=n.getViewport();n.setViewport(0,0,e,r),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(16384),n.setBlendingEnabled(!0),n.setBlendFunction(1,771);const u=t.attachment,l=this._ensureProgram(n,!1,[g(u)]);n.useProgram(l),n.bindTexture(u,0),l.setUniform1i("colorTex0",0),l.setUniform1iv("inputTypes",[i||u.descriptor.internalFormat!==d.RGBA16F?7:5]),n.screen.draw();const p=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,6408,f.UNSIGNED_BYTE,new Uint8Array(p.data.buffer)),h(n.gl),n.bindFramebuffer(s),n.setViewport(c.x,c.y,c.width,c.height),a?.release(),p}_ensureProgram(e,r,t,o=0){const n=x({hasDepthAttachment:r,colorSamplerTypes:t,level:o}),i=this._programs.get(n);if(i)return i;const a="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",h=e=>{let r="";for(let t=0;t<e.length;++t){const o=e[t];r+=`layout(location = ${c.int(t)}) out vec4 fragColor${c.int(t)};\n uniform ${v(o)} colorTex${c.int(t)};`}return r},p=e=>e.reduce((e,r,t)=>e+`{\n int inputType = inputTypes[${t}];\n if (inputType == ${3..toFixed()}) {\n fragColor${t} = vec4(vec3(readTexture(colorTex${t}, uv, ${o}).r), 1.0);\n } else if (inputType == ${4..toFixed()}) {\n fragColor${t} = vec4(readTexture(colorTex${t}, uv, ${o}).rg, 0.0, 1.0);\n } else if (inputType == ${(0).toFixed()}) {\n float depth = 1.0 - ((-linearDepthFromTexture(colorTex${t}, uv) - nearFar[0]) / (nearFar[1] - nearFar[0]));\n fragColor${t} = vec4(vec3(depth), depth >= 0.999 ? 0.0 : 1.0);\n } else if (inputType == ${5..toFixed()}) {\n fragColor${t} = vec4(readTexture(colorTex${t}, uv, ${o}).rgb, 1.0);\n } else if (inputType == ${1..toFixed()}) {\n fragColor${t} = vec4(readTexture(colorTex${t}, uv, ${o})) * 255.0;\n fragColor${t} = vec4(fragColor${t}.rgb / fragColor${t}.a, fragColor${t}.a);\n } else if(inputType == ${2..toFixed()}) {\n vec2 texDim = vec2(textureSize(colorTex${t}, 0));\n ivec2 iuv = ivec2(uv * texDim);\n uvec2 hh = uvec2(texelFetch(colorTex${t}, iuv, 0).rg);\n fragColor${t} = vec4(\n ((hh & uvec2(0x55u)) != uvec2(0u)) ? 1.0 : 0.0,\n ((hh & uvec2(0xaau)) != uvec2(0u)) ? 1.0 : 0.0,\n 0.0,\n 1.0);\n } else if(inputType == ${8..toFixed()}) {\n fragColor${t} = vec4(readTexture(colorTex${t}, uv, ${o}));\n fragColor${t}.rgb *= ${l.toFixed(1)};\n } else if (inputType == ${9..toFixed()}) {\n fragColor${t} = vec4(vec3(readTexture(colorTex${t}, uv, ${o}).a), 1.0);\n } else {\n fragColor${t} = vec4(readTexture(colorTex${t}, uv, ${o}));\n }\n }`,""),d=t.length,f=`#version 300 es\n precision highp float;\n precision highp usampler2D;\n\n in vec2 uv;\n ${h(t)}\n ${s(r,`layout(location = ${c.int(d)}) out vec4 fragDepth;\n uniform sampler2D depthTex;`)}\n\n uniform int inputTypes[${t.length||1}];\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaToFloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaToFloat(depth));\n }\n\n vec4 readTexture(sampler2D tex, vec2 uv, int lod) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(tex, lod)));\n return texelFetch(tex, iuv, lod);\n }\n\n ${"float"===t[0]?"float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }":"float linearDepthFromTexture(usampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(vec4(texelFetch(depthTex, iuv, 0)) * 255.0);\n }"}\n\n void main() {\n ${p(t)}\n ${s(r,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n }`,m=e.programCache.get(a,f,u);return this._programs.set(n,m),m}};function v(e){switch(e){case"float":return"sampler2D";case"uint":return"usampler2D";case"int":return"isampler2D"}}function g(e){if(!e)return"float";const{internalFormat:r}=e.descriptor;switch(r){case d.R8I:case d.R16I:case d.R32I:case d.RG8I:case d.RG16I:case d.RG32I:case d.RGB8I:case d.RGB16I:case d.RGB32I:case d.RGBA8I:case d.RGBA16I:case d.RGBA32I:return"int";case d.R8UI:case d.R16UI:case d.R32UI:case d.RG8UI:case d.RG16UI:case d.RG32UI:case d.RGB8UI:case d.RGB16UI:case d.RGB32UI:case d.RGBA8UI:case d.RGBA16UI:case d.RGBA32UI:return"uint";default:return"float"}}function x(e){const{hasDepthAttachment:r,colorSamplerTypes:t,level:o}=e;return`${r?"Depth":""}${t.reduceRight((e,r)=>e+`|C${r}`,"")} ${o}`}function T(e){switch(e){case d.R16F:case d.R32F:case d.R8:return 3;case d.RG8:return 4;case d.RGBA16F:return 5;case d.RG8UI:return 6;default:return 7}}function F(e,r,t,o){return o?`${e}\ndepth`:`${e}\n${$(r,t)}`}function $(e,r){return`${e.getColorTexture(r)?.debugName??"color"+(r-p)}`}e([t()],m.prototype,"destroyedCB",void 0),e([t()],m.prototype,"consumes",void 0),e([t()],m.prototype,"produces",void 0),e([t()],m.prototype,"clearColor",void 0),m=e([o("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],m);export{m as RenderNodeVisualizerNode,F as getAttachmentName};
|
|
2
|
+
import{__decorate as e}from"tslib";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{property as t,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as n}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeOutput as i}from"../../../webgl.js";import s from"../../../webgl/RenderNode.js";import{If as a,glsl as c}from"../../core/shaderModules/glsl.js";import{Pos2Locations as l}from"../../lib/DefaultVertexBufferLayouts.js";import{floatBlendReductionFactor as u}from"../../shaders/floatBlendScale.glsl.js";import{checkWebGLError as h}from"../../../../webgl/checkWebGLError.js";import{ColorAttachment0 as p,SizedPixelFormat as d,DataType as f}from"../../../../webgl/enums.js";let m=class extends s{constructor(e){super(e),this.destroyedCB=null,this.consumes={required:[i.FINAL]},this.produces=i.FINAL,this.clearColor=n,this._focusedFBOType=7,this._programs=new Map}destroy(){this._programs.clear(),this.destroyedCB()}render(){const e=this.input;if(!this._focusedTexture)return e;const r=this.renderingContext,t=r.boundFramebuffer;r.bindFramebuffer(e.fbo),r.setClearColor(0,0,0,0),r.clear(16384);const o=this._focusedTexture.attachment,n=[g(o)],i=this._ensureProgram(r,!1,n);return r.useProgram(i),r.bindTexture(o,0),i.setUniform1i("colorTex0",0),i.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&i.setUniform2fv("nearFar",this.camera.nearFar),r.setDrawBuffers([p]),r.screen.draw(),r.bindFramebuffer(t),e}getDownscaledFBO(e,r,t,o,n,i){if(n?.startsWith(`${r}\n`)??!1){const r=1/2**e.level;t=e.width*r,o=e.height*r}else i=null;const s="linear depth"===r||r.includes("shadow"),a="overlay highlight"===r||"highlights"===r||"highlight mix"===r,c="highlight coverage"===r,l=e.colorTexture?.descriptor,u=l?.internalFormat,f=[],m=new Array,v=new Array;e.colorAttachments.forEach((r,t)=>{const o=e.getColorTexture(r);if(o){const e=g(o);f.push(e);const{descriptor:r}=o;"float"!==e||r.hasMipmap||r.isImmutable||(o.generateMipmap(),m[t]=!0)}if(t>0){const e=o?.descriptor.internalFormat;return void(e===d.RGBA8&&(o?.debugName?.indexOf("emissive")??-1)>=0?v.push(8):v.push(T(e)))}v.push(s?0:a?1:c?2:i??T(u))});const x=this.renderingContext,{depthStencilTexture:$}=e,b=this._ensureProgram(x,null!=$,f,e.level),C=this.fboCache.acquire(t,o,"fbo visualizer");x.useProgram(b);const y=x.boundFramebuffer;x.bindFramebuffer(C.fbo);const R=new Array;e.colorAttachments.forEach((r,t)=>{const o=`colorTex${t.toFixed()}`;x.bindTexture(e.getColorTexture(r),t),b.setUniform1i(o,t),t>0&&C.acquireColor(p+t,5,"fbo visualizer"),R.push(r)});const w=$?.descriptor.linearFilterDepth??!1;if($){const r=e.colorAttachments.length;$.setShadowFiltering(!1),x.bindTexture($,r),b.setUniform1i("depthTex",r);const t=p+r;t>p&&C.acquireColor(t,5,"fbo visualizer"),R.push(t)}x.gl.drawBuffers(R),h(x.gl);const B=x.getViewport();return x.setViewport(0,0,t,o),x.setClearColor(0,0,0,0),x.clear(16384),x.setBlendingEnabled(!0),x.setBlendFunction(1,771),b.setUniform1iv("inputTypes",v.length>0?v:[7]),b.setUniform2fv("nearFar",this.camera.nearFar),x.screen.draw(),h(x.gl),x.bindFramebuffer(y),x.setViewport(B.x,B.y,B.width,B.height),e.colorAttachments.forEach((t,o)=>{const i=e.getColorTexture(t);m[o]&&i?.clearMipmap(),n===F(r,e,t,!1)&&(this._focusedTexture?.release(),this._focusedTexture=C.getAttachment(t),this._focusedTexture?.retain(),this._focusedFBOType=9===v[o]?T(i?.descriptor.internalFormat):v[o])}),$&&$.setShadowFiltering(w),C}clearFocusedFBO(){this._focusedTexture=r(this._focusedTexture)}getPreviewContent(e,r,t,o){const n=this.renderingContext,i=o.includes("\ndepth"),s=this.fboCache.acquire(e,r,"fbo visualizer"),a=n.boundFramebuffer;n.bindFramebuffer(s?.fbo);const c=n.getViewport();n.setViewport(0,0,e,r),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(16384),n.setBlendingEnabled(!0),n.setBlendFunction(1,771);const l=t.attachment,u=this._ensureProgram(n,!1,[g(l)]);n.useProgram(u),n.bindTexture(l,0),u.setUniform1i("colorTex0",0),u.setUniform1iv("inputTypes",[i||l.descriptor.internalFormat!==d.RGBA16F?7:5]),n.screen.draw();const p=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,6408,f.UNSIGNED_BYTE,new Uint8Array(p.data.buffer)),h(n.gl),n.bindFramebuffer(a),n.setViewport(c.x,c.y,c.width,c.height),s?.release(),p}_ensureProgram(e,r,t,o=0){const n=x({hasDepthAttachment:r,colorSamplerTypes:t,level:o}),i=this._programs.get(n);if(i)return i;const s="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",h=e=>{let r="";for(let t=0;t<e.length;++t){const o=e[t];r+=`layout(location = ${c.int(t)}) out vec4 fragColor${c.int(t)};\n uniform ${v(o)} colorTex${c.int(t)};`}return r},p=e=>e.reduce((e,r,t)=>e+`{\n int inputType = inputTypes[${t}];\n if (inputType == ${3..toFixed()}) {\n fragColor${t} = vec4(vec3(readTexture(colorTex${t}, uv, ${o}).r), 1.0);\n } else if (inputType == ${4..toFixed()}) {\n fragColor${t} = vec4(readTexture(colorTex${t}, uv, ${o}).rg, 0.0, 1.0);\n } else if (inputType == ${(0).toFixed()}) {\n float depth = 1.0 - ((-linearDepthFromTexture(colorTex${t}, uv) - nearFar[0]) / (nearFar[1] - nearFar[0]));\n fragColor${t} = vec4(vec3(depth), depth >= 0.999 ? 0.0 : 1.0);\n } else if (inputType == ${5..toFixed()}) {\n // Currently only emissive glow uses mipmap levels - and it doubles the energy on each level.\n // Correct this for display. In the future when there are other mipmaps implement this cleaner.\n fragColor${t} = vec4(readTexture(colorTex${t}, uv, ${o}).rgb / pow(2.0, ${o}.0), 1.0);\n } else if (inputType == ${1..toFixed()}) {\n fragColor${t} = vec4(readTexture(colorTex${t}, uv, ${o})) * 255.0;\n fragColor${t} = vec4(fragColor${t}.rgb / fragColor${t}.a, fragColor${t}.a);\n } else if(inputType == ${2..toFixed()}) {\n vec2 texDim = vec2(textureSize(colorTex${t}, 0));\n ivec2 iuv = ivec2(uv * texDim);\n uvec2 hh = uvec2(texelFetch(colorTex${t}, iuv, 0).rg);\n fragColor${t} = vec4(\n ((hh & uvec2(0x55u)) != uvec2(0u)) ? 1.0 : 0.0,\n ((hh & uvec2(0xaau)) != uvec2(0u)) ? 1.0 : 0.0,\n 0.0,\n 1.0);\n } else if(inputType == ${8..toFixed()}) {\n fragColor${t} = vec4(readTexture(colorTex${t}, uv, ${o}));\n fragColor${t}.rgb *= ${u.toFixed(1)};\n } else if (inputType == ${9..toFixed()}) {\n fragColor${t} = vec4(vec3(readTexture(colorTex${t}, uv, ${o}).a), 1.0);\n } else {\n fragColor${t} = vec4(readTexture(colorTex${t}, uv, ${o}));\n }\n }`,""),d=t.length,f=`#version 300 es\n precision highp float;\n precision highp usampler2D;\n\n in vec2 uv;\n ${h(t)}\n ${a(r,`layout(location = ${c.int(d)}) out vec4 fragDepth;\n uniform sampler2D depthTex;`)}\n\n uniform int inputTypes[${t.length||1}];\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaToFloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaToFloat(depth));\n }\n\n vec4 readTexture(sampler2D tex, vec2 uv, int lod) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(tex, lod)));\n return texelFetch(tex, iuv, lod);\n }\n\n ${"float"===t[0]?"float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }":"float linearDepthFromTexture(usampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(vec4(texelFetch(depthTex, iuv, 0)) * 255.0);\n }"}\n\n void main() {\n ${p(t)}\n ${a(r,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n }`,m=e.programCache.get(s,f,l);return this._programs.set(n,m),m}};function v(e){switch(e){case"float":return"sampler2D";case"uint":return"usampler2D";case"int":return"isampler2D"}}function g(e){if(!e)return"float";const{internalFormat:r}=e.descriptor;switch(r){case d.R8I:case d.R16I:case d.R32I:case d.RG8I:case d.RG16I:case d.RG32I:case d.RGB8I:case d.RGB16I:case d.RGB32I:case d.RGBA8I:case d.RGBA16I:case d.RGBA32I:return"int";case d.R8UI:case d.R16UI:case d.R32UI:case d.RG8UI:case d.RG16UI:case d.RG32UI:case d.RGB8UI:case d.RGB16UI:case d.RGB32UI:case d.RGBA8UI:case d.RGBA16UI:case d.RGBA32UI:return"uint";default:return"float"}}function x(e){const{hasDepthAttachment:r,colorSamplerTypes:t,level:o}=e;return`${r?"Depth":""}${t.reduceRight((e,r)=>e+`|C${r}`,"")} ${o}`}function T(e){switch(e){case d.R16F:case d.R32F:case d.R8:return 3;case d.RG8:return 4;case d.RGBA16F:return 5;case d.RG8UI:return 6;default:return 7}}function F(e,r,t,o){return o?`${e}\ndepth`:`${e}\n${$(r,t)}`}function $(e,r){return`${e.getColorTexture(r)?.debugName??"color"+(r-p)}`}e([t()],m.prototype,"destroyedCB",void 0),e([t()],m.prototype,"consumes",void 0),e([t()],m.prototype,"produces",void 0),e([t()],m.prototype,"clearColor",void 0),m=e([o("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],m);export{m as RenderNodeVisualizerNode,F as getAttachmentName};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{watch as
|
|
2
|
+
import{__decorate as e}from"tslib";import{watch as s}from"../../../../../core/reactiveUtils.js";import{property as t,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as i}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as o}from"../../../webgl.js";import a from"../../../webgl/RenderNode.js";import{F as n}from"../../../../../chunks/FocusAreaColor.glsl.js";import{FocusAreaColorTechnique as c}from"./FocusAreaColorTechnique.js";import{EmissiveTechniqueConfiguration as h}from"../../shaders/EmissiveTechniqueConfiguration.js";let m=class extends a{constructor(e){super({...e,view:e.focusAreasView.view}),this.consumes={required:[o.FOCUSAREA_COLOR,o.FOCUSAREA]},this.produces=o.FOCUSAREA_COLOR,this._fadeDirection=0,this._configuration=new h,this._passParameters=new n}fadeOut(e){this.removeAllHandles(),this._startTime=null,this._fadeDirection=1,this.addHandles(s(()=>this._passParameters.fadeFactor.value,s=>{0===s&&(this.removeAllHandles(),e())})),this.requestRender(2)}precompile(){this._configuration.hasEmissive=0!==this.bindParameters.emissions,this.techniques.precompile(c,this._configuration)}render(e){const s=this.bindParameters;this._startTime??=this.view.stage?.renderer.renderContext.time;const t=this.view.qualitySettings.fadeDuration,r=t>0?Math.min(t,this.view.stage?.renderer.renderContext.time-this._startTime)/t:1,a=this.renderingContext,n=this.techniques.get(c,this._configuration),h=this.input,m=e.find(({name:e})=>e===o.FOCUSAREA),f="bright"===this.focusAreasView.style;this._passParameters.color=f?h.getTexture():a.emptyTexture,this._passParameters.focusArea=m.getTexture(),this._passParameters.effect=u[this.focusAreasView.style],this._passParameters.fadeFactor.value=0===this._fadeDirection?r:1-r;const d=s.camera,l=d.fullViewport[2],p=d.fullViewport[3],g=f?this.fboCache.acquire(l,p,this.produces).moveAttachments(h):h;return a.bindFramebuffer(g.fbo),f&&a.clearBuffer(0,i),a.bindTechnique(n,s,this._passParameters),a.screen.draw(),r<1&&this.requestRender(2),g}};e([t()],m.prototype,"consumes",void 0),e([t()],m.prototype,"produces",void 0),e([t({constructOnly:!0})],m.prototype,"focusAreasView",void 0),m=e([r("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaVisualization")],m);const u={bright:0,dark:1};export{m as FocusAreaVisualization,u as styleToEffect};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../core/shaderLibrary/output/ReadDepth.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/Float3PassUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../raymarching/DistanceFalloff.glsl.js";import"../../shaders/
|
|
2
|
+
import"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../core/shaderLibrary/output/ReadDepth.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderLibrary/util/ColorConversion.glsl.js";import"../../core/shaderModules/Float3PassUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../raymarching/DistanceFalloff.glsl.js";import"../../shaders/ScreenSpacePassAtmosphere.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{F as FogPassParameters,b as build}from"../../../../../chunks/Fog.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{smoothstep as t,lerp as s}from"../../../../../core/mathUtils.js";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{smoothstep as t,lerp as s}from"../../../../../core/mathUtils.js";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{signal as n}from"../../../../../core/signal.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{add as h,normalize as m,length as p,dot as c,scale as l,lerp as u}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g,fromValues as d}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../../geometry/ellipsoidUtils.js";import{heightLimit as f}from"../../../environment/weather.js";import{TransparentEnvironment as P}from"../TransparentEnvironment.js";import{betaRayleigh as v,betaCombined as w}from"../atmosphere/atmosphereUtils.js";import{F as b}from"../../../../../chunks/Fog.glsl.js";import{FogTechnique as y}from"./FogTechnique.js";import{EmissiveTechniqueConfiguration as j}from"../../shaders/EmissiveTechniqueConfiguration.js";import{floatBlendReductionFactor as F}from"../../shaders/floatBlendScale.glsl.js";import{DepthStencilAttachment as B,ColorAttachment1 as q,SizedPixelFormat as E}from"../../../../webgl/enums.js";const x=.9*f,C=1.1*f;let R=class extends P{constructor(e){super(e),this._configuration=new j,this._newParameters=new T,this._oldParameters=new T,this._fadedParameters=new T,this._parameters=this._newParameters,this._passParameters=new b;const t=_(e.view.spatialReference);this._planetRadius=t.radius,this._atmosphereRadius=t.radius+t.atmosphereHeight}initialize(){this.addHandles([a(()=>this.view.environment.atmosphereEnabled,()=>this._updateEnabled(),i),a(()=>this.view.environment.weather,()=>this._updateEnabled(),i),a(()=>this._updateFogParameters(),()=>{},i)]),this.addHandles(a(()=>this._fadeFactor,e=>this._fade(e),i))}_updateEnabled(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){const{_newParameters:t,_oldParameters:s}=this;e>=1?(this._parameters=t,this._oldParameters.copy(this._newParameters)):e<=0?this._parameters=s:(this._fadedParameters.lerp(s,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){const{weather:e,weatherAvailable:t}=this.view.environment,s="foggy"===e.type||"snowy"===e.type||"rainy"===e.type;this._newParameters.strength.value=t?e.scattering:0,this._newParameters.amount.value=s?1:0,"foggy"!==e.type&&"snowy"!==e.type||(this._newParameters.fogBrightness=M),"rainy"===e.type&&(this._newParameters.fogBrightness=D),this._fadeFactor>=1&&this._oldParameters.copy(this._newParameters),this.requestRender(2)}get strength(){return this._parameters.strength.value*this._heightFade}get amount(){return this._parameters.amount.value*this._heightFade}get _heightFade(){const e=p(this.bindParameters.camera.eye);return 1-t(x,C,Math.abs(e-this._planetRadius))}precompile(){this._update(),this._passParameters.amount>0&&this.techniques.precompile(y,this._configuration)}render(){const e=this.input,t=this._getTechnique();if(!t)return e;const s=this.renderingContext,a=e.getAttachment(B);if(this._passParameters.emission=e.obtainAttachment(q),this._passParameters.inputScale=this._passParameters.emission?.attachment.descriptor.internalFormat===E.RGBA8?F:1,this._passParameters.emission){const t=1===this._passParameters.inputScale?8:5;e.acquireColor(q,t,"emissive")}return e.attachDepth(null),s.bindFramebuffer(e.fbo),s.bindTechnique(t,this.bindParameters,this._passParameters),s.screen.draw(),this._passParameters.emission=r(this._passParameters.emission),e.attachDepth(a),this.fboCache.debugCallback?.("fog-color",e.fbo),e}_getTechnique(){return this._update(),this._passParameters.amount>0?this.techniques.get(y,this._configuration):null}_update(){const e=this.bindParameters.camera;m(A,e.eye);const t=Math.max(0,c(A,this.bindParameters.lighting.mainLight.direction)),s=this._parameters.fogBrightness;l(this._passParameters.color,H,s),l(S,H,.1*s),u(this._passParameters.color,S,this._passParameters.color,t);const r=p(e.eye);this._passParameters.atmosphereC=r**2-this._atmosphereRadius**2,this._passParameters.amount=this.amount,this._passParameters.strength=this.strength,this._configuration.hasEmissive=this.bindParameters.hasEmission}get test(){return{parameters:this._passParameters}}};R=e([o("esri.views.3d.webgl-engine.effects.fog.Fog")],R);class T{constructor(){this.fogBrightness=0,this.strength=n(0),this.amount=n(0)}copy(e){this.fogBrightness=e.fogBrightness,this.strength.value=e.strength.value,this.amount.value=e.amount.value}lerp(e,t,r){this.fogBrightness=s(e.fogBrightness,t.fogBrightness,r),this.strength.value=s(e.strength.value,t.strength.value,r),this.amount.value=s(e.amount.value,t.amount.value,r)}}const A=g(),S=g(),U=d(3e-4,3e-4,3e-4),H=g();h(H,w,v),h(H,H,U),m(H,H);const k=H.reduce((e,t)=>e+t,0)/3,D=.5/k,M=1.5/k;export{R as Fog,T as FogParameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import"../../core/shaderLibrary/util/CameraSpace.glsl.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4BindUniform.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./GlobalIlluminationColorQuantization.glsl.js";import"../../shaders/floatBlendScale.glsl.js";import"../../../../webgl/enums.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlobalIlluminationPassParameters,c as build,e as defaultColorBleedWeight,d as defaultRayMarchMaxReach,f as defaultRayMarchMaxReachEmissionWeight,b as defaultRayMarchMaxSteps,g as defaultRayMarchMinReach,h as defaultRayMarchMinReachEmissionWeight,i as defaultRayMarchWorldReach}from"../../../../../chunks/GlobalIllumination.glsl.js";
|
|
2
|
+
import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import"../../core/shaderLibrary/util/CameraSpace.glsl.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4BindUniform.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./GlobalIlluminationColorQuantization.glsl.js";import"../../shaders/floatBlendScale.glsl.js";import"../../../../webgl/enums.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlobalIlluminationPassParameters,c as build,e as defaultColorBleedWeight,d as defaultRayMarchMaxReach,f as defaultRayMarchMaxReachEmissionWeight,b as defaultRayMarchMaxSteps,g as defaultRayMarchMinReach,h as defaultRayMarchMinReachEmissionWeight,i as defaultRayMarchWorldReach}from"../../../../../chunks/GlobalIllumination.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{releaseMaybe as t}from"../../../../../core/maybe.js";import{watch as
|
|
2
|
+
import{__decorate as e}from"tslib";import{releaseMaybe as t}from"../../../../../core/maybe.js";import{watch as r,syncAndInitial as s}from"../../../../../core/reactiveUtils.js";import{property as a,subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{set as l}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as o}from"../../../webgl.js";import u from"../../../webgl/RenderNode.js";import{G as n}from"../../../../../chunks/GlobalIllumination.glsl.js";import{G as m}from"../../../../../chunks/GlobalIlluminationBlur.glsl.js";import{GlobalIlluminationBlurTechnique as h}from"./GlobalIlluminationBlurTechnique.js";import{GlobalIlluminationTechnique as c}from"./GlobalIlluminationTechnique.js";import{GlobalIlluminationTechniqueConfiguration as p}from"./GlobalIlluminationTechniqueConfiguration.js";import{G as _}from"../../../../../chunks/GlobalIlluminationUpscale.glsl.js";import{GlobalIlluminationUpscaleTechnique as d}from"./GlobalIlluminationUpscaleTechnique.js";import{DepthStencilAttachment as f,ColorAttachment1 as b}from"../../../../webgl/enums.js";const g=1;let w=class extends u{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=o.AMBIENT_ILLUMINATION,this._passParameters=new n,this._drawParameters=new m,this._drawParametersUpscale=new _,this._maxFrames=256,this._lowQualityResolutionScale=.25,this._configuration=new p,this._lastOutput=null,this._isGlobalIlluminationUpdate=!1,this._resetBuffer=!1}initialize(){this.addHandles(r(()=>this.view.stage.renderer.hasGlobalIllumination,()=>{this._reset(),this._requestRender()},s))}destroy(){this._lastOutput=t(this._lastOutput)}resetAccumulatedFrames(){this._isGlobalIlluminationUpdate||this._reset()}render(e){if(this._passParameters.accumulatedFrames>=this._maxFrames)return this._lastOutput?.retain(),this._lastOutput;const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),s=t?.getTexture(f),a=this._mode;if(!r||!s)return this._emptyOutput;if(0===a)return this._resetBuffer=!1,this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this._requestRender(),this._emptyOutput;const i=this.bindParameters;this._configuration.hasEmission=!!i.reprojection.lastFrameEmission;const u=this.techniques.getCompiled(c,this._configuration),n=this.techniques.getCompiled(h),m=1===a,p=m?this._lowQualityResolutionScale:1,_=m?this.techniques.getCompiled(d):null;if(!u||!n||m&&!_)return this._requestRender(),this._emptyOutput;const w=this.renderingContext,{camera:P}=i;this._passParameters.normalTexture=r,this._passParameters.depthTexture=s,this._passParameters.projScale=1/P.computeScreenPixelSizeAtDist(1),this._passParameters.scaleGlobalIllumination=p;const{fullWidth:I,fullHeight:x}=P,T=Math.max(1,Math.floor(I*p)),q=Math.max(1,Math.floor(x*p)),F=this.fboCache.acquire(T,q,"global illumination input").acquireColor(b,0);w.bindFramebuffer(F.fbo),w.setViewport(0,0,T,q),w.bindTechnique(u,i,this._passParameters,this._drawParameters),w.screen.draw();const O=F.obtainAttachment(b),C=Math.max(1,Math.round(T/g)),G=Math.max(1,Math.round(q/g)),j=this.fboCache.acquire(C,G,"global illumination blur horizontal");w.bindFramebuffer(j.fbo),this._drawParameters.texture=F.getTexture(),this._drawParameters.weightTexture=O.attachment,l(this._drawParameters.blurSize,0,g/q),w.bindTechnique(n,i,this._passParameters,this._drawParameters),w.setViewport(0,0,C,G),w.screen.draw(),F.release();const y=m?"global illumination blur vertical":o.AMBIENT_ILLUMINATION,M=this.fboCache.acquire(C,G,y);w.bindFramebuffer(M.fbo),w.setViewport(0,0,C,G),w.setClearColor(1,1,1,0),w.clear(16384),this._drawParameters.texture=j.getTexture(),this._drawParameters.weightTexture=O.attachment,l(this._drawParameters.blurSize,g/C,0),w.bindTechnique(n,i,this._passParameters,this._drawParameters),w.setViewport(0,0,C,G),w.screen.draw(),j.release(),M.attachColor(O,b),O.release();let R=M;return _&&(R=this.fboCache.acquire(I,x,o.AMBIENT_ILLUMINATION).acquireColor(b,0),w.bindFramebuffer(R.fbo),w.setViewport(0,0,I,x),w.setClearColor(1,1,1,0),w.clear(16384),this._drawParametersUpscale.colorTexture=M.getTexture(),this._drawParametersUpscale.weightTexture=M.getTexture(b),w.bindTechnique(_,i,this._passParameters,this._drawParametersUpscale),w.screen.draw(),M.release()),w.setViewport4fv(P.fullViewport),this._passParameters.temporalSampleFrame=(this._passParameters.temporalSampleFrame+1)%64,++this._passParameters.accumulatedFrames,this._storeOutput(R),this._passParameters.accumulatedFrames<this._maxFrames&&this._requestRender(),R}_requestRender(){this._isGlobalIlluminationUpdate=!0,this.requestRender(1),this._isGlobalIlluminationUpdate=!1}_storeOutput(e){this._lastOutput!==e&&(this._lastOutput=t(this._lastOutput),this._lastOutput=e,this._lastOutput.retain())}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:r}=this.bindParameters.camera,s=this.fboCache.acquire(t,r,o.AMBIENT_ILLUMINATION).acquireColor(b,0);return e.bindFramebuffer(s.fbo),e.setViewport(0,0,t,r),e.clearBuffer(0,[0,0,0,1]),e.clearBuffer(1,[0,0,0,0]),s}get _canRender(){const{reprojection:e,hasEmission:t,globalIllumination:r}=this.bindParameters;return!(!e.lastFrameColor||t&&!e.lastFrameEmission||!e.lastFrameDepth||!r||this._resetBuffer)}get _mode(){const{hasGlobalIlluminationHighQuality:e,hasGlobalIllumination:t}=this.view.stage.renderer;return e?2:t?1:0}_reset(){this._passParameters.accumulatedFrames=0,this._lastOutput=t(this._lastOutput)}get test(){const e=this;return{passParameters:this._passParameters,configuration:this._configuration,get maxFrames(){return e._maxFrames},set maxFrames(t){e._maxFrames=t},get lowQualityResolutionScale(){return e._lowQualityResolutionScale},set lowQualityResolutionScale(t){e._lowQualityResolutionScale=t},get mode(){return e._mode},restartAccumulation:()=>{this._reset(),this._passParameters.temporalSampleFrame=0,this._resetBuffer=!0,this._requestRender()}}}};e([a()],w.prototype,"consumes",void 0),e([a()],w.prototype,"produces",void 0),w=e([i("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination")],w);export{w as GlobalIllumination,g as blurSizePixels};
|
package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as s}from"tslib";import{parameter as o}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{d as
|
|
2
|
+
import{__decorate as s}from"tslib";import{parameter as o,ShaderTechniqueConfiguration as r}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{d as t,b as a}from"../../../../../chunks/GlobalIllumination.glsl.js";class i extends r{constructor(){super(...arguments),this.hasColor=!0,this.hasEmission=!1,this.rayMarchMaxReach=t,this.rayMarchMaxSteps=a,this.useProjectedRayLength=!0,this.clampRayToScreen=!1}}s([o()],i.prototype,"hasColor",void 0),s([o()],i.prototype,"hasEmission",void 0);export{i as GlobalIlluminationTechniqueConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as
|
|
2
|
+
import{__decorate as e}from"tslib";import{lerp as t}from"../../../../../core/mathUtils.js";import{releaseMaybe as s}from"../../../../../core/maybe.js";import{watch as r,initial as i}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as a}from"../../../../../core/accessorSupport/decorators.js";import{set as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as l}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as h}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as c}from"../../../webgl.js";import{TransparentEnvironment as p}from"../TransparentEnvironment.js";import{G as u}from"../../../../../chunks/GlowBlur.glsl.js";import{GlowBlurTechnique as b}from"./GlowBlurTechnique.js";import{G as f}from"../../../../../chunks/GlowComposite.glsl.js";import{GlowCompositeTechnique as _}from"./GlowCompositeTechnique.js";import{FloatBlendScaleConfiguration as g,floatBlendReductionFactor as d}from"../../shaders/floatBlendScale.glsl.js";import{ColorAttachment1 as w,DrawBufferNone as P}from"../../../../webgl/enums.js";import{noParameters as v}from"../../../../webgl/NoParameters.js";let B=class extends p{constructor(e){super(e),this.consumes={required:[c.TRANSPARENT_ENVIRONMENT,"emissive"]},this.produces=c.TRANSPARENT_ENVIRONMENT,this._glowBoost={realistic:0,cartographicMin:.5,cartographicDefault:2.5,cartographicMax:5},this._compositeConfiguration=new g,this._compositeParameters=new f,this._blurParameters=new u;const t=h(e.view.spatialReference);this._atmosphereRadius=t.radius+t.atmosphereHeight}initialize(){this.addHandles([r(()=>this._mode,e=>2===e?this._disable():this._enable(),i),r(()=>this._boost,e=>{this._compositeParameters.boost=e,this.requestRender(1)},i),r(()=>this.view.stage.renderView.fog?.strength??0,e=>{this._compositeParameters.scattering=e,this.requestRender(1)},i)])}precompile(){this.techniques.precompile(b),this._compositeConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this.techniques.precompile(_,this._compositeConfiguration)}render(){const e=this.input;if(this._compositeParameters.emission=e.obtainAttachment(w),!this._compositeParameters.emission?.attachment)return e;const{fullWidth:t,fullHeight:r,eye:i}=this.bindParameters.camera,o=n(i);this._compositeParameters.atmosphereC=o**2-this._atmosphereRadius**2,this._compositeParameters.mipmapLevels=this._renderGlowMipMap();const a=this.renderingContext,m=e.obtainDepthTexture();e.acquireColor(w,8,"emissive"),a.bindFramebuffer(e.fbo),a.setViewport(0,0,t,r),a.clearBuffer(1,l);const h=a.setDrawBuffers([P,w]),c=this.techniques.get(_,this._compositeConfiguration);return a.bindTechnique(c,this.bindParameters,this._compositeParameters),a.screen.draw(),a.setDrawBuffers(h),this._compositeParameters.emission=s(this._compositeParameters.emission),this._compositeParameters.mipmapTexture=s(this._compositeParameters.mipmapTexture),e.attachDepth(m),m?.release(),this.fboCache.debugCallback?.("glow-color",e.fbo),e}_renderGlowMipMap(){const e=this.fboCache,{fullWidth:t,fullHeight:s}=this.camera,r=this.renderingContext;this._blurParameters.input=this._compositeParameters.emission?.attachment,this._blurParameters.inputScale=this.bindParameters.useFloatBlend.value?1:d,this._blurParameters.level=0,m(this._blurParameters.size,1,1);const i=Math.floor(.5*t),o=Math.floor(.5*s),a=e.acquire(i,s,"glow horizontal",8);let n,l=i,h=s;const c=this.techniques.get(b),p=r.bindTechnique(c,this.bindParameters,v);for(;l>=1&&h>=1;)this._blurParameters.isHorizontal=!0,this._setupFBO(a,l,h),p.bindDraw(this.bindParameters,v,this._blurParameters),r.screen.draw(),h=Math.floor(.5*h),this._blurParameters.input=a.getTexture(),this._blurParameters.inputScale=1,this._blurParameters.isHorizontal=!1,m(this._blurParameters.size,l/i,h/o),n??=e.acquire(l,h,"glow mipmap",9),this._setupFBO(n,l,h,this._blurParameters.level),p.bindDraw(this.bindParameters,v,this._blurParameters),r.screen.draw(),e.debugCallback?.(n.name,n.fbo),l=Math.floor(.5*l),this._blurParameters.input=n.getTexture(),++this._blurParameters.level;return a.release(),this._compositeParameters.mipmapTexture=n,n&&(n.fbo.level=0),this._blurParameters.level}get _boost(){return 0===this._mode?this._glowBoost.realistic:this._intensity<=.5?t(this._glowBoost.cartographicMin,this._glowBoost.cartographicDefault,2*this._intensity):t(this._glowBoost.cartographicDefault,this._glowBoost.cartographicMax,2*(this._intensity-.5))}get _mode(){return null==this.view.environment.lighting.glow?this.view.environment.atmosphereEnabled?0:2:1}get _intensity(){return this.view.environment.lighting.glow?.intensity??0}_setupFBO(e,t,s,r=0){e.fbo.level=r;const i=this.renderingContext;i.bindFramebuffer(e.fbo),i.setViewport(0,0,t,s),i.setClearColor(0,0,0,0),i.clear(16384)}};e([o()],B.prototype,"consumes",void 0),e([o()],B.prototype,"produces",void 0),B=e([a("esri.views.3d.webgl-engine.effects.glow.Glow")],B);export{B as Glow};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/arrayUtils.js";import"../../../../../core/mathUtils.js";import"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/
|
|
2
|
+
import"../../../../../core/arrayUtils.js";import"../../../../../core/mathUtils.js";import"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/BooleanDrawUniform.js";import"../../core/shaderModules/Float2DrawUniform.js";import"../../core/shaderModules/FloatDrawUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DDrawUniform.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlowBlurDrawParameters,b as build,w as weights}from"../../../../../chunks/GlowBlur.glsl.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import"../../core/shaderLibrary/output/ReadDepth.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../raymarching/DistanceFalloff.glsl.js";import"../../shaders/floatBlendScale.glsl.js";import"../../shaders/ScreenSpacePassAtmosphere.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlowCompositePassParameters,b as build}from"../../../../../chunks/GlowComposite.glsl.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as r}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../../chunks/GlowComposite.glsl.js";import{makePipelineState as t,defaultColorWrite as l}from"../../../../webgl/renderState.js";let c=class extends s{constructor(){super(...arguments),this.shader=new r(i,()=>import("./GlowComposite.glsl.js"))}initializePipeline(){return t({colorWrite:l})}};c=e([o("esri.views.3d.webgl-engine.effects.glow.GlowCompositeTechnique")],c);export{c as GlowCompositeTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{lerp as t,smoothstep as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as s,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as h}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{earth as m}from"../../../../../geometry/support/Ellipsoid.js";import{TransparentEnvironment as u}from"../TransparentEnvironment.js";import{H as d}from"../../../../../chunks/HazeCompositing.glsl.js";import{HazeCompositingTechnique as p}from"./HazeCompositingTechnique.js";import{HazePassParameters as c,HazeTechnique as f}from"./HazeTechnique.js";import{HazeTechniqueConfiguration as l}from"./HazeTechniqueConfiguration.js";import{createQuadVAO as _}from"../../lib/glUtil3D.js";import{applyTextureResizeModulo as b}from"../../lib/textureUtils.js";import{DepthStencilAttachment as g,ColorAttachment0 as w,PrimitiveType as P}from"../../../../webgl/enums.js";let v=class extends u{constructor(e){super(e),this._compositingPassParameters=new d,this._passParameters=new c,this._hazeConfiguration=new l,this._oldAmount=1,this._newAmount=1,this._amount=this._newAmount}initialize(){this.addHandles([s(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),o),s(()=>this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1,e=>this._fade(e),o),s(()=>this.view.environment.weather.type,e=>this._newAmount="rainy"===e?0:1,o),s(()=>this.view.stage.renderer?.highResolutionAtmosphere,e=>this._hazeConfiguration.reduced=!e,o)])}_fade(e){e>=1?(this._amount=this._newAmount,this._oldAmount=this._newAmount):this._amount=e<=0?this._oldAmount:t(this._oldAmount,this._newAmount,e)}destroy(){this._vao=r(this._vao)}render(){const e=this.input;if(!this.bindParameters.mainDepth)return e;const i=this.techniques.getCompiled(f,this._hazeConfiguration),r=!!this._hazeConfiguration.reduced&&this.techniques.getCompiled(p);if(null==i||null==r)return e;const s=this.renderingContext,o=e.getAttachment(g);if(this._update(),!r)return e.detachDepth(),s.bindFramebuffer(e.fbo),s.bindTechnique(i,this.bindParameters,this._passParameters),s.setDrawBuffers([w]),this._renderCommon(s),e.attachDepth(o),e;const a=s.getViewport(),n=this.camera,u=h(n.eye)-m.radius;let d;const c=m.atmosphereHeight;if(u<c){const e=Math.min(1,Math.max(0,u/c));d=t(.4,.5,e)}else{const e=Math.min(1,Math.max(0,(u-c)/(15*c)));d=t(.5,1,e)}const l=this.renderingContext.parameters.maxTextureSize,_=b(Math.round(d*n.fullViewport[2]),l),P=b(Math.round(d*n.fullViewport[3]),l);s.setViewport(0,0,_,P);const v=this.fboCache.acquire(_,P,"haze"
|
|
2
|
+
import{__decorate as e}from"tslib";import{lerp as t,smoothstep as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as s,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as h}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{earth as m}from"../../../../../geometry/support/Ellipsoid.js";import{TransparentEnvironment as u}from"../TransparentEnvironment.js";import{H as d}from"../../../../../chunks/HazeCompositing.glsl.js";import{HazeCompositingTechnique as p}from"./HazeCompositingTechnique.js";import{HazePassParameters as c,HazeTechnique as f}from"./HazeTechnique.js";import{HazeTechniqueConfiguration as l}from"./HazeTechniqueConfiguration.js";import{createQuadVAO as _}from"../../lib/glUtil3D.js";import{applyTextureResizeModulo as b}from"../../lib/textureUtils.js";import{DepthStencilAttachment as g,ColorAttachment0 as w,PrimitiveType as P}from"../../../../webgl/enums.js";let v=class extends u{constructor(e){super(e),this._compositingPassParameters=new d,this._passParameters=new c,this._hazeConfiguration=new l,this._oldAmount=1,this._newAmount=1,this._amount=this._newAmount}initialize(){this.addHandles([s(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),o),s(()=>this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1,e=>this._fade(e),o),s(()=>this.view.environment.weather.type,e=>this._newAmount="rainy"===e?0:1,o),s(()=>this.view.stage.renderer?.highResolutionAtmosphere,e=>this._hazeConfiguration.reduced=!e,o)])}_fade(e){e>=1?(this._amount=this._newAmount,this._oldAmount=this._newAmount):this._amount=e<=0?this._oldAmount:t(this._oldAmount,this._newAmount,e)}destroy(){this._vao=r(this._vao)}render(){const e=this.input;if(!this.bindParameters.mainDepth)return e;const i=this.techniques.getCompiled(f,this._hazeConfiguration),r=!!this._hazeConfiguration.reduced&&this.techniques.getCompiled(p);if(null==i||null==r)return e;const s=this.renderingContext,o=e.getAttachment(g);if(this._update(),!r)return e.detachDepth(),s.bindFramebuffer(e.fbo),s.bindTechnique(i,this.bindParameters,this._passParameters),s.setDrawBuffers([w]),this._renderCommon(s),e.attachDepth(o),e;const a=s.getViewport(),n=this.camera,u=h(n.eye)-m.radius;let d;const c=m.atmosphereHeight;if(u<c){const e=Math.min(1,Math.max(0,u/c));d=t(.4,.5,e)}else{const e=Math.min(1,Math.max(0,(u-c)/(15*c)));d=t(.5,1,e)}const l=this.renderingContext.parameters.maxTextureSize,_=b(Math.round(d*n.fullViewport[2]),l),P=b(Math.round(d*n.fullViewport[3]),l);s.setViewport(0,0,_,P);const v=this.fboCache.acquire(_,P,"haze");return s.bindFramebuffer(v.fbo),s.clearFramebuffer([0,0,0,1],!0,!0),s.bindTechnique(i,this.bindParameters,this._passParameters),this._renderCommon(s),s.setViewport(a.x,a.y,a.width,a.height),this._compositingPassParameters.color=v.getTexture(),e.detachDepth(),s.bindFramebuffer(e.fbo),s.bindTechnique(r,this.bindParameters,this._compositingPassParameters),s.setDrawBuffers([w]),s.screen.draw(),e.attachDepth(o),v.release(),e}_renderCommon(e){this._vao??=_(e,1),e.bindVAO(this._vao),e.drawArrays(P.TRIANGLE_STRIP,0,4)}_update(){const e=this.view.basemapTerrain?.getLowerBoundRadius()??0;n(this._passParameters.radii,e,e+m.atmosphereHeight);const r=h(this.bindParameters.camera.eye);this._passParameters.hazeStrength=t(t(.6,1,i(9500,10500,r-m.radius)),1,this._amount)}};v=e([a("esri.views.3d.webgl-engine.effects.haze.Haze")],v);export{v as Haze};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/libs/gl-matrix-2/math/vec3.js";import"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../core/shaderLibrary/NormalFromDepth.glsl.js";import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import"../../core/shaderLibrary/shading/ShadowmapFiltering.glsl.js";import"../../core/shaderModules/Float3BindUniform.js";import"../../core/shaderModules/Float4PassUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DShadowBindUniform.js";import"../../core/shaderModules/Texture2DUintPassUniform.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/ShadowHighlight.glsl.js";
|
|
2
|
+
import"../../../../../core/libs/gl-matrix-2/math/vec3.js";import"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../core/shaderLibrary/NormalFromDepth.glsl.js";import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js";import"../../core/shaderLibrary/shading/ShadowmapFiltering.glsl.js";import"../../core/shaderLibrary/util/blendEmission.glsl.js";import"../../core/shaderModules/Float3BindUniform.js";import"../../core/shaderModules/Float4PassUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DShadowBindUniform.js";import"../../core/shaderModules/Texture2DUintPassUniform.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/ShadowHighlight.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{smoothstep as t,clamp as
|
|
2
|
+
import{__decorate as e}from"tslib";import{smoothstep as t,clamp as i}from"../../../../../core/mathUtils.js";import{watch as s,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{property as r,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{normalize as h,set as n,dot as c}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderNodeOutput as d}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{ShadowHighlightPassParameters as l,ShadowHighlightTechnique as u}from"./ShadowHighlightTechnique.js";import{EmissiveTechniqueConfiguration as g}from"../../shaders/EmissiveTechniqueConfiguration.js";import{defaultShadowOpacity as f,defaultShadowDifference as _,defaultShadowColor as w}from"../../../../support/HighlightDefaults.js";const y=1/512,O=4e4,P=5e4;let v=class extends m{constructor(e){super(e),this.consumes={required:[d.COMPOSITE,"highlights"]},this.produces=d.COMPOSITE,this._configuration=new g,this._passParameters=new l,this._maxOpacity=1,this._shadowDifference=.2}initialize(){this.addHandles([s(()=>this.view.defaultHighlight?.shadowOpacity,e=>{this._passParameters.shadowOpacity=e??f,this._updateOccludedShadowOpacity(),this._ensureMaxOpacity()},a),s(()=>this.view.defaultHighlight?.shadowDifference,e=>{this._shadowDifference=e??_,this._updateOccludedShadowOpacity(),this._ensureMaxOpacity()},a),s(()=>this.view.defaultHighlight?.shadowColor,e=>{this._passParameters.shadowColor=(e??w).toUnitRGBA(),this._ensureMaxOpacity()},a)])}_updateOccludedShadowOpacity(){this._passParameters.occludedShadowOpacity=this._passParameters.shadowOpacity*(1-this._shadowDifference)}_ensureMaxOpacity(){const e=Math.max(this._passParameters.shadowOpacity,this._passParameters.occludedShadowOpacity);this._maxOpacity=e*this._passParameters.shadowColor[3],this.requestRender(1)}precompile(){this._ensureIfVisible()&&(this._configuration.hasEmissive=0!==this.bindParameters.emissions,this.techniques.precompile(u,this._configuration))}render(e){const t=this.input;if(!this._ensureIfVisible())return t;const i=this.bindParameters;this._passParameters.highlightTexture=e.find(({name:e})=>"highlights"===e)?.getTexture(),this._passParameters.origin=i.camera.center;const s=this.renderingContext,a=this.techniques.get(u,this._configuration),r=t.obtainDepthTexture();return s.bindFramebuffer(t.fbo),s.bindTechnique(a,i,this._passParameters),s.screen.draw(),t.attachDepth(r),r?.release(),t}_ensureIfVisible(){const e=this.bindParameters;if(!e.hasShadowHighlights||!e.mainDepth||!e.shadowHighlight?.getTexture())return!1;const{camera:s,lighting:a}=e;this._passParameters.opacityElevation=1-t(O,P,s.relativeElevation);const r=1===this.viewingMode?h(b,s.center):n(b,0,0,1),o=c(r,a.mainLight.direction);return this._passParameters.dayNightTerminator=t(0,1,i(30*o,0,1)),this._maxOpacity*this._passParameters.opacityElevation*this._passParameters.dayNightTerminator>=y}};e([r()],v.prototype,"consumes",void 0),e([r()],v.prototype,"produces",void 0),e([r({constructOnly:!0})],v.prototype,"viewingMode",void 0),v=e([o("esri.views.3d.webgl-engine.effects.highlight.ShadowHighlight")],v);const b=p();export{v as ShadowHighlight};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{property as i,subclass as
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{property as i,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{copy as r,add as s}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromRay as a,getStart as o,getEnd as l,create as h}from"../../../../../geometry/support/clipRay.js";import{intersectClipRay as c}from"../../../../../geometry/support/frustum.js";import{copy as d}from"../../../../../geometry/support/lineSegment.js";import{wrap as p}from"../../../../../geometry/support/ray.js";import{InternalRenderCategory as m}from"../../../webgl.js";import u from"../../../webgl/RenderNode.js";import{Blit as g}from"../blit/Blit.js";import{LaserlinePathData as f}from"./LaserlinePathData.js";import{LaserlinePathPassParameters as _,LaserlinePathTechnique as b}from"./LaserlinePathTechnique.js";import{LaserlinePathTechniqueConfiguration as P}from"./LaserlinePathTechniqueConfiguration.js";import{LaserlineTechnique as E}from"./LaserlineTechnique.js";import{LaserlineTechniqueConfiguration as L}from"./LaserlineTechniqueConfiguration.js";import{updateParameters as V}from"../../materials/internal/MaterialUtil.js";let D=class extends u{get requireGeometryDepth(){return!0}constructor(e){super(e),this.isDecoration=!0,this.consumes={required:[m.LASERLINES,"normals"]},this.produces=m.LASERLINES,this._configuration=new L,this._pathConfiguration=new P,this._intersectsLineInfinite=!1,this._pathVerticalPlaneEnabled=!1,this._passParameters=new _,this._blit=new g(e.view.stage.renderView.techniques,2)}initialize(){this._passParameters.renderCoordsHelper=this.view.renderCoordsHelper,this._configuration.spherical=1===this.view.state.viewingMode,this._configuration.contrastControlEnabled=this.contrastControlEnabled,this._pathConfiguration.spherical=1===this.view.state.viewingMode,this._pathConfiguration.contrastControlEnabled=this.contrastControlEnabled}destroy(){this._pathVerticalPlaneData=t(this._pathVerticalPlaneData)}get heightManifoldEnabled(){return this._configuration.heightManifoldEnabled}set heightManifoldEnabled(e){this._configuration.heightManifoldEnabled!==e&&(this._configuration.heightManifoldEnabled=e,this.requestRender(1))}get heightManifoldTarget(){return this._passParameters.heightManifoldTarget}set heightManifoldTarget(e){r(this._passParameters.heightManifoldTarget,e),this.requestRender(1)}get pointDistanceEnabled(){return this._configuration.pointDistanceEnabled}set pointDistanceEnabled(e){e!==this._configuration.pointDistanceEnabled&&(this._configuration.pointDistanceEnabled=e,this.requestRender(1))}get pointDistanceTarget(){return this._passParameters.pointDistanceTarget}set pointDistanceTarget(e){r(this._passParameters.pointDistanceTarget,e),this.requestRender(1)}get pointDistanceOrigin(){return this._passParameters.pointDistanceOrigin}set pointDistanceOrigin(e){r(this._passParameters.pointDistanceOrigin,e),this.requestRender(1)}get lineVerticalPlaneEnabled(){return this._configuration.lineVerticalPlaneEnabled}set lineVerticalPlaneEnabled(e){e!==this._configuration.lineVerticalPlaneEnabled&&(this._configuration.lineVerticalPlaneEnabled=e,this.requestRender(1))}get lineVerticalPlaneSegment(){return this._passParameters.lineVerticalPlaneSegment}set lineVerticalPlaneSegment(e){d(e,this._passParameters.lineVerticalPlaneSegment),this.requestRender(1)}get intersectsLineEnabled(){return this._configuration.intersectsLineEnabled}set intersectsLineEnabled(e){e!==this._configuration.intersectsLineEnabled&&(this._configuration.intersectsLineEnabled=e,this.requestRender(1))}get intersectsLineSegment(){return this._passParameters.intersectsLineSegment}set intersectsLineSegment(e){d(e,this._passParameters.intersectsLineSegment),this.requestRender(1)}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(e){e!==this._intersectsLineInfinite&&(this._intersectsLineInfinite=e,this.requestRender(1))}get pathVerticalPlaneEnabled(){return this._pathVerticalPlaneEnabled}set pathVerticalPlaneEnabled(e){e!==this._pathVerticalPlaneEnabled&&(this._pathVerticalPlaneEnabled=e,null!=this._pathVerticalPlaneData&&this.requestRender(1))}set pathVerticalPlaneVertices(e){null==this._pathVerticalPlaneData&&(this._pathVerticalPlaneData=new f(this._passParameters.renderCoordsHelper)),this._pathVerticalPlaneData.vertices=e,this.pathVerticalPlaneEnabled&&this.requestRender(1)}set pathVerticalPlaneBuffers(e){null==this._pathVerticalPlaneData&&(this._pathVerticalPlaneData=new f(this._passParameters.renderCoordsHelper)),this._pathVerticalPlaneData.buffers=e,this.pathVerticalPlaneEnabled&&this.requestRender(1)}setParameters(e){V(this._passParameters,e)&&this.requestRender(1)}render(e){const t=this.input;if(this.isDecoration&&!this.bindParameters.decorations)return t;const i=this.renderingContext,n=e.find(({name:e})=>"normals"===e);if(this._passParameters.normals=n?.getTexture(),!this.contrastControlEnabled)return i.bindFramebuffer(t.fbo),this._renderLaserLines(),t;this._passParameters.colors=t.getTexture();const r=this.fboCache.acquire(t.fbo.width,t.fbo.height,"laser lines");return i.bindFramebuffer(r.fbo),i.setClearColor(0,0,0,0),i.clear(16384),this._renderLaserLines(),this._blit.blend(r,t,this.bindParameters)||this.requestRender(1),r.release(),t}_renderLaserLines(){(this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled)&&this._renderUnified(),this.pathVerticalPlaneEnabled&&this._renderPath()}_renderUnified(){if(!this._update())return;const e=this.techniques.getCompiled(E,this._configuration);if(e){const t=this.renderingContext;t.bindTechnique(e,this.bindParameters,this._passParameters),t.screen.draw()}else this.requestRender(1)}_renderPath(){if(null==this._pathVerticalPlaneData)return;const e=this.techniques.getCompiled(b,this._pathConfiguration);if(e){const t=this.renderingContext;this._passParameters.origin=this._pathVerticalPlaneData.origin,t.bindTechnique(e,this.bindParameters,this._passParameters),this._pathVerticalPlaneData.draw(t)}else this.requestRender(1)}_update(){if(this._configuration.hasEmissive=this._pathConfiguration.hasEmissive=0!==this.bindParameters.emissions,!this.intersectsLineEnabled)return!0;const e=this.bindParameters.camera,t=this._passParameters;if(this._intersectsLineInfinite){if(a(p(t.intersectsLineSegment.origin,t.intersectsLineSegment.vector),q),q.c0=-Number.MAX_VALUE,!c(e.frustum,q))return!1;o(q,t.lineStartWorld),l(q,t.lineEndWorld)}else r(t.lineStartWorld,t.intersectsLineSegment.origin),s(t.lineEndWorld,t.intersectsLineSegment.origin,t.intersectsLineSegment.vector);return!0}get test(){}};e([i({constructOnly:!0})],D.prototype,"contrastControlEnabled",void 0),e([i()],D.prototype,"isDecoration",void 0),e([i()],D.prototype,"consumes",void 0),e([i()],D.prototype,"produces",void 0),D=e([n("esri.views.3d.webgl-engine.effects.laserlines.LaserLineRenderer")],D);const q=h();export{D as LaserLineRenderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/mathUtils.js";import"../../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../../core/libs/gl-matrix-2/math/vec3.js";import"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../../../../core/libs/gl-matrix-2/math/vec4.js";import"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../../../../geometry/support/lineSegment.js";import"../../../../../geometry/support/plane.js";import"../../core/shaderLibrary/Laserline.glsl.js";import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderModules/Float2PassUniform.js";import"../../core/shaderModules/Float3BindUniform.js";import"../../core/shaderModules/Float3PassUniform.js";import"../../core/shaderModules/Float4PassUniform.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../../../webgl/ShaderBuilder.js";export{b as build,d as defaultAngleCutoff}from"../../../../../chunks/Laserline.glsl.js";
|
|
2
|
+
import"../../../../../core/mathUtils.js";import"../../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../../core/libs/gl-matrix-2/math/vec3.js";import"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../../../../core/libs/gl-matrix-2/math/vec4.js";import"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../../../../geometry/support/lineSegment.js";import"../../../../../geometry/support/plane.js";import"../../core/shaderLibrary/Laserline.glsl.js";import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/util/blendEmission.glsl.js";import"../../core/shaderModules/Float2PassUniform.js";import"../../core/shaderModules/Float3BindUniform.js";import"../../core/shaderModules/Float3PassUniform.js";import"../../core/shaderModules/Float4PassUniform.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../../../webgl/ShaderBuilder.js";export{b as build,d as defaultAngleCutoff}from"../../../../../chunks/Laserline.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../core/shaderLibrary/Laserline.glsl.js";import"../../core/shaderModules/Float2BindUniform.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4BindUniform.js";import"../../core/shaderModules/Matrix4PassUniform.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/LaserlinePath.glsl.js";
|
|
2
|
+
import"../../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../core/shaderLibrary/Laserline.glsl.js";import"../../core/shaderLibrary/util/blendEmission.glsl.js";import"../../core/shaderModules/Float2BindUniform.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4BindUniform.js";import"../../core/shaderModules/Matrix4PassUniform.js";import"../../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../../chunks/LaserlinePath.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as o}from"tslib";import{
|
|
2
|
+
import{__decorate as o}from"tslib";import{parameter as r}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{EmissiveTechniqueConfiguration as t}from"../../shaders/EmissiveTechniqueConfiguration.js";class e extends t{constructor(){super(...arguments),this.contrastControlEnabled=!1,this.spherical=!1}}o([r()],e.prototype,"contrastControlEnabled",void 0),o([r()],e.prototype,"spherical",void 0);export{e as LaserlinePathTechniqueConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{lerp as t}from"../../../../../core/mathUtils.js";import{disposeMaybe as
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{lerp as t}from"../../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../../core/maybe.js";import{watch as s,syncAndInitial as r,sync as n}from"../../../../../core/reactiveUtils.js";import{secondsFromMilliseconds as o}from"../../../../../core/time.js";import{property as a,subclass as d}from"../../../../../core/accessorSupport/decorators.js";import{getReferenceEllipsoid as c}from"../../../../../geometry/ellipsoidUtils.js";import{getContinuousIndexArray as m}from"../../../../../geometry/support/Indices.js";import{InternalRenderCategory as p}from"../../../webgl.js";import{glLayout as h}from"../../../support/buffer/glUtil.js";import{newLayout as f}from"../../../support/buffer/InterleavedLayout.js";import{TransparentEnvironment as u}from"../TransparentEnvironment.js";import{PrecipitationPassParameters as l,PrecipitationTechnique as _}from"./PrecipitationTechnique.js";import{PrecipitationTechniqueConfiguration as b}from"./PrecipitationTechniqueConfiguration.js";import{VertexArrayObject as y}from"../../lib/VertexArrayObject.js";import{PrimitiveType as P}from"../../../../webgl/enums.js";import{bindVertexBufferLayout as w}from"../../../../webgl/Util.js";import{fromLayout as v}from"../../../../webgl/VertexAttributeLocations.js";import{VertexBuffer as g}from"../../../../webgl/VertexBuffer.js";let j=class extends u{constructor(e){super(e),this._hasSnowCover=!1,this._rainSpeed=.1,this._snowSpeed=.01,this._numParticles=0,this._passParameters=new l,this._configuration=new b,this._forcedTime=null;const{view:t,type:i}=e;this._configuration.type="rainy"===i?0:1,this._passParameters.time=0,this._passParameters.radius=c(t.spatialReference).radius,this.addHandles([s(()=>t.environment.weather,e=>{e.type===i&&this.addHandles([s(()=>e.precipitation,e=>this._adjustParticles(e),r),s(()=>"snowy"===e.type&&"enabled"===e.snowCover,e=>this._hasSnowCover=e,r)])},r)]),this.addHandles(s(()=>t.stage?.renderer.renderContext.bind.clouds.fadeFactor??1,e=>{this._passParameters.opacity=e,1===e&&(this.removeHandles("opacity"),this.addHandles(s(()=>t.stage?.renderer.renderContext.bind.clouds.opacity??1,e=>this._passParameters.opacity=e,r),"opacity"))},n),"opacity")}initialize(){this.addHandles([s(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),r)])}_adjustParticles(e){const i=.35,s=e<.5?t(0,i,2*e):t(i,1,2*(e-.5));this._numParticles=A*s}destroy(){this._numParticles=0,this._vao=i(this._vao),this._instanceIdBuffer=i(this._instanceIdBuffer)}fadeOut(e){this.removeAllHandles(),this.addHandles(s(()=>this.renderContext?.bind.clouds.fadeFactor??1,t=>{this._passParameters.opacity=1-t,1===t&&(this.removeAllHandles(),e())}),"opacity")}get snowCover(){return this._hasSnowCover?this._passParameters.opacity:null}updateAnimation(e){const t=("rainy"===this.type?this._rainSpeed:this._snowSpeed)*o(this._forcedTime??e.time)%1e5;return this._passParameters.time!==t&&(this._passParameters.time=t,!0)}precompile(){this._numParticlesRendered>0&&(this._configuration.hasEmissive=0!==this.bindParameters.emissions,this.techniques.precompile(_,this._configuration))}render(e){const t=e.find(({name:e})=>e===p.TRANSPARENT_ENVIRONMENT);if(this._numParticlesRendered<1)return t;const i=this.renderingContext,s=this.techniques.get(_,this._configuration),r=i.bindTechnique(s,this.bindParameters,this._passParameters);return this._vao??=I(i),i.bindVAO(this._vao),this._bindInstanceIdBuffer(r.locations),r.assertCompatibleVertexAttributeLocations(this._vao,v(x)),i.drawArraysInstanced(P.TRIANGLES,0,3,this._numParticlesRendered),i.unbindBuffer(34962),t}get _numParticlesRendered(){return Math.round(this._numParticles*this._passParameters.opacity)}_bindInstanceIdBuffer(e){const t=this.renderingContext;if(this._instanceIdBuffer)return void t.bindBuffer(this._instanceIdBuffer);const i=m(A);this._instanceIdBuffer=new g(t,x,new Float32Array(i)),w(t,e,this._instanceIdBuffer,0)}get test(){}};function I(e){const t=new Float32Array([-1,0,1,1,0,-1,1,0,1]);return new y(e,new g(e,h(C),t))}e([a({constructOnly:!0})],j.prototype,"type",void 0),j=e([d("esri.views.3d.webgl-engine.effects.precipitation.Precipitation")],j);const A=25e4,C=f().vec3f("position").freeze(),x=h(f().f32("instanceFeatureAttribute"),1);export{j as Precipitation};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{parameter as o
|
|
2
|
+
import{__decorate as e}from"tslib";import{parameter as o}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{EmissiveTechniqueConfiguration as r}from"../../shaders/EmissiveTechniqueConfiguration.js";class t extends r{constructor(){super(...arguments),this.type=0}}e([o({count:2})],t.prototype,"type",void 0);export{t as PrecipitationTechniqueConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{nextPowerOfTwo as t}from"../../../../core/mathUtils.js";import{disposeMaybe as i,destroyMaybe as r}from"../../../../core/maybe.js";import{property as s,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{ortho as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{set as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UNIT_X as d,ZEROS as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as
|
|
2
|
+
import{__decorate as e}from"tslib";import{nextPowerOfTwo as t}from"../../../../core/mathUtils.js";import{disposeMaybe as i,destroyMaybe as r}from"../../../../core/maybe.js";import{property as s,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{ortho as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{set as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UNIT_X as d,ZEROS as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as l}from"../../webgl.js";import{Frustum as m}from"../../state/Frustum.js";import{glLayout as p}from"../../support/buffer/glUtil.js";import{newLayout as _}from"../../support/buffer/InterleavedLayout.js";import f from"../../webgl/RenderCamera.js";import g from"../../webgl/RenderNode.js";import{VertexArrayObject as C}from"./VertexArrayObject.js";import{CutFillMinMaxDepthTechnique as w}from"../shaders/CutFillMinMaxDepthTechnique.js";import{C as x}from"../../../../chunks/CutFillReduction.glsl.js";import{CutFillReductionTechnique as T}from"../shaders/CutFillReductionTechnique.js";import{CutFillReductionTechniqueConfiguration as P}from"../shaders/CutFillReductionTechniqueConfiguration.js";import{C as R}from"../../../../chunks/CutFillTargetDepth.glsl.js";import{CutFillTargetDepthTechnique as b}from"../shaders/CutFillTargetDepthTechnique.js";import{C as y}from"../../../../chunks/CutFillTotalDepth.glsl.js";import{CutFillTotalDepthTechnique as F}from"../shaders/CutFillTotalDepthTechnique.js";import{ImmediateTask as B,TaskPriority as j}from"../../../support/Scheduler.js";import{Yield as E}from"../../../support/Yield.js";import{PrimitiveType as O,DataType as S}from"../../../webgl/enums.js";import{Sync as q}from"../../../webgl/Sync.js";import{VertexBuffer as D}from"../../../webgl/VertexBuffer.js";let v=class extends g{constructor(e){super(e),this.consumes={required:[l.CUTFILL_COMPUTATION,l.TRANSPARENT_NO_DEPTH]},this.produces=l.CUTFILL_COMPUTATION,this.needsRender=!1,this.readyToRun=!1,this.done=!0,this._frameTask=B,this._result=new L,this._localOrigin=u(),this._maxTextureSize=512,this._width=0,this._height=0,this._reducedWidth=0,this._reducedHeight=0,this._depthFormat=14,this._colorFormat=11,this._numChannels=2,this._reductionConfiguration=new P,this._targetDepthParameters=new R,this._depthParameters=new y,this._reductionParameters=new x,this._numReductions=3,this._reductionPasses=0,this._pixelBufferSize=0,this._pixelBufferOffset=0,this._perReductionPixelBufferSize=0}initialize(){this._frameTask=this.view.resourceController.scheduler.registerTask(j.VOLUME_MEASUREMENT,this),this.addHandles(this._frameTask),this._maxTextureSize=Math.min(this._maxTextureSize,this.fboCache.rctx.parameters.maxTextureSize),this._frustum=new m(this.view.renderCoordsHelper)}destroy(){this._targetGeometryVao=i(this._targetGeometryVao),this._sync=r(this._sync),this._pixelBuffer&&(this.gl.deleteBuffer(this._pixelBuffer),this._pixelBuffer=null,this._pixelBufferSize=0)}precompile(){this.view.stage.renderer.precompileCutFillOrthographicReferenceDepth()}render(){const e=this.input;if(!this._orthographicCamera||!this._targetGeometryVao||!this.needsRender||this._sync)return e;const t=this.techniques.getCompiled(b),i=this.techniques.getCompiled(F),r=this.techniques.getCompiled(w);this._reductionConfiguration.reductionPass=0;const s=this.techniques.getCompiled(T,this._reductionConfiguration);this._reductionConfiguration.reductionPass=1;const h=this.techniques.getCompiled(T,this._reductionConfiguration);this._reductionConfiguration.reductionPass=2;const o=this.techniques.getCompiled(T,this._reductionConfiguration);if(!(t&&i&&r&&s&&h&&o))return this.requestRender(1),e;this.needsRender=!1;const n=this.renderingContext,a=this.fboCache,u=this.gl,c=n.getViewport(),l=a.acquire(this._width,this._height,"cutfill reference depth",this._depthFormat);n.bindFramebuffer(l.fbo),n.setViewport(0,0,this._width,this._height),n.clear(1280),this.view.stage.renderer.renderCutFillOrthographicReferenceDepth(this._orthographicCamera);const m=a.acquire(this._width,this._height,"cutfill target depth",this._depthFormat);n.bindFramebuffer(m.fbo),n.setViewport(0,0,this._width,this._height),n.setClearDepth(1),n.clear(256),this._targetDepthParameters.origin=this._localOrigin,this._targetDepthParameters.cutFillCamera=this._orthographicCamera,n.bindTechnique(t,this.bindParameters,this._targetDepthParameters),n.bindVAO(this._targetGeometryVao),n.drawArrays(O.TRIANGLES,0,this._targetGeometryVao.vertexCount("geometry"));const p=a.acquire(this._width,this._height,"cutfill reduction even",this._colorFormat),_=a.acquire(Math.ceil(this._width/2),Math.ceil(this._height/2),"cutfill reduction odd",this._colorFormat);return this._depthParameters.referenceDepth=l.depthTexture,this._depthParameters.targetDepth=m.depthTexture,this._pixelBuffer||(this._pixelBuffer=u.createBuffer()),u.bindBuffer(u.PIXEL_PACK_BUFFER,this._pixelBuffer),u.bufferData(u.PIXEL_PACK_BUFFER,this._pixelBufferSize,u.STREAM_READ),this._prepareFBO(p,this.width,this.height),n.bindTechnique(i,this.bindParameters,this._depthParameters),n.screen.draw(),this._runPyramidReduction(p,_,s),this._prepareFBO(p,this.width,this.height,d),n.bindTechnique(r,this.bindParameters,this._depthParameters),n.screen.draw(),this._runPyramidReduction(p,_,h),this._prepareFBO(p,this.width,this.height),n.bindTechnique(r,this.bindParameters,this._depthParameters),n.screen.draw(),this._runPyramidReduction(p,_,o),l.release(),m.release(),p.release(),_.release(),u.bindBuffer(u.PIXEL_PACK_BUFFER,null),n.setViewport(c.x,c.y,c.width,c.height),this._sync=new q(u),setTimeout(()=>this.readyToRun=!0,0),e}update(e,i){if(!this.done)return;this.done=!1;const r=this.renderingContext,{cameraDimensions:{width:s,height:h},localOriginRenderSpace:o}=e,n=this._maxTextureSize,a=h/s,u=s>h?n:n/a,d=s>h?n*a:n;this._width=t(u),this._height=t(d);const c=[this._width,this._height];this._orthographicCamera=this._createCamera(e,c),this._frustum?.update(this._orthographicCamera),this._updateTargetVao(r,i),this._localOrigin=o,this._reductionPasses=Math.ceil(Math.log2(Math.min(this._width,this._height))),this._reducedWidth=Math.ceil(this._width/2**this._reductionPasses),this._reducedHeight=Math.ceil(this._height/2**this._reductionPasses),this._perReductionPixelBufferSize=this._reducedWidth*this._reducedHeight*this._numChannels*4,this._pixelBufferSize=this._perReductionPixelBufferSize*this._numReductions,this._pixelBufferOffset=0,this.needsRender=!0,this.requestRender(1)}runTask(){if(!this._sync)return void(this.readyToRun=!1);try{if(!this._sync.poll())return E}catch(t){return this.readyToRun=!1,void(this._sync=r(this._sync))}this.readyToRun=!1,this._sync=r(this._sync);const e=this.gl;this._cpuBuffer=new Float32Array(this._pixelBufferSize/4),e.bindBuffer(e.PIXEL_PACK_BUFFER,this._pixelBuffer),e.getBufferSubData(e.PIXEL_PACK_BUFFER,0,this._cpuBuffer),e.bindBuffer(e.PIXEL_PACK_BUFFER,null),this._updateResults(this._cpuBuffer),this.done=!0}getResult(){return this._result}get frustum(){return this._frustum}get width(){return this._width}get height(){return this._height}get updating(){return this.readyToRun||!this.done||this._frameTask.updating}_runPyramidReduction(e,t,i){const r=this.renderingContext,s=this.gl;let h=this._width,o=this._height;for(let n=0;n<this._reductionPasses;n++)h=Math.ceil(h/2),o=Math.ceil(o/2),this._reductionParameters.depthTexture=e.getTexture(),this._prepareFBO(t,h,o),r.bindTechnique(i,this.bindParameters,this._reductionParameters),r.screen.draw(),[e,t]=[t,e];s.readPixels(0,0,h,o,33319,S.FLOAT,this._pixelBufferOffset),this._pixelBufferOffset+=this._perReductionPixelBufferSize}_updateResults(e){const t=new z(0,1,a()),i=new z(0,0,a());for(let r=0;r<this._reducedWidth;r++)for(let s=0;s<this._reducedHeight;s++){let h=(r+s*this._reducedWidth)*this._numChannels;const o=this._reducedWidth*this._reducedHeight*this._numChannels;t.totalDepth+=e[h],i.totalDepth+=e[h+1],h+=o;const n=e[h];n<t.depthExtremum&&(t.depthExtremum=n,V(t.depthExtremumCoords,e[h+1],this._width)),h+=o;const a=e[h];a>i.depthExtremum&&(i.depthExtremum=a,V(i.depthExtremumCoords,e[h+1],this._width))}this._result=new L(this._width,this._height,t,i)}_prepareFBO(e,t,i,r=c){const s=this.renderingContext;s.bindFramebuffer(e.fbo),s.setViewport(0,0,t,i),s.setClearColor(r[0],r[1],r[2],r[3]),s.clear(16384)}_createCamera(e,t){const{cameraPositionRenderSpace:i,localOriginRenderSpace:r,northVector:s,cameraDimensions:{width:h,height:n},cameraNearFar:{near:a,far:u}}=e,d=new f({eye:i,center:r,up:s,near:a,far:u});return d.viewport=[0,0,t[0],t[1]],o(d.projectionMatrix,-h/2,h/2,-n/2,n/2,a,u),d}_updateTargetVao(e,t){this._targetGeometryVao=i(this._targetGeometryVao);const r=t.indices.length,s=M.createBuffer(r),h=s.position,{positions:o,indices:n}=t;for(let i=0;i<n.length;++i){const e=3*n[i];h.set(i,0,o[e]),h.set(i,1,o[e+1]),h.set(i,2,o[e+2])}const a=new D(e,p(M),s.buffer);this._targetGeometryVao=new C(e,a)}};e([s()],v.prototype,"consumes",void 0),e([s()],v.prototype,"produces",void 0),e([s()],v.prototype,"needsRender",void 0),e([s()],v.prototype,"readyToRun",void 0),e([s()],v.prototype,"done",void 0),e([s()],v.prototype,"updating",null),e([s()],v.prototype,"_frameTask",void 0),v=e([h("esri.views.3d.webgl-engine.lib.CutFillComputation")],v);const M=_().vec3f("position").freeze();function V(e,t,i){const r=t%i,s=Math.floor(t/i);n(e,r,s)}class A{constructor(e,t){this.positions=e,this.indices=t}}class z{constructor(e,t,i){this.totalDepth=e,this.depthExtremum=t,this.depthExtremumCoords=i}}class L{constructor(e=0,t=0,i=new z(0,1,a()),r=new z(0,0,a())){this.width=e,this.height=t,this.cut=i,this.fill=r}}export{v as CutFillComputation,L as CutFillComputationResult,z as CutFillDepthResult,A as TargetGeometryRenderInfo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../core/maybe.js";import{watch as
|
|
2
|
+
import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../core/maybe.js";import{watch as i,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as o,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{copy as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{InternalRenderCategory as l}from"../../webgl.js";import{glLayout as n}from"../../support/buffer/glUtil.js";import{newLayout as u}from"../../support/buffer/InterleavedLayout.js";import h from"../../webgl/RenderNode.js";import{VertexArrayObject as c}from"./VertexArrayObject.js";import{C as m}from"../../../../chunks/CutFillComposition.glsl.js";import{CutFillCompositionTechnique as f}from"../shaders/CutFillCompositionTechnique.js";import{C as p}from"../../../../chunks/CutFillMask.glsl.js";import{CutFillMaskTechnique as d}from"../shaders/CutFillMaskTechnique.js";import{DefaultMaterialPassParameters as C,DefaultMaterialDrawParameters as _,DefaultMaterialTechnique as b}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as g}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{EmissiveTechniqueConfiguration as V}from"../shaders/EmissiveTechniqueConfiguration.js";import{DepthStencilAttachment as v,PrimitiveType as T}from"../../../webgl/enums.js";import{noParameters as w}from"../../../webgl/NoParameters.js";import{VertexBuffer as F}from"../../../webgl/VertexBuffer.js";let P=class extends h{constructor(e){super(e),this.consumes={required:[l.CUTFILL_COLOR,l.GROUND_DEPTH]},this.produces=l.CUTFILL_COLOR,this.measureType="cut-fill",this._vaoCut=null,this._vaoFill=null,this._compositeConfiguration=new V,this._maskParameters=new p,this._cutVolumeParameters=new C,this._fillVolumeParameters=new C,this._compositeParameters=new m,this._drawParameters=new _;const t=1===e.view.state.viewingMode;this._cutVolumeConfiguration=new g(t),this._cutVolumeConfiguration.customDepthTest=2,this._cutVolumeConfiguration.writeDepth=!1,this._cutVolumeConfiguration.cullFace=1,this._cutVolumeConfiguration.doubleSidedMode=2,this._fillVolumeConfiguration=new g(t),this._fillVolumeConfiguration.customDepthTest=1,this._fillVolumeConfiguration.cullFace=2}initialize(){this.addHandles([i(()=>[this.cutColor,this.fillColor],()=>this._updateColors(),s),i(()=>this.measureType,()=>this.requestRender(1),s)])}destroy(){this._disposeVaos()}precompile(){this._vaoCut&&this._vaoFill&&("cut-fill"===this.measureType?(this._cutVolumeConfiguration.cullFace=1,this._cutVolumeConfiguration.doubleSidedMode=2):(this._cutVolumeConfiguration.cullFace=0,this._cutVolumeConfiguration.doubleSidedMode=0),this._compositeConfiguration.hasEmissive=0!==this.bindParameters.emissions,this.techniques.precompile(d),this.techniques.precompile(b,this._cutVolumeConfiguration),this.techniques.precompile(b,this._fillVolumeConfiguration),this.techniques.precompile(f,this._compositeConfiguration))}render(e){const t=this.input;if(!this._vaoCut||!this._vaoFill)return t;const i=this._vaoCut.vertexCount("geometry"),s=this._vaoFill.vertexCount("geometry"),o=this.bindParameters,r=o.camera,a=r.fullViewport[2],n=r.fullViewport[3],u=this.renderingContext,h=this.fboCache,c=e.find(({name:e})=>e===l.GROUND_DEPTH),m=h.acquire(a,n,"cutfill color mask",2).attachDepth(c.getAttachment(v));u.bindFramebuffer(m.fbo),u.setClearColor(0,0,0,1),u.clear(17408),u.setViewport(0,0,a,n);const p=this.techniques.get(d);u.bindTechnique(p,o,w,this._maskParameters),u.setFaceCullingEnabled(!1),u.setStencilTestEnabled(!0),u.setStencilOpSeparate(1028,7680,34055,7680),u.setStencilOpSeparate(1029,7680,34056,7680),u.setDepthWriteEnabled(!1),u.bindVAO(this._vaoCut),u.setDepthTestEnabled(!0),u.setStencilWriteMask(255),u.setStencilFunction(519,0,255),u.setColorMask(!1,!1,!1,!1),u.drawArrays(T.TRIANGLES,0,i),u.setDepthTestEnabled(!1),u.setStencilWriteMask(0),u.setStencilFunction(517,0,255),u.setColorMask(!0,!1,!1,!1),u.drawArrays(T.TRIANGLES,0,i),u.bindVAO(this._vaoFill),u.setDepthTestEnabled(!0),u.setStencilWriteMask(255),u.setStencilFunction(519,0,255),u.setColorMask(!1,!0,!1,!1),u.drawArrays(T.TRIANGLES,0,s);const C=h.acquire(a,n,"cutfill color cut volume",5).acquireDepth(14);u.blitFramebuffer(t.fbo,C.fbo,256),u.bindFramebuffer(C.fbo),u.setClearColor(0,0,0,0),u.clear(16384),u.setColorMask(!0,!0,!0,!0);const _=this.techniques.get(b,this._cutVolumeConfiguration);u.bindTechnique(_,this.bindParameters,this._cutVolumeParameters,this._drawParameters),u.bindVAO(this._vaoCut),u.drawArrays(T.TRIANGLES,0,i),C.detachDepth();const g=h.acquire(a,n,"cutfill color fill volume",5).acquireDepth(14);u.blitFramebuffer(t.fbo,g.fbo,256),u.bindFramebuffer(g.fbo),u.clear(16384),u.setColorMask(!0,!0,!0,!0);const V=this.techniques.get(b,this._fillVolumeConfiguration);u.bindTechnique(V,this.bindParameters,this._fillVolumeParameters,this._drawParameters),u.bindVAO(this._vaoFill),u.drawArrays(T.TRIANGLES,0,s),g.detachDepth();const F=t.obtainDepthTexture();u.bindFramebuffer(t.fbo),this._compositeParameters.cutVolume=C.getTexture(),this._compositeParameters.fillVolume=g.getTexture(),this._compositeParameters.mask=m.getTexture(),this._compositeParameters.sceneDepth=F?.attachment,this._compositeParameters.groundDepth=c.getTexture(v),this.borderColor.toUnitRGBA(this._compositeParameters.borderColor);const P=this.techniques.get(f,this._compositeConfiguration);return u.bindTechnique(P,o,this._compositeParameters),u.screen.draw(),t.attachDepth(F),F?.release(),m.release(),C.release(),g.release(),t}enable(){this.produces=l.CUTFILL_COLOR,this.requestRender(1)}disable(){this.produces="disabled",this.requestRender(1)}updateGeometries(e,t,i){this._disposeVaos(),this._vaoCut=this._createVao(e),this._vaoFill=this._createVao(t),this._maskParameters.origin=i,a(this._drawParameters.origin,i),this.requestRender(1)}_updateColors(){this._cutVolumeParameters.diffuse=this.cutColor.toUnitRGB(),this._cutVolumeParameters.opacity=this.cutColor.a,this._fillVolumeParameters.diffuse=this.fillColor.toUnitRGB(),this._fillVolumeParameters.opacity=this.fillColor.a,this.requestRender(1)}_createVao(e){const{vertices:t,normals:i,indicesBottom:s,indicesExtruded:o}=e,r=s.length+o.length,a=this.renderingContext,l=q.createBuffer(r),{position:u,normal:h}=l;let m=0;for(let n=0;n<s.length;n++){const e=3*s[n];u.set(m,0,t[e]),u.set(m,1,t[e+1]),u.set(m,2,t[e+2]),h.set(m,0,i[e]),h.set(m,1,i[e+1]),h.set(m,2,i[e+2]),m++}for(let n=0;n<o.length;n++){const e=3*o[n];u.set(m,0,t[e]),u.set(m,1,t[e+1]),u.set(m,2,t[e+2]),h.set(m,0,i[e]),h.set(m,1,i[e+1]),h.set(m,2,i[e+2]),m++}const f=new F(a,n(q),l.buffer);return new c(a,f)}_disposeVaos(){this._vaoCut=t(this._vaoCut),this._vaoFill=t(this._vaoFill)}};e([o()],P.prototype,"consumes",void 0),e([o()],P.prototype,"produces",void 0),e([o()],P.prototype,"cutColor",void 0),e([o()],P.prototype,"fillColor",void 0),e([o()],P.prototype,"borderColor",void 0),e([o()],P.prototype,"measureType",void 0),P=e([r("esri.views.3d.webgl-engine.lib.CutFillVisualization")],P);const q=u().vec3f("position").vec3f("normal").freeze();class y{constructor(e,t,i,s){this.vertices=e,this.indicesBottom=t,this.indicesExtruded=i,this.normals=s}}export{P as CutFillVisualization,y as VolumeGeometry};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../shaders/ToneMapping.glsl.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{E as EmissionCompositePassParameters,b as build}from"../../../../chunks/EmissionComposite.glsl.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{__decorate as s}from"tslib";import{watch as e,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{RenderNodeOutput as o}from"../../webgl.js";import a from"../../webgl/RenderNode.js";import{E as m}from"../../../../chunks/EmissionComposite.glsl.js";import{EmissionCompositeTechnique as n}from"./EmissionCompositeTechnique.js";import{floatBlendReductionFactor as p}from"../shaders/floatBlendScale.glsl.js";import{ColorAttachment1 as c,SizedPixelFormat as d}from"../../../webgl/enums.js";let h=class extends a{constructor(){super(...arguments),this.produces=o.COMPOSITE,this.consumes={required:[o.COMPOSITE,"emissive"]},this._passParameters=new m}initialize(){this.addHandles([e(()=>0!==this.bindParameters.emissions,s=>this.produces=s?o.COMPOSITE:"disabled",r)])}precompile(){this.techniques.precompile(n)}render(){const s=this.input,e=s.obtainAttachment(c);if(!e?.attachment)return s;this._passParameters.emission=e.attachment,this._passParameters.inputScale=this._passParameters.emission?.descriptor.internalFormat===d.RGBA8?p:1;const r=this.renderingContext,t=this.techniques.get(n);return this.bindRenderTarget(),r.bindTechnique(t,this.bindParameters,this._passParameters),r.screen.draw(),s.attachColor(e,c),e?.release(),s}};s([t()],h.prototype,"produces",void 0),s([t()],h.prototype,"consumes",void 0),h=s([i("esri.views.3d.webgl-engine.lib.EmissionComposite")],h);export{h as EmissionComposite};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{ReloadableShader as r}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../chunks/EmissionComposite.glsl.js";import{makePipelineState as t,add as m,defaultColorWrite as n}from"../../../webgl/renderState.js";let l=class extends o{constructor(){super(...arguments),this.shader=new r(i,()=>import("./EmissionComposite.glsl.js"))}initializePipeline(){return t({colorWrite:n,blending:m})}};l=e([s("esri.views.3d.webgl-engine.lib.EmissionCompositeTechnique")],l);export{l as EmissionCompositeTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{clone as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{
|
|
2
|
+
import{clone as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{IntersectorResultRay as e,isValidIntersectorResult as r}from"./IntersectorResult.js";import{ObjectTarget as s}from"./ObjectTarget.js";class o extends e{constructor(){super(...arguments),this.intersector=1}}class c extends s{constructor(e,r){super(e.object,e.geometryId,e.primitiveIndex),this.center=t(r)}}function i(t){return r(t)&&1===t.intersector&&!!t.target&&"center"in t.target}export{o as HUDIntersectorResult,c as HUDTarget,i as isHUDIntersectorResult};
|