UNPKG

@arcgis/core

Version:

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

16 lines (15 loc) 2.61 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{ShaderOutput as e}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as r}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as i}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{ObjectAndLayerIdColor as o}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{terrainDepthTest as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ColorConversion as t}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as a}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{FloatPassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{If as n,glsl as d}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{VertexAttribute as m}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{outputColorHighlightOID as v}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{NoParameters as c}from"../views/webgl/NoParameters.js";import{ShaderBuilder as p}from"../views/webgl/ShaderBuilder.js";class u extends c{}function w(c){const u=new p,{vertex:w,fragment:b,varyings:f}=u,{output:h,perspectiveInterpolation:j}=c;return a(w,c),u.include(i,c),u.include(s,c),u.fragment.include(r,c),u.include(o,c),u.include(v,c),u.attributes.add(m.POSITION,"vec3"),u.attributes.add(m.UV0,"vec2"),j&&u.attributes.add(m.PERSPECTIVEDIVIDE,"float"),w.main.add(d` vpos = position; forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz); vTexCoord = uv0; gl_Position = transformPosition(proj, view, vpos); ${n(j,"gl_Position *= perspectiveDivide;")}`),f.add("vpos","vec3",{invariant:!0}),f.add("vTexCoord","vec2"),b.include(t),b.uniforms.add(new l("opacity",(e=>e.opacity)),new g("tex",(e=>e.glTexture))).main.add(d` discardBySlice(vpos); discardByTerrainDepth(); ${n(h===e.ObjectAndLayerIdColor,"fragColor = vec4(0, 0, 0, 1); return;")} vec4 finalColor = texture(tex, vTexCoord) * opacity; outputColorHighlightOID(finalColor, vpos, finalColor.rgb);`),u}const b=Object.freeze(Object.defineProperty({__proto__:null,ImageMaterialPassParameters:u,build:w},Symbol.toStringTag,{value:"Module"}));export{b as I,u as a,w as b};