UNPKG

@doegis/core

Version:

DOE GIS API

3 lines (1 loc) 2.62 kB
import{ShaderOutput as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{blendingDefault as r,oitBlending as n,oitDepthTest as l,oitDepthWrite as s}from"../lib/OrderIndependentTransparency.js";import{Program as o}from"../lib/Program.js";import{RenderSlot as a}from"../lib/RenderSlot.js";import{stencilWriteMaskOn as c,stencilToolMaskBaseParams as p,stencilBaseAllZerosParams as u,depthCompareAlways as d,stencilToolTransparentOccluderParams as h,stencilWriteMaskOff as T,stencilToolMaskOccluderParams as m,depthCompareLess as P}from"../lib/StencilUtils.js";import{TransparencyPassType as f}from"../lib/TransparencyPassType.js";import{VertexAttribute as g}from"../lib/VertexAttribute.js";import{L as O}from"../../../../chunks/LineMarker.glsl.js";import{makePipelineState as S,defaultDepthWriteParams as A,defaultColorWriteParams as E}from"../../../webgl/renderState.js";const R=new Map([[g.POSITION,0],[g.UV0,2],[g.AUXPOS1,3],[g.NORMAL,4],[g.COLOR,5],[g.COLORFEATUREATTRIBUTE,5],[g.SIZE,6],[g.SIZEFEATUREATTRIBUTE,6],[g.OPACITYFEATUREATTRIBUTE,7]]);class b extends i{initializeProgram(e){return new o(e.rctx,b.shader.get().build(this.configuration),R)}_makePipelineState(t,i){const o=this.configuration,a=t===f.NONE;return S({blending:o.output===e.Color||o.output===e.Alpha?a?r:n(t):null,depthTest:{func:l(t)},depthWrite:a?o.writeDepth?A:null:s(t),colorWrite:E,stencilWrite:o.hasOccludees?c:null,stencilTest:o.hasOccludees?i?p:u:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(){return this.configuration.occluder&&(this._occluderPipelineTransparent=S({blending:r,depthTest:d,depthWrite:null,colorWrite:E,stencilWrite:null,stencilTest:h}),this._occluderPipelineOpaque=S({blending:r,depthTest:d,depthWrite:null,colorWrite:E,stencilWrite:T,stencilTest:m}),this._occluderPipelineMaskWrite=S({blending:null,depthTest:P,depthWrite:null,colorWrite:null,stencilWrite:c,stencilTest:p})),this._occludeePipelineState=this._makePipelineState(this.configuration.transparencyPassType,!0),this._makePipelineState(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:this.configuration.occluder?e===a.TRANSPARENT_OCCLUDER_MATERIAL?this._occluderPipelineTransparent:e===a.OCCLUDER_MATERIAL?this._occluderPipelineOpaque:this._occluderPipelineMaskWrite:super.getPipelineState(e,t)}}b.shader=new t(O,(()=>import("./LineMarker.glsl.js")));export{b as LineMarkerTechnique,R as vertexAttributeLocations};