@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
17 lines (16 loc) • 1.71 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
*/
import{create as e}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{HighlightCellGridScreenSpacePass as r}from"../views/3d/webgl-engine/core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js";import{Float2DrawUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Float2DrawUniform.js";import{glsl as i}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DDrawUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js";import{NoParameters as s}from"../views/webgl/NoParameters.js";import{ShaderBuilder as u}from"../views/webgl/ShaderBuilder.js";class n extends s{constructor(){super(...arguments),this.blurSize=e()}}function o(){const e=new u;return e.include(r),e.outputs.add("fragSingleHighlight","vec2",0),e.fragment.uniforms.add(new t("blurSize",(e=>e.blurSize)),new l("blurInput",(e=>e.blurInput))).main.add(i`vec2 highlightTextureSize = vec2(textureSize(blurInput,0));
vec2 center = texture(blurInput, sUV).rg;
if (vOutlinePossible == 0.0) {
fragSingleHighlight = center;
} else {
vec2 sum = center * 0.204164;
sum += texture(blurInput, sUV + blurSize * 1.407333).rg * 0.304005;
sum += texture(blurInput, sUV - blurSize * 1.407333).rg * 0.304005;
sum += texture(blurInput, sUV + blurSize * 3.294215).rg * 0.093913;
sum += texture(blurInput, sUV - blurSize * 3.294215).rg * 0.093913;
fragSingleHighlight = sum;
}`),e}const g=Object.freeze(Object.defineProperty({__proto__:null,SingleHighlightBlurDrawParameters:n,build:o},Symbol.toStringTag,{value:"Module"}));export{n as S,g as a,o as b};