UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

10 lines (9 loc) 1.91 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepth as r}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{RgbaFloatEncoding as o}from"../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{Float2BindUniform as a}from"../views/3d/webgl-engine/core/shaderModules/Float2BindUniform.js";import{FloatPassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as t}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{BlitMode as s}from"../views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js";import{NoParameters as l}from"../views/webgl/NoParameters.js";import{ShaderBuilder as d}from"../views/webgl/ShaderBuilder.js";class m extends l{constructor(){super(...arguments),this.opacity=1}}function g(l){const m=new d;m.include(e),m.fragment.uniforms.add(new n("tex",(e=>e.texture))),l.hasOpacityFactor&&m.fragment.uniforms.add(new i("opacity",(e=>e.opacity)));const g=l.blitMode===s.Depth;return g&&(m.fragment.uniforms.add(new a("nearFar",(e=>e.camera.nearFar))),m.fragment.include(r),m.fragment.include(o)),m.fragment.main.add(t` ${g?t` float normalizedLinearDepth = (-linearDepthFromTexture(tex, uv) - nearFar[0]) / (nearFar[1] - nearFar[0]); fragColor = float2rgba(normalizedLinearDepth);`:t` fragColor = texture(tex, uv) ${l.hasOpacityFactor?"* opacity":""};`}`),m}const c=Object.freeze(Object.defineProperty({__proto__:null,CompositingPassParameters:m,build:g},Symbol.toStringTag,{value:"Module"}));export{m as C,c as a,g as b};