@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 3.39 kB
JavaScript
import{_ as e}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as o}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as i}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as s}from"../lib/basicInterfaces.js";import{blendingDefault as n,oitBlending as a,oitDepthTest as p,oitDepthWrite as l,getOITPolygonOffset as c}from"../lib/OrderIndependentTransparency.js";import{Program as u}from"../lib/Program.js";import{stencilWriteMaskOn as h,stencilToolMaskBaseParams as d,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{TransparencyPassType as m}from"../lib/TransparencyPassType.js";import{VertexAttribute as y}from"../lib/VertexAttribute.js";import{DefaultTechniqueConfiguration as O}from"../materials/DefaultTechniqueConfiguration.js";import{Style as P}from"../materials/PatternStyle.js";import{P as g}from"../../../../chunks/Pattern.glsl.js";import{ContextType as T}from"../../../webgl/context-util.js";import{makePipelineState as b,cullingParams as S,defaultDepthWriteParams as j,defaultColorWriteParams as v}from"../../../webgl/renderState.js";class C extends r{initializeConfiguration(e,t){t.hasWebGL2Context=e.rctx.type===T.WEBGL2}initializeProgram(e){return new u(e.rctx,C.shader.get().build(this.configuration),w)}_setPipelineState(e,o){const r=this.configuration,i=e===m.NONE,s=e===m.FrontFace;return b({blending:r.output===t.Color||r.output===t.Alpha?i?n:a(e):null,culling:S(r.cullFace),depthTest:{func:p(e)},depthWrite:i?r.writeDepth?j:null:l(e),colorWrite:v,stencilWrite:r.hasOccludees?h:null,stencilTest:r.hasOccludees?o?d:f:null,polygonOffset:i||s?r.polygonOffset?N:null:c(r.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._setPipelineState(this.configuration.transparencyPassType,!0),this._setPipelineState(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}C.shader=new o(g,(()=>import("./Pattern.glsl.js")));const N={factor:1,units:1};class x extends O{constructor(){super(...arguments),this.output=t.Color,this.cullFace=s.None,this.transparencyPassType=m.NONE,this.hasSlicePlane=!1,this.hasVertexColors=!1,this.polygonOffset=!1,this.writeDepth=!0,this.hasOccludees=!1,this.enableOffset=!0,this.hasMultipassTerrain=!1,this.cullAboveGround=!1}}e([i({count:t.COUNT})],x.prototype,"output",void 0),e([i({count:s.COUNT})],x.prototype,"cullFace",void 0),e([i({count:P.COUNT})],x.prototype,"style",void 0),e([i({count:m.COUNT})],x.prototype,"transparencyPassType",void 0),e([i()],x.prototype,"hasSlicePlane",void 0),e([i()],x.prototype,"hasVertexColors",void 0),e([i()],x.prototype,"polygonOffset",void 0),e([i()],x.prototype,"writeDepth",void 0),e([i()],x.prototype,"hasOccludees",void 0),e([i()],x.prototype,"patternSpacing",void 0),e([i()],x.prototype,"lineWidth",void 0),e([i()],x.prototype,"enableOffset",void 0),e([i()],x.prototype,"draped",void 0),e([i()],x.prototype,"hasMultipassTerrain",void 0),e([i()],x.prototype,"cullAboveGround",void 0);const w=new Map([[y.POSITION,0],[y.COLOR,3],[y.UVMAPSPACE,4],[y.BOUNDINGRECT,5]]);export{C as PatternTechnique,x as PatternTechniqueConfiguration,w as vertexAttributeLocations};