@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 1.76 kB
JavaScript
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{Default3D as r}from"../lib/DefaultVertexAttributeLocations.js";import{Program as l}from"../lib/Program.js";import{depthCompareLess as n,stencilWriteMaskOn as o,stencilToolMaskBaseParams as s,stencilBaseAllZerosParams as a}from"../lib/StencilUtils.js";import{N as u}from"../../../../chunks/NativeLine.glsl.js";import{ContextType as p}from"../../../webgl/context-util.js";import{BlendFactor as c,PrimitiveType as h}from"../../../webgl/enums.js";import{separateBlendingParams as m,makePipelineState as d,defaultColorWriteParams as g,defaultDepthWriteParams as b}from"../../../webgl/renderState.js";class f extends i{get _stippleEnabled(){return this.configuration.stippleEnabled&&this.configuration.output!==e.Highlight}initializeConfiguration(e,t){t.hasWebGL2Context=e.rctx.type===p.WEBGL2}initializeProgram(e){return new l(e.rctx,f.shader.get().build(this.configuration),r)}initializePipeline(){const t=this.configuration,i=m(c.SRC_ALPHA,c.ONE,c.ONE_MINUS_SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA),r=(e,i=null,r=null)=>d({blending:i,depthTest:n,depthWrite:r,colorWrite:g,stencilWrite:t.hasOccludees?o:null,stencilTest:t.hasOccludees?e?s:a:null});return t.output===e.Color?(this._occludeePipelineState=r(!0,t.transparent||this._stippleEnabled?i:null,b),r(!1,t.transparent||this._stippleEnabled?i:null,b)):r(!1)}get primitiveType(){return h.LINES}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}f.shader=new t(u,(()=>import("./NativeLine.glsl.js")));export{f as NativeLineTechnique};