/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{AlignPixel as e}from"./AlignPixel.glsl.js";import{terrainDepthTest as o}from"../shading/TerrainDepthTest.glsl.js";import{glsl as r}from"../../shaderModules/glsl.js";function i(i,t){const{vertex:s,fragment:p}=i;i.include(o,t),s.include(e),s.main.add(r`vec4 posProjCenter;
if (dot(position, position) > 0.0) {
ProjectHUDAux projectAux;
vec4 posProj = projectPositionHUD(projectAux);
posProjCenter = alignToPixelCenter(posProj, viewport.zw);
forwardViewPosDepth(projectAux.posView);
vec3 vpos = projectAux.posModel;
if (rejectBySlice(vpos)) {
posProjCenter = vec4(1e038, 1e038, 1e038, 1.0);
}
} else {
posProjCenter = vec4(1e038, 1e038, 1e038, 1.0);
}
gl_Position = posProjCenter;
gl_PointSize = 1.0;`),p.main.add(r`fragColor = vec4(1);
if(discardByTerrainDepth()) {
fragColor.g = 0.5;
}`)}export{i as HUDOcclusionPass};
