@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 3.5 kB
JavaScript
import{_ as e}from"../../../../chunks/tslib.es6.js";import{ViewingMode as t}from"../../../ViewingMode.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{PBRMode as r}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{WaterDistortionPassParameters as i}from"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import{ReloadableShaderModule as s}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as a}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as n}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{Default3D as p}from"../lib/DefaultVertexAttributeLocations.js";import{blendingDefault as l,oitBlending as u,oitDepthTest as c,oitDepthWrite as h,getOITPolygonOffset as d}from"../lib/OrderIndependentTransparency.js";import{Program as f}from"../lib/Program.js";import{TransparencyPassType as m}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as y}from"./DefaultTechniqueConfiguration.js";import{W as b}from"../../../../chunks/WaterSurface.glsl.js";import{ContextType as g}from"../../../webgl/context-util.js";import{makePipelineState as v,defaultDepthWriteParams as T,defaultColorWriteParams as S}from"../../../webgl/renderState.js";class j extends i{}class P extends a{initializeConfiguration(e,o){o.hasWebGL2Context=e.rctx.type===g.WEBGL2,o.spherical=e.viewingMode===t.Global,o.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result}initializeProgram(e){return new f(e.rctx,P.shader.get().build(this.configuration),p)}_setPipelineState(e){const t=this.configuration,r=e===m.NONE,i=e===m.FrontFace;return v({blending:t.output!==o.Normal&&t.output!==o.Highlight&&t.transparent?r?l:u(e):null,depthTest:{func:c(e)},depthWrite:r?t.writeDepth?T:null:h(e),colorWrite:S,polygonOffset:r||i?null:d(t.enableOffset)})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}}P.shader=new s(b,(()=>import("../shaders/WaterSurface.glsl.js")));class O extends y{constructor(){super(...arguments),this.output=o.Color,this.transparencyPassType=m.NONE,this.spherical=!1,this.receiveShadows=!1,this.hasSlicePlane=!1,this.transparent=!1,this.enableOffset=!0,this.writeDepth=!1,this.hasScreenSpaceReflections=!1,this.doublePrecisionRequiresObfuscation=!1,this.hasCloudsReflections=!1,this.isDraped=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1}}e([n({count:o.COUNT})],O.prototype,"output",void 0),e([n({count:m.COUNT})],O.prototype,"transparencyPassType",void 0),e([n()],O.prototype,"spherical",void 0),e([n()],O.prototype,"receiveShadows",void 0),e([n()],O.prototype,"hasSlicePlane",void 0),e([n()],O.prototype,"transparent",void 0),e([n()],O.prototype,"enableOffset",void 0),e([n()],O.prototype,"writeDepth",void 0),e([n()],O.prototype,"hasScreenSpaceReflections",void 0),e([n()],O.prototype,"doublePrecisionRequiresObfuscation",void 0),e([n()],O.prototype,"hasCloudsReflections",void 0),e([n()],O.prototype,"isDraped",void 0),e([n()],O.prototype,"hasMultipassTerrain",void 0),e([n()],O.prototype,"cullAboveGround",void 0),e([n({constValue:r.Water})],O.prototype,"pbrMode",void 0),e([n({constValue:!0})],O.prototype,"useCustomDTRExponentForWater",void 0),e([n({constValue:!0})],O.prototype,"highStepCount",void 0),e([n({constValue:!1})],O.prototype,"useFillLights",void 0);export{j as WaterMaterialPassParameters,P as WaterTechnique,O as WaterTechniqueConfiguration};