@arcgis/core 4.24.0-next.20220401 → 4.24.0-next.20220404
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{c665e9b7d09fe516f138.js → 2fe10c5c01056babeae5.js} +1 -1
- package/assets/esri/core/workers/chunks/{8771296b537f366596c4.js → 37aa4532e25d54055e40.js} +54 -54
- package/assets/esri/core/workers/chunks/528033aa0d663b4d41bf.js +1 -0
- package/assets/esri/core/workers/chunks/{0e29250c24a3a7b1ce13.js → 6de5a790c14f04c6c302.js} +1 -1
- package/assets/esri/core/workers/chunks/b1188ca77b975c6a7d92.js +1 -0
- package/chunks/BlendLayers.glsl.js +1 -1
- package/chunks/DefaultMaterial.glsl.js +26 -26
- package/chunks/HUDMaterial.glsl.js +37 -37
- package/chunks/HighlightDownsample.glsl.js +1 -1
- package/chunks/ImageMaterial.glsl.js +10 -10
- package/chunks/LineMarker.glsl.js +75 -32
- package/chunks/RealisticTree.glsl.js +26 -26
- package/chunks/SMAA.glsl.js +2 -2
- package/chunks/SSAO.glsl.js +2 -2
- package/chunks/SimpleAtmosphere.glsl.js +10 -10
- package/chunks/TextureOnly.glsl.js +2 -2
- package/core/accessorSupport/Property.js +1 -1
- package/interfaces.d.ts +25 -7
- package/package.json +1 -1
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/dotDensity.js +1 -1
- package/smartMapping/renderers/heatmap.js +1 -1
- package/smartMapping/renderers/location.js +1 -1
- package/smartMapping/renderers/predominance.js +1 -1
- package/smartMapping/renderers/relationship.js +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/type.js +1 -1
- package/smartMapping/symbology/color.js +1 -1
- package/smartMapping/symbology/dotDensity.js +1 -1
- package/smartMapping/symbology/flow.js +1 -1
- package/smartMapping/symbology/heatmap.js +1 -1
- package/smartMapping/symbology/location.js +1 -1
- package/smartMapping/symbology/predominance.js +1 -1
- package/smartMapping/symbology/relationship.js +1 -1
- package/smartMapping/symbology/size.js +1 -1
- package/smartMapping/symbology/type.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/flow/BrushFlow.js +1 -1
- package/views/2d/engine/imagery/BrushRasterBitmap.js +1 -1
- package/views/2d/engine/imagery/BrushVectorField.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/brushes/BrushBitmap.js +1 -1
- package/views/2d/engine/webgl/brushes/BrushClip.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushInfo.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushStencil.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushVTLBackground.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushVTLCircle.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushVTLFill.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushVTLLine.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushFill.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushLabel.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushLine.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushMarker.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushText.js +1 -1
- package/views/2d/engine/webgl/effects/post-processing/EffectManager.js +1 -1
- package/views/3d/environment/CloudsComposition.js +1 -1
- package/views/3d/environment/PanoramicAtmosphere.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.glsl.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.js +1 -1
- package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
- package/views/3d/webgl-engine/core/material/RenderTexture.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +12 -12
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +7 -7
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +4 -9
- package/views/3d/webgl-engine/core/shaderModules/BooleanUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Float2Uniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Float4Uniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Float4sUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/FloatUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/FloatsUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/IntegerUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Matrix3Uniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Texture2DUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Uniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/BindType.js +1 -1
- package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/Program.js +1 -1
- package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/MapView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/support/screenshotUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/assets/esri/core/workers/chunks/5682039666f874836451.js +0 -1
- package/assets/esri/core/workers/chunks/79bdb26244ec7b4472fe.js +0 -1
- package/chunks/color.js +0 -5
- package/chunks/dotDensity.js +0 -5
- package/chunks/heatmap.js +0 -5
- package/chunks/location.js +0 -5
- package/chunks/predominance.js +0 -5
- package/chunks/relationship.js +0 -5
- package/chunks/size.js +0 -5
- package/chunks/type.js +0 -5
- package/renderers/smartMapping/creators/color.js +0 -5
- package/renderers/smartMapping/creators/dotDensity.js +0 -5
- package/renderers/smartMapping/creators/heatmap.js +0 -5
- package/renderers/smartMapping/creators/location.js +0 -5
- package/renderers/smartMapping/creators/opacity.js +0 -5
- package/renderers/smartMapping/creators/predominance.js +0 -5
- package/renderers/smartMapping/creators/relationship.js +0 -5
- package/renderers/smartMapping/creators/size.js +0 -5
- package/renderers/smartMapping/creators/support/utils.js +0 -5
- package/renderers/smartMapping/creators/type.js +0 -5
- package/renderers/smartMapping/creators/univariateColorSize.js +0 -5
- package/renderers/smartMapping/heuristics/scaleRange.js +0 -5
- package/renderers/smartMapping/heuristics/sizeRange.js +0 -5
- package/renderers/smartMapping/statistics/classBreaks.js +0 -5
- package/renderers/smartMapping/statistics/heatmapStatistics.js +0 -5
- package/renderers/smartMapping/statistics/histogram.js +0 -5
- package/renderers/smartMapping/statistics/predominantCategories.js +0 -5
- package/renderers/smartMapping/statistics/summaryStatistics.js +0 -5
- package/renderers/smartMapping/statistics/summaryStatisticsForAge.js +0 -5
- package/renderers/smartMapping/statistics/support/ageUtils.js +0 -5
- package/renderers/smartMapping/statistics/uniqueValues.js +0 -5
- package/renderers/smartMapping/symbology/color.js +0 -5
- package/renderers/smartMapping/symbology/dotDensity.js +0 -5
- package/renderers/smartMapping/symbology/heatmap.js +0 -5
- package/renderers/smartMapping/symbology/location.js +0 -5
- package/renderers/smartMapping/symbology/predominance.js +0 -5
- package/renderers/smartMapping/symbology/relationship.js +0 -5
- package/renderers/smartMapping/symbology/size.js +0 -5
- package/renderers/smartMapping/symbology/support/colorRamps.js +0 -5
- package/renderers/smartMapping/symbology/support/utils.js +0 -5
- package/renderers/smartMapping/symbology/type.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clamp as e}from"../../../../core/mathUtils.js";import{isSome as t}from"../../../../core/maybe.js";import{f as r}from"../../../../chunks/mat3.js";import{c as s}from"../../../../chunks/mat3f64.js";import{a as i}from"../../../../chunks/mat4.js";import{c as n}from"../../../../chunks/mat4f64.js";import{c as a}from"../../../../chunks/vec2.js";import{a as o,f as c}from"../../../../chunks/vec2f64.js";import{s as l,m as f,n as u,b as p,g as h,c as m,l as d,i as g,t as S,e as O,a as v}from"../../../../chunks/vec3.js";import{c as A,f as P}from"../../../../chunks/vec3f64.js";import{c as b}from"../../../../chunks/vec4f64.js";import{isMat4 as x}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as C}from"../../../../geometry/support/aaBoundingRect.js";import{newLayout as y}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as I}from"../core/shaderLibrary/ShaderOutputOptions.js";import{HUDSpace as z}from"../core/shaderLibrary/hud/HUD.glsl.js";import{computeAttachmentOriginPoints as T}from"../lib/geometryDataUtils.js";import{GLTextureMaterial as _}from"../lib/GLTextureMaterial.js";import{Material as M,DefaultMaterialParameters as j}from"../lib/Material.js";import{RenderSlot as U}from"../lib/RenderSlot.js";import{applyScaleFactor as q,applyPrecomputedScaleFactor as w,precomputeScaleFactor as D}from"../lib/screenSizePerspectiveUtils.js";import{assert as L}from"../lib/Util.js";import{VertexAttribute as E}from"../lib/VertexAttribute.js";import{writePosition as R,writeNormal as V,writeColor as N,writeBufferVec4 as G}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as H}from"./internal/MaterialUtil.js";import{isInstanceHidden as B}from"./renderers/utils.js";import{c as X}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as k,HUDMaterialColorTechnique as F}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as W}from"../shaders/HUDMaterialTechniqueConfiguration.js";class Z extends M{constructor(e){super(e,Se),this.techniqueConfig=new W}getConfiguration(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.hasSlicePlane=this.parameters.hasSlicePlane,this.techniqueConfig.hasVerticalOffset=!!this.parameters.verticalOffset,this.techniqueConfig.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this.techniqueConfig.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits?z.Screen:z.World,this.techniqueConfig.hasPolygonOffset=this.parameters.polygonOffset,this.techniqueConfig.isDraped=this.parameters.isDraped,this.techniqueConfig.occlusionTestEnabled=this.parameters.occlusionTest,this.techniqueConfig.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this.techniqueConfig.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this.techniqueConfig.vvSize=!!this.parameters.vvSizeEnabled,this.techniqueConfig.vvColor=!!this.parameters.vvColorEnabled,e===I.Color&&(this.techniqueConfig.debugDrawLabelBorder=!!this.parameters.debugDrawLabelBorder),e===I.Highlight&&(this.techniqueConfig.binaryHighlightOcclusionEnabled=this.parameters.binaryHighlightOcclusion),this.techniqueConfig.depthEnabled=this.parameters.depthEnabled,this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.hasMultipassGeometry=t.multipassGeometry.enabled,this.techniqueConfig.hasMultipassTerrain=t.multipassTerrain.enabled,this.techniqueConfig.cullAboveGround=t.multipassTerrain.cullAboveGround,this.techniqueConfig}intersect(e,r,s,i,n,a,o,c,l){t(l)?this._intersectDrapedHudGeometry(e,a,o,c,l):this._intersectHudGeometry(e,r,s,i,o,c)}_intersectDrapedHudGeometry(e,r,s,i,n){const a=e.vertexAttributes.get(E.POSITION),o=e.vertexAttributes.get(E.SIZE),c=this.parameters,l=X(c);let f=1,u=1;if(t(i)){const e=i(pe);f=e[0],u=e[5]}f*=e.screenToWorldRatio,u*=e.screenToWorldRatio;const p=me*e.screenToWorldRatio;for(let t=0;t<a.data.length/a.size;t++){const i=t*a.size,h=a.data[i],m=a.data[i+1],d=t*o.size;let g;de[0]=o.data[d]*f,de[1]=o.data[d+1]*u,c.textureIsSignedDistanceField&&(g=c.outlineSize*e.screenToWorldRatio/2),$(r,h,m,de,p,g,c,l)&&s(n.dist,n.normal,-1,!1)}}_intersectHudGeometry(e,s,n,a,o,c){if(!a.options.selectionMode||!a.options.hud||B(s))return;const S=this.parameters;let O=1,v=1;if(r(oe,n),t(c)){const e=c(pe);O=e[0],v=e[5],Y(oe)}const P=e.vertexAttributes.get(E.POSITION),b=e.vertexAttributes.get(E.SIZE),x=e.vertexAttributes.get(E.NORMAL),C=e.vertexAttributes.get(E.AUXPOS1);L(P.size>=3);const y=a.point,I=a.camera,z=X(S);O*=I.pixelRatio,v*=I.pixelRatio;const T="screen"===this.parameters.centerOffsetUnits;for(let t=0;t<P.data.length/P.size;t++){const e=t*P.size;l(re,P.data[e],P.data[e+1],P.data[e+2]),f(re,re,n);const r=t*b.size;de[0]=b.data[r]*O,de[1]=b.data[r+1]*v,f(re,re,I.viewMatrix);const s=t*C.size;if(l(fe,C.data[s+0],C.data[s+1],C.data[s+2]),!T&&(re[0]+=fe[0],re[1]+=fe[1],0!==fe[2])){const e=fe[2];u(fe,re),p(re,re,h(fe,fe,e))}const c=t*x.size;if(l(se,x.data[c],x.data[c+1],x.data[c+2]),this._normalAndViewAngle(se,oe,I,ue),this._applyVerticalOffsetTransformationView(re,ue,I,ee),I.applyProjection(re,ie),ie[0]>-1){ie[0]=Math.floor(ie[0]),ie[1]=Math.floor(ie[1]),T&&(fe[0]||fe[1])&&(ie[0]+=fe[0],0!==fe[1]&&(ie[1]+=q(fe[1],ee.factorAlignment)),I.unapplyProjection(ie,re)),ie[0]+=this.parameters.screenOffset[0],ie[1]+=this.parameters.screenOffset[1],w(de,ee.factor,de);const e=he*I.pixelRatio;let t;if(S.textureIsSignedDistanceField&&(t=S.outlineSize*I.pixelRatio/2),$(y,ie[0],ie[1],de,e,t,S,z)){const e=a.ray;if(f(ae,re,i(le,I.viewMatrix)),ie[0]=y[0],ie[1]=y[1],I.unprojectFromRenderScreen(ie,re)){const t=A();m(t,e.direction);const r=1/d(t);h(t,t,r);o(g(e.origin,re)*r,t,-1,!0,1,ae)}}}}}computeAttachmentOrigin(e,t){const r=e.vertexAttributes;if(!r)return!1;const s=r.get(E.POSITION),i=e.indices.get(E.POSITION);return T(s,i,t)}createBufferWriter(){return new ve(this)}_normalAndViewAngle(e,t,s,i){return x(t)&&(t=r(ce,t)),S(i.normal,e,t),f(i.normal,i.normal,s.viewInverseTransposeMatrix),i.cosAngle=O(ne,ge),i}_updateScaleInfo(e,t,r){const s=this.parameters;s.screenSizePerspective?D(r,t,s.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minPixelSize=0,e.factor.paddingPixels=0),s.screenSizePerspectiveAlignment?D(r,t,s.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minPixelSize=e.factor.minPixelSize,e.factorAlignment.paddingPixels=e.factor.paddingPixels)}applyShaderOffsetsView(e,t,r,s,i,n,a){const o=this._normalAndViewAngle(t,r,i,ue);return this._applyVerticalGroundOffsetView(e,o,i,a),this._applyVerticalOffsetTransformationView(a,o,i,n),this._applyPolygonOffsetView(a,o,s[3],i,a),this._applyCenterOffsetView(a,s,a),a}applyShaderOffsetsNDC(e,r,s,i,n){return this._applyCenterOffsetNDC(e,r,s,i),t(n)&&m(n,i),this._applyPolygonOffsetNDC(i,r,s,i),i}_applyPolygonOffsetView(t,r,s,i,n){const a=i.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=a);const c=a*o;if(this.parameters.shaderPolygonOffset<=0)return m(n,t);const l=e(Math.abs(r.cosAngle),.01,1),f=1-Math.sqrt(1-l*l)/l/i.viewport[2];return h(n,t,c>0?f:1/f),n}_applyVerticalGroundOffsetView(e,t,r,s){const i=d(e),n=r.aboveGround?1:-1,a=.5*r.computeRenderPixelSizeAtDist(i),o=h(re,t.normal,n*a);return v(s,e,o),s}_applyVerticalOffsetTransformationView(e,t,r,s){const i=this.parameters;if(!i.verticalOffset||!i.verticalOffset.screenLength){if(i.screenSizePerspective||i.screenSizePerspectiveAlignment){const r=d(e);this._updateScaleInfo(s,r,t.cosAngle)}else s.factor.scale=1,s.factorAlignment.scale=1;return e}const n=d(e),a=i.screenSizePerspectiveAlignment||i.screenSizePerspective,o=H(r,n,i.verticalOffset,t.cosAngle,a);return this._updateScaleInfo(s,n,t.cosAngle),h(t.normal,t.normal,o),v(e,e,t.normal)}_applyCenterOffsetView(e,t,r){const s="screen"!==this.parameters.centerOffsetUnits;return r!==e&&m(r,e),s&&(r[0]+=t[0],r[1]+=t[1],t[2]&&(u(se,r),v(r,r,h(se,se,t[2])))),r}_applyCenterOffsetNDC(e,t,r,s){const i="screen"!==this.parameters.centerOffsetUnits;return s!==e&&m(s,e),i||(s[0]+=t[0]/r.fullWidth*2,s[1]+=t[1]/r.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,r,s){const i=this.parameters.shaderPolygonOffset;if(e!==s&&m(s,e),i){const e=r.aboveGround?1:-1,n=e*Math.sign(t[3]);s[2]-=(n||e)*i}return s}requiresSlot(e){if(e===U.DRAPED_MATERIAL)return!0;const{drawInSecondSlot:t,occlusionTest:r}=this.parameters;return e===(t?U.LABEL_MATERIAL:U.HUD_MATERIAL)||r&&e===U.OCCLUSION_PIXELS}createGLMaterial(e){return e.output===I.Color||e.output===I.Alpha?new K(e):e.output===I.Highlight?new J(e):null}calculateRelativeScreenBounds(e,t,r=C()){return Q(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class J extends _{constructor(e){super({...e,...e.material.parameters})}_updateParameters(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.passParameters),this.selectProgram(e)}selectProgram(e){return this.ensureTechnique(k,e)}beginSlot(e){return this._updateParameters(e)}}class K extends J{_isOcclusionSlot(e){return e.slot===U.OCCLUSION_PIXELS&&this._material.parameters.occlusionTest&&(this._output===I.Color||this._output===I.Alpha)}selectProgram(e){return this.ensureTechnique(F,e,this._isOcclusionSlot(e)?I.Occlusion:this._output)}}function Q(e,t,r,s=te){return a(s,e.anchorPosition),s[0]*=-t[0],s[1]*=-t[1],s[0]+=e.screenOffset[0]*r,s[1]+=e.screenOffset[1]*r,s}function Y(e){const t=e[0],r=e[1],s=e[2],i=e[3],n=e[4],a=e[5],o=e[6],c=e[7],l=e[8],f=1/Math.sqrt(t*t+r*r+s*s),u=1/Math.sqrt(i*i+n*n+a*a),p=1/Math.sqrt(o*o+c*c+l*l);return e[0]=t*f,e[1]=r*f,e[2]=s*f,e[3]=i*u,e[4]=n*u,e[5]=a*u,e[6]=o*p,e[7]=c*p,e[8]=l*p,e}function $(e,t,r,s,i,n,a,o){let c=t-i-(o[0]>0?s[0]*o[0]:0),l=c+s[0]+2*i,f=r-i-(o[1]>0?s[1]*o[1]:0),u=f+s[1]+2*i;if(a.textureIsSignedDistanceField){const e=a.distanceFieldBoundingBox;c+=s[0]*e[0],f+=s[1]*e[1],l-=s[0]*(1-e[2]),u-=s[1]*(1-e[3]),c-=n,l+=n,f-=n,u+=n}return e[0]>c&&e[0]<l&&e[1]>f&&e[1]<u}const ee={factor:{scale:0,factor:0,minPixelSize:0,paddingPixels:0},factorAlignment:{scale:0,factor:0,minPixelSize:0,paddingPixels:0}},te=o(),re=A(),se=A(),ie=b(),ne=A(),ae=A(),oe=s(),ce=s(),le=n(),fe=A(),ue={normal:ne,cosAngle:0},pe=n(),he=1,me=2,de=[0,0],ge=P(0,0,1),Se={texCoordScale:[1,1],occlusionTest:!0,binaryHighlightOcclusion:!0,drawInSecondSlot:!1,color:[1,1,1,1],outlineColor:[1,1,1,1],outlineSize:0,textureIsSignedDistanceField:!1,distanceFieldBoundingBox:null,vvSizeEnabled:!1,vvSizeMinSize:[1,1,1],vvSizeMaxSize:[100,100,100],vvSizeOffset:[0,0,0],vvSizeFactor:[1,1,1],vvColorEnabled:!1,vvColorValues:[0,0,0,0,0,0,0,0],vvColorColors:[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],screenOffset:[0,0],verticalOffset:null,screenSizePerspective:null,screenSizePerspectiveAlignment:null,hasSlicePlane:!1,anchorPosition:c(.5,.5),shaderPolygonOffset:1e-5,polygonOffset:!1,textureId:null,centerOffsetUnits:"world",depthEnabled:!0,pixelSnappingEnabled:!0,debugDrawLabelBorder:!1,isDraped:!1,...j},Oe=y().vec3f(E.POSITION).vec3f(E.NORMAL).vec2f(E.UV0).vec4u8(E.COLOR).vec2f(E.SIZE).vec4f(E.AUXPOS1).vec4f(E.AUXPOS2);class ve{constructor(e){this.material=e,this.vertexBufferLayout=Oe}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return 6*e.indices.get(E.POSITION).length}write(e,t,r,s){R(t.indices.get(E.POSITION),t.vertexAttributes.get(E.POSITION).data,e.transformation,r.position,s,6),V(t.indices.get(E.NORMAL),t.vertexAttributes.get(E.NORMAL).data,e.invTranspTransformation,r.normal,s,6);{const e=t.vertexAttributes.get(E.UV0).data;let i,n,a,o;if(null==e||e.length<4){const e=this.material.parameters;i=0,n=0,a=e.texCoordScale[0],o=e.texCoordScale[1]}else i=e[0],n=e[1],a=e[2],o=e[3];a=Math.min(1.99999,a+1),o=Math.min(1.99999,o+1);const c=t.indices.get(E.POSITION).length,l=r.uv0;let f=s;for(let t=0;t<c;++t)l.set(f,0,i),l.set(f,1,n),f+=1,l.set(f,0,a),l.set(f,1,n),f+=1,l.set(f,0,a),l.set(f,1,o),f+=1,l.set(f,0,a),l.set(f,1,o),f+=1,l.set(f,0,i),l.set(f,1,o),f+=1,l.set(f,0,i),l.set(f,1,n),f+=1}N(t.indices.get(E.COLOR),t.vertexAttributes.get(E.COLOR).data,4,r.color,s,6);{const e=t.indices.get(E.SIZE),i=t.vertexAttributes.get(E.SIZE).data,n=e.length,a=r.size;let o=s;for(let t=0;t<n;++t){const r=i[2*e[t]],s=i[2*e[t]+1];for(let e=0;e<6;++e)a.set(o,0,r),a.set(o,1,s),o+=1}}t.indices.get(E.AUXPOS1)&&t.vertexAttributes.get(E.AUXPOS1)&&G(t.indices.get(E.AUXPOS1),t.vertexAttributes.get(E.AUXPOS1).data,r.auxpos1,s,6),t.indices.get(E.AUXPOS2)&&t.vertexAttributes.get(E.AUXPOS2)&&G(t.indices.get(E.AUXPOS2),t.vertexAttributes.get(E.AUXPOS2).data,r.auxpos2,s,6)}}export{Z as HUDMaterial};
|
|
5
|
+
import{clamp as e}from"../../../../core/mathUtils.js";import{isSome as t}from"../../../../core/maybe.js";import{f as r}from"../../../../chunks/mat3.js";import{c as s}from"../../../../chunks/mat3f64.js";import{a as i}from"../../../../chunks/mat4.js";import{c as n}from"../../../../chunks/mat4f64.js";import{c as a}from"../../../../chunks/vec2.js";import{a as o,f as c}from"../../../../chunks/vec2f64.js";import{s as l,m as f,n as u,b as p,g as h,c as m,l as d,i as g,t as S,e as O,a as v}from"../../../../chunks/vec3.js";import{c as A,f as P}from"../../../../chunks/vec3f64.js";import{c as b}from"../../../../chunks/vec4f64.js";import{isMat4 as x}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as C}from"../../../../geometry/support/aaBoundingRect.js";import{newLayout as y}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as I}from"../core/shaderLibrary/ShaderOutputOptions.js";import{HUDSpace as z}from"../core/shaderLibrary/hud/HUD.glsl.js";import{computeAttachmentOriginPoints as T}from"../lib/geometryDataUtils.js";import{GLTextureMaterial as _}from"../lib/GLTextureMaterial.js";import{Material as M,DefaultMaterialParameters as j}from"../lib/Material.js";import{RenderSlot as U}from"../lib/RenderSlot.js";import{applyScaleFactor as q,applyPrecomputedScaleFactor as w,precomputeScaleFactor as D}from"../lib/screenSizePerspectiveUtils.js";import{assert as L}from"../lib/Util.js";import{VertexAttribute as E}from"../lib/VertexAttribute.js";import{writePosition as R,writeNormal as V,writeColor as N,writeBufferVec4 as G}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as H}from"./internal/MaterialUtil.js";import{isInstanceHidden as B}from"./renderers/utils.js";import{c as X}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as k}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as F}from"../shaders/HUDMaterialTechniqueConfiguration.js";class W extends M{constructor(e){super(e,ge),this.techniqueConfig=new F}getConfiguration(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.hasSlicePlane=this.parameters.hasSlicePlane,this.techniqueConfig.hasVerticalOffset=!!this.parameters.verticalOffset,this.techniqueConfig.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this.techniqueConfig.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits?z.Screen:z.World,this.techniqueConfig.hasPolygonOffset=this.parameters.polygonOffset,this.techniqueConfig.isDraped=this.parameters.isDraped,this.techniqueConfig.occlusionTestEnabled=this.parameters.occlusionTest,this.techniqueConfig.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this.techniqueConfig.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this.techniqueConfig.vvSize=!!this.parameters.vvSizeEnabled,this.techniqueConfig.vvColor=!!this.parameters.vvColorEnabled,e===I.Color&&(this.techniqueConfig.debugDrawLabelBorder=!!this.parameters.debugDrawLabelBorder),e===I.Highlight&&(this.techniqueConfig.binaryHighlightOcclusionEnabled=this.parameters.binaryHighlightOcclusion),this.techniqueConfig.depthEnabled=this.parameters.depthEnabled,this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.hasMultipassGeometry=t.multipassGeometry.enabled,this.techniqueConfig.hasMultipassTerrain=t.multipassTerrain.enabled,this.techniqueConfig.cullAboveGround=t.multipassTerrain.cullAboveGround,this.techniqueConfig}intersect(e,r,s,i,n,a,o,c,l){t(l)?this._intersectDrapedHudGeometry(e,a,o,c,l):this._intersectHudGeometry(e,r,s,i,o,c)}_intersectDrapedHudGeometry(e,r,s,i,n){const a=e.vertexAttributes.get(E.POSITION),o=e.vertexAttributes.get(E.SIZE),c=this.parameters,l=X(c);let f=1,u=1;if(t(i)){const e=i(ue);f=e[0],u=e[5]}f*=e.screenToWorldRatio,u*=e.screenToWorldRatio;const p=he*e.screenToWorldRatio;for(let t=0;t<a.data.length/a.size;t++){const i=t*a.size,h=a.data[i],m=a.data[i+1],d=t*o.size;let g;me[0]=o.data[d]*f,me[1]=o.data[d+1]*u,c.textureIsSignedDistanceField&&(g=c.outlineSize*e.screenToWorldRatio/2),Y(r,h,m,me,p,g,c,l)&&s(n.dist,n.normal,-1,!1)}}_intersectHudGeometry(e,s,n,a,o,c){if(!a.options.selectionMode||!a.options.hud||B(s))return;const S=this.parameters;let O=1,v=1;if(r(ae,n),t(c)){const e=c(ue);O=e[0],v=e[5],Q(ae)}const P=e.vertexAttributes.get(E.POSITION),b=e.vertexAttributes.get(E.SIZE),x=e.vertexAttributes.get(E.NORMAL),C=e.vertexAttributes.get(E.AUXPOS1);L(P.size>=3);const y=a.point,I=a.camera,z=X(S);O*=I.pixelRatio,v*=I.pixelRatio;const T="screen"===this.parameters.centerOffsetUnits;for(let t=0;t<P.data.length/P.size;t++){const e=t*P.size;l(te,P.data[e],P.data[e+1],P.data[e+2]),f(te,te,n);const r=t*b.size;me[0]=b.data[r]*O,me[1]=b.data[r+1]*v,f(te,te,I.viewMatrix);const s=t*C.size;if(l(le,C.data[s+0],C.data[s+1],C.data[s+2]),!T&&(te[0]+=le[0],te[1]+=le[1],0!==le[2])){const e=le[2];u(le,te),p(te,te,h(le,le,e))}const c=t*x.size;if(l(re,x.data[c],x.data[c+1],x.data[c+2]),this._normalAndViewAngle(re,ae,I,fe),this._applyVerticalOffsetTransformationView(te,fe,I,$),I.applyProjection(te,se),se[0]>-1){se[0]=Math.floor(se[0]),se[1]=Math.floor(se[1]),T&&(le[0]||le[1])&&(se[0]+=le[0],0!==le[1]&&(se[1]+=q(le[1],$.factorAlignment)),I.unapplyProjection(se,te)),se[0]+=this.parameters.screenOffset[0],se[1]+=this.parameters.screenOffset[1],w(me,$.factor,me);const e=pe*I.pixelRatio;let t;if(S.textureIsSignedDistanceField&&(t=S.outlineSize*I.pixelRatio/2),Y(y,se[0],se[1],me,e,t,S,z)){const e=a.ray;if(f(ne,te,i(ce,I.viewMatrix)),se[0]=y[0],se[1]=y[1],I.unprojectFromRenderScreen(se,te)){const t=A();m(t,e.direction);const r=1/d(t);h(t,t,r);o(g(e.origin,te)*r,t,-1,!0,1,ne)}}}}}computeAttachmentOrigin(e,t){const r=e.vertexAttributes;if(!r)return!1;const s=r.get(E.POSITION),i=e.indices.get(E.POSITION);return T(s,i,t)}createBufferWriter(){return new Oe(this)}_normalAndViewAngle(e,t,s,i){return x(t)&&(t=r(oe,t)),S(i.normal,e,t),f(i.normal,i.normal,s.viewInverseTransposeMatrix),i.cosAngle=O(ie,de),i}_updateScaleInfo(e,t,r){const s=this.parameters;s.screenSizePerspective?D(r,t,s.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minPixelSize=0,e.factor.paddingPixels=0),s.screenSizePerspectiveAlignment?D(r,t,s.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minPixelSize=e.factor.minPixelSize,e.factorAlignment.paddingPixels=e.factor.paddingPixels)}applyShaderOffsetsView(e,t,r,s,i,n,a){const o=this._normalAndViewAngle(t,r,i,fe);return this._applyVerticalGroundOffsetView(e,o,i,a),this._applyVerticalOffsetTransformationView(a,o,i,n),this._applyPolygonOffsetView(a,o,s[3],i,a),this._applyCenterOffsetView(a,s,a),a}applyShaderOffsetsNDC(e,r,s,i,n){return this._applyCenterOffsetNDC(e,r,s,i),t(n)&&m(n,i),this._applyPolygonOffsetNDC(i,r,s,i),i}_applyPolygonOffsetView(t,r,s,i,n){const a=i.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=a);const c=a*o;if(this.parameters.shaderPolygonOffset<=0)return m(n,t);const l=e(Math.abs(r.cosAngle),.01,1),f=1-Math.sqrt(1-l*l)/l/i.viewport[2];return h(n,t,c>0?f:1/f),n}_applyVerticalGroundOffsetView(e,t,r,s){const i=d(e),n=r.aboveGround?1:-1,a=.5*r.computeRenderPixelSizeAtDist(i),o=h(te,t.normal,n*a);return v(s,e,o),s}_applyVerticalOffsetTransformationView(e,t,r,s){const i=this.parameters;if(!i.verticalOffset||!i.verticalOffset.screenLength){if(i.screenSizePerspective||i.screenSizePerspectiveAlignment){const r=d(e);this._updateScaleInfo(s,r,t.cosAngle)}else s.factor.scale=1,s.factorAlignment.scale=1;return e}const n=d(e),a=i.screenSizePerspectiveAlignment||i.screenSizePerspective,o=H(r,n,i.verticalOffset,t.cosAngle,a);return this._updateScaleInfo(s,n,t.cosAngle),h(t.normal,t.normal,o),v(e,e,t.normal)}_applyCenterOffsetView(e,t,r){const s="screen"!==this.parameters.centerOffsetUnits;return r!==e&&m(r,e),s&&(r[0]+=t[0],r[1]+=t[1],t[2]&&(u(re,r),v(r,r,h(re,re,t[2])))),r}_applyCenterOffsetNDC(e,t,r,s){const i="screen"!==this.parameters.centerOffsetUnits;return s!==e&&m(s,e),i||(s[0]+=t[0]/r.fullWidth*2,s[1]+=t[1]/r.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,r,s){const i=this.parameters.shaderPolygonOffset;if(e!==s&&m(s,e),i){const e=r.aboveGround?1:-1,n=e*Math.sign(t[3]);s[2]-=(n||e)*i}return s}requiresSlot(e){if(e===U.DRAPED_MATERIAL)return!0;const{drawInSecondSlot:t,occlusionTest:r}=this.parameters;return e===(t?U.LABEL_MATERIAL:U.HUD_MATERIAL)||r&&e===U.OCCLUSION_PIXELS}createGLMaterial(e){return e.output===I.Color||e.output===I.Alpha?new J(e):e.output===I.Highlight?new Z(e):null}calculateRelativeScreenBounds(e,t,r=C()){return K(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class Z extends _{constructor(e){super({...e,...e.material.parameters})}_updateParameters(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.passParameters),this.selectProgram(e)}selectProgram(e){return this.ensureTechnique(k,e)}beginSlot(e){return this._updateParameters(e)}}class J extends Z{_isOcclusionSlot(e){return e.slot===U.OCCLUSION_PIXELS&&this._material.parameters.occlusionTest&&(this._output===I.Color||this._output===I.Alpha)}selectProgram(e){return this.ensureTechnique(k,e,this._isOcclusionSlot(e)?I.Occlusion:this._output)}}function K(e,t,r,s=ee){return a(s,e.anchorPosition),s[0]*=-t[0],s[1]*=-t[1],s[0]+=e.screenOffset[0]*r,s[1]+=e.screenOffset[1]*r,s}function Q(e){const t=e[0],r=e[1],s=e[2],i=e[3],n=e[4],a=e[5],o=e[6],c=e[7],l=e[8],f=1/Math.sqrt(t*t+r*r+s*s),u=1/Math.sqrt(i*i+n*n+a*a),p=1/Math.sqrt(o*o+c*c+l*l);return e[0]=t*f,e[1]=r*f,e[2]=s*f,e[3]=i*u,e[4]=n*u,e[5]=a*u,e[6]=o*p,e[7]=c*p,e[8]=l*p,e}function Y(e,t,r,s,i,n,a,o){let c=t-i-(o[0]>0?s[0]*o[0]:0),l=c+s[0]+2*i,f=r-i-(o[1]>0?s[1]*o[1]:0),u=f+s[1]+2*i;if(a.textureIsSignedDistanceField){const e=a.distanceFieldBoundingBox;c+=s[0]*e[0],f+=s[1]*e[1],l-=s[0]*(1-e[2]),u-=s[1]*(1-e[3]),c-=n,l+=n,f-=n,u+=n}return e[0]>c&&e[0]<l&&e[1]>f&&e[1]<u}const $={factor:{scale:0,factor:0,minPixelSize:0,paddingPixels:0},factorAlignment:{scale:0,factor:0,minPixelSize:0,paddingPixels:0}},ee=o(),te=A(),re=A(),se=b(),ie=A(),ne=A(),ae=s(),oe=s(),ce=n(),le=A(),fe={normal:ie,cosAngle:0},ue=n(),pe=1,he=2,me=[0,0],de=P(0,0,1),ge={texCoordScale:[1,1],occlusionTest:!0,binaryHighlightOcclusion:!0,drawInSecondSlot:!1,color:[1,1,1,1],outlineColor:[1,1,1,1],outlineSize:0,textureIsSignedDistanceField:!1,distanceFieldBoundingBox:null,vvSizeEnabled:!1,vvSizeMinSize:[1,1,1],vvSizeMaxSize:[100,100,100],vvSizeOffset:[0,0,0],vvSizeFactor:[1,1,1],vvColorEnabled:!1,vvColorValues:[0,0,0,0,0,0,0,0],vvColorColors:[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],screenOffset:[0,0],verticalOffset:null,screenSizePerspective:null,screenSizePerspectiveAlignment:null,hasSlicePlane:!1,anchorPosition:c(.5,.5),shaderPolygonOffset:1e-5,polygonOffset:!1,textureId:null,centerOffsetUnits:"world",depthEnabled:!0,pixelSnappingEnabled:!0,debugDrawLabelBorder:!1,isDraped:!1,...j},Se=y().vec3f(E.POSITION).vec3f(E.NORMAL).vec2f(E.UV0).vec4u8(E.COLOR).vec2f(E.SIZE).vec4f(E.AUXPOS1).vec4f(E.AUXPOS2);class Oe{constructor(e){this.material=e,this.vertexBufferLayout=Se}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return 6*e.indices.get(E.POSITION).length}write(e,t,r,s){R(t.indices.get(E.POSITION),t.vertexAttributes.get(E.POSITION).data,e.transformation,r.position,s,6),V(t.indices.get(E.NORMAL),t.vertexAttributes.get(E.NORMAL).data,e.invTranspTransformation,r.normal,s,6);{const e=t.vertexAttributes.get(E.UV0).data;let i,n,a,o;if(null==e||e.length<4){const e=this.material.parameters;i=0,n=0,a=e.texCoordScale[0],o=e.texCoordScale[1]}else i=e[0],n=e[1],a=e[2],o=e[3];a=Math.min(1.99999,a+1),o=Math.min(1.99999,o+1);const c=t.indices.get(E.POSITION).length,l=r.uv0;let f=s;for(let t=0;t<c;++t)l.set(f,0,i),l.set(f,1,n),f+=1,l.set(f,0,a),l.set(f,1,n),f+=1,l.set(f,0,a),l.set(f,1,o),f+=1,l.set(f,0,a),l.set(f,1,o),f+=1,l.set(f,0,i),l.set(f,1,o),f+=1,l.set(f,0,i),l.set(f,1,n),f+=1}N(t.indices.get(E.COLOR),t.vertexAttributes.get(E.COLOR).data,4,r.color,s,6);{const e=t.indices.get(E.SIZE),i=t.vertexAttributes.get(E.SIZE).data,n=e.length,a=r.size;let o=s;for(let t=0;t<n;++t){const r=i[2*e[t]],s=i[2*e[t]+1];for(let e=0;e<6;++e)a.set(o,0,r),a.set(o,1,s),o+=1}}t.indices.get(E.AUXPOS1)&&t.vertexAttributes.get(E.AUXPOS1)&&G(t.indices.get(E.AUXPOS1),t.vertexAttributes.get(E.AUXPOS1).data,r.auxpos1,s,6),t.indices.get(E.AUXPOS2)&&t.vertexAttributes.get(E.AUXPOS2)&&G(t.indices.get(E.AUXPOS2),t.vertexAttributes.get(E.AUXPOS2).data,r.auxpos2,s,6)}}export{W as HUDMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{s as e,y as t,m as r}from"../../../../chunks/vec3.js";import{c as a}from"../../../../chunks/vec3f64.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutputOptions.js";import{outputFromPass as n}from"../lib/GLMaterials.js";import{GLTextureMaterial as
|
|
5
|
+
import{s as e,y as t,m as r}from"../../../../chunks/vec3.js";import{c as a}from"../../../../chunks/vec3f64.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutputOptions.js";import{outputFromPass as n}from"../lib/GLMaterials.js";import{GLTextureMaterial as o}from"../lib/GLTextureMaterial.js";import{DefaultMaterialParameters as u,Material as h,RenderOccludedFlag as c}from"../lib/Material.js";import{RenderSlot as l}from"../lib/RenderSlot.js";import{VertexAttribute as p}from"../lib/VertexAttribute.js";import{VisualVariableDefaultMaterialParameters as m}from"./VisualVariableMaterialParameters.js";import{markerVertexAttributeLocations as d,LineMarkerTechnique as E}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as A}from"../shaders/LineMarkerTechniqueConfiguration.js";import{CapType as T}from"../shaders/RibbonLineTechniqueConfiguration.js";class f extends h{constructor(e){super(e,C),this._vertexAttributeLocations=d,this.techniqueConfig=new A,this.layout=this.createLayout()}dispose(){}getConfiguration(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.draped=t.slot===l.DRAPED_MATERIAL,this.techniqueConfig.hasCap=this.parameters.cap!==T.BUTT,this.techniqueConfig.hasSlicePlane=this.parameters.hasSlicePlane,this.techniqueConfig.hasOccludees=this.parameters.hasOccludees,this.techniqueConfig.writeDepth=this.parameters.writeDepth,this.techniqueConfig.vvColor=this.parameters.vvColorEnabled,this.techniqueConfig.vvOpacity=this.parameters.vvOpacityEnabled,this.techniqueConfig.vvSize=this.parameters.vvSizeEnabled,this.techniqueConfig.occluder=this.parameters.renderOccluded===c.OccludeAndTransparentStencil,this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.hasMultipassTerrain=t.multipassTerrain.enabled,this.techniqueConfig.cullAboveGround=t.multipassTerrain.cullAboveGround,this.techniqueConfig}intersect(){}createLayout(){const e=s().vec3f(p.POSITION).vec2f(p.UV0).vec3f(p.AUXPOS1);return this.parameters.vvSizeEnabled?e.f32(p.SIZEFEATUREATTRIBUTE):e.f32(p.SIZE),this.parameters.vvColorEnabled?e.f32(p.COLORFEATUREATTRIBUTE):e.vec4f(p.COLOR),this.parameters.vvOpacityEnabled&&e.f32(p.OPACITYFEATUREATTRIBUTE),e}createBufferWriter(){return new b(this.layout,this.parameters)}requiresSlot(e,t){if(e===l.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===c.OccludeAndTransparentStencil)return e===l.OPAQUE_MATERIAL||e===l.OCCLUDER_MATERIAL||e===l.TRANSPARENT_OCCLUDER_MATERIAL;const r=n(t);if(r===i.Color||r===i.Alpha){return e===(this.parameters.writeDepth?l.TRANSPARENT_MATERIAL:l.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return e===l.OPAQUE_MATERIAL}createGLMaterial(e){return e.output===i.Color||e.output===i.Alpha||e.output===i.Highlight||e.output===i.Depth?new v(e):null}}class v extends o{_updateParameters(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.passParameters),this.ensureTechnique(E,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==i.Color&&this._output!==i.Alpha||this._updateOccludeeState(e),this._updateParameters(e)}}const C={width:0,color:[1,1,1,1],placement:"end",textureId:null,cap:T.BUTT,writeDepth:!0,hasSlicePlane:!1,vvFastUpdate:!1,hasOccludees:!1,...u,...m};class b{constructor(e,t){this.vertexBufferLayout=e,this.parameters=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(){return"begin-end"===this.parameters.placement?12:6}write(a,s,i,n){const o=s.vertexAttributes.get(p.POSITION).data,u=o.length/3;let h=1,c=0;this.parameters.vvSizeEnabled?c=s.vertexAttributes.get(p.SIZEFEATUREATTRIBUTE).data[0]:s.vertexAttributes.has(p.SIZE)&&(h=s.vertexAttributes.get(p.SIZE).data[0]);let l=[1,1,1,1],m=0;this.parameters.vvColorEnabled?m=s.vertexAttributes.get(p.COLORFEATUREATTRIBUTE).data[0]:s.vertexAttributes.has(p.COLOR)&&(l=s.vertexAttributes.get(p.COLOR).data);let d=0;this.parameters.vvOpacityEnabled&&(d=s.vertexAttributes.get(p.OPACITYFEATUREATTRIBUTE).data[0]);const E=a.transformation,A=new Float32Array(i.buffer);let T=n*(this.vertexBufferLayout.stride/4);const f=(e,t,r,a)=>{if(A[T++]=e[0],A[T++]=e[1],A[T++]=e[2],A[T++]=r[0],A[T++]=r[1],A[T++]=t[0],A[T++]=t[1],A[T++]=t[2],this.parameters.vvSizeEnabled?A[T++]=c:A[T++]=h,this.parameters.vvColorEnabled)A[T++]=m;else{const e=Math.min(4*a,l.length-4);A[T++]=l[e+0],A[T++]=l[e+1],A[T++]=l[e+2],A[T++]=l[e+3]}this.parameters.vvOpacityEnabled&&(A[T++]=d)};let v;!function(e){e[e.ASCENDING=1]="ASCENDING",e[e.DESCENDING=-1]="DESCENDING"}(v||(v={}));const C=(a,s)=>{const i=e(O,o[3*a],o[3*a+1],o[3*a+2]),n=R;let h=a+s;do{e(n,o[3*h],o[3*h+1],o[3*h+2]),h+=s}while(t(i,n)&&h>=0&&h<u);E&&(r(i,i,E),r(n,n,E)),f(i,n,[-1,-1],a),f(i,n,[1,-1],a),f(i,n,[1,1],a),f(i,n,[-1,-1],a),f(i,n,[1,1],a),f(i,n,[-1,1],a)},b=this.parameters.placement;"begin"!==b&&"begin-end"!==b||C(0,v.ASCENDING),"end"!==b&&"begin-end"!==b||C(u-1,v.DESCENDING)}}const O=a(),R=a();export{f as LineMarkerMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../core/maybe.js";import{ViewingMode as i}from"../../../ViewingMode.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutputOptions.js";import{NormalsDoubleSidedMode as t}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as s}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{bindReadShadowMapDraw as a}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{doublePrecisionRequiresObfuscation as n}from"../core/shaderLibrary/util/DoublePrecision.glsl.js";import{ReloadableShaderModule as p}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as l}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as c}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TransparencyPassType as
|
|
5
|
+
import{_ as o}from"../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../core/maybe.js";import{ViewingMode as i}from"../../../ViewingMode.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutputOptions.js";import{NormalsDoubleSidedMode as t}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as s}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{bindReadShadowMapDraw as a}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{doublePrecisionRequiresObfuscation as n}from"../core/shaderLibrary/util/DoublePrecision.glsl.js";import{ReloadableShaderModule as p}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as l}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as c}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TransparencyPassType as u}from"../lib/basicInterfaces.js";import{blendingDefault as d,oitBlending as h,oitDepthTest as m,OITPolygonOffset as f}from"../lib/OrderIndependentTransparency.js";import{Program as g}from"../lib/Program.js";import{stencilWriteMaskOn as b,stencilBaseAllZerosParams as v}from"../lib/StencilUtils.js";import{VertexAttribute as y}from"../lib/VertexAttribute.js";import{DefaultTechniqueConfiguration as P}from"./DefaultTechniqueConfiguration.js";import{P as O}from"../../../../chunks/Path.glsl.js";import{makePipelineState as T,frontFaceCullingParams as j,defaultDepthWriteParams as S,defaultColorWriteParams as M}from"../../../webgl/renderState.js";const w=new Map([[y.POSITION,0],[y.PROFILERIGHT,1],[y.PROFILEUP,2],[y.PROFILEVERTEXANDNORMAL,3],[y.FEATUREVALUE,4]]);class C extends l{initializeConfiguration(o,e){e.spherical=o.viewingMode===i.Global,e.doublePrecisionRequiresObfuscation=n(o.rctx)}initializeProgram(o){const e=C.shader.get().build(this.configuration);return new g(o.rctx,e,w)}bindPass(o,i){this.program.bindPass(o,i),this.program.setUniform3fv("size",o.size),this.configuration.output!==r.Color&&this.configuration.output!==r.Alpha||this.program.setUniform1f("opacity",o.opacity),this.configuration.output===r.Color&&(i.lighting.setUniforms(this.program,!1),this.program.setUniform3fv("ambient",o.ambient),this.program.setUniform3fv("diffuse",o.diffuse),this.program.setUniform3fv("specular",o.specular),this.program.setUniform1f("opacity",o.opacity)),e(i.shadowMap)&&i.shadowMap.bind(this.program),e(i.ssaoHelper)&&i.ssaoHelper.bind(this.program,i.camera)}bindDraw(o,e){this.program.bindDraw(o,e),this.program.rebindTextures(),this.configuration.output===r.Color&&a(this.program,e.shadowMap,o.origin)}_setPipelineState(o){const e=this.configuration,i=o===u.NONE,s=o===u.FrontFace,a=o=>!o.hasSlicePlane&&!(o.transparent||o.doubleSidedMode===t.None);return T({blending:e.output!==r.Color&&e.output!==r.Alpha||!e.transparent?null:i?d:h(o),culling:a(e)&&j,depthTest:{func:m(o)},depthWrite:i||s?S:null,colorWrite:M,stencilWrite:e.hasOccludees?b:null,stencilTest:e.hasOccludees?v:null,polygonOffset:i||s?null:f})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}}C.shader=new p(O,(()=>import("../shaders/Path.glsl.js")));class R extends P{constructor(){super(...arguments),this.output=r.Color,this.doubleSidedMode=t.None,this.transparencyPassType=u.NONE,this.spherical=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.hasSlicePlane=!1,this.transparent=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.doublePrecisionRequiresObfuscation=!1}}o([c({count:r.COUNT})],R.prototype,"output",void 0),o([c({count:t.COUNT})],R.prototype,"doubleSidedMode",void 0),o([c({count:u.COUNT})],R.prototype,"transparencyPassType",void 0),o([c()],R.prototype,"spherical",void 0),o([c()],R.prototype,"receiveShadows",void 0),o([c()],R.prototype,"receiveAmbientOcclusion",void 0),o([c()],R.prototype,"vvSize",void 0),o([c()],R.prototype,"vvColor",void 0),o([c()],R.prototype,"vvOpacity",void 0),o([c()],R.prototype,"hasSlicePlane",void 0),o([c()],R.prototype,"transparent",void 0),o([c()],R.prototype,"hasOccludees",void 0),o([c()],R.prototype,"hasMultipassTerrain",void 0),o([c()],R.prototype,"cullAboveGround",void 0),o([c()],R.prototype,"doublePrecisionRequiresObfuscation",void 0),o([c({constValue:s.Disabled})],R.prototype,"pbrMode",void 0),o([c({constValue:!0})],R.prototype,"hasVvInstancing",void 0),o([c({constValue:!1})],R.prototype,"useCustomDTRExponentForWater",void 0),o([c({constValue:!1})],R.prototype,"useFillLights",void 0);export{C as PathTechnique,R as PathTechniqueConfiguration,w as pathVertexAttributeLocations};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../../../chunks/tslib.es6.js";import
|
|
5
|
+
import{_ as o}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/has.js";import{isSome as e}from"../../../../core/maybe.js";import{ViewingMode as t}from"../../../ViewingMode.js";import{bindCloudsComposition as i}from"../../environment/CloudsComposition.js";import{ShaderOutput as s}from"../core/shaderLibrary/ShaderOutputOptions.js";import{PBRMode as a}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{bindReadShadowMapPass as n,bindReadShadowMapDraw as p}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{bindWaterDistortionUniforms as l}from"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import{doublePrecisionRequiresObfuscation as u}from"../core/shaderLibrary/util/DoublePrecision.glsl.js";import{ReloadableShaderModule as h}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as c}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as d}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TransparencyPassType as m}from"../lib/basicInterfaces.js";import{Default3D as f}from"../lib/DefaultVertexAttributeLocations.js";import{blendingDefault as g,oitBlending as b,oitDepthTest as y,oitDepthWrite as v,getOITPolygonOffset as j}from"../lib/OrderIndependentTransparency.js";import{Program as S}from"../lib/Program.js";import{DefaultTechniqueConfiguration as C}from"./DefaultTechniqueConfiguration.js";import{W as P}from"../../../../chunks/WaterSurface.glsl.js";import{makePipelineState as T,defaultDepthWriteParams as w,defaultColorWriteParams as O}from"../../../webgl/renderState.js";class R extends c{constructor(o,r,e){super(o,r,e),this._textureRepository=o.waterTextureRepository}initializeConfiguration(o,r){r.spherical=o.viewingMode===t.Global,r.doublePrecisionRequiresObfuscation=u(o.rctx)}initializeProgram(o){const r=R.shader.get().build(this.configuration);return new S(o.rctx,r,f)}bindPass(o,r){this.program.bindPass(o,r),this.configuration.output===s.Color&&(r.lighting.setUniforms(this.program,!1),this.configuration.hasCloudsReflections&&e(r.cloudsComposition)&&i(this.program,r.camera,r.cloudsComposition)),this.configuration.output!==s.Color&&this.configuration.output!==s.Normal||(l(this.program,o),this._textureRepository.bind(this.program)),this.program.setUniform4fv("waterColor",o.color)}bindDraw(o,r){this.program.bindDraw(o,r),this.program.rebindTextures(),this.configuration.output===s.Color&&(n(this.program,r.shadowMap),p(this.program,r.shadowMap,o.origin))}_setPipelineState(o){const r=this.configuration,e=o===m.NONE,t=o===m.FrontFace;return T({blending:r.output!==s.Normal&&r.output!==s.Highlight&&r.transparent?e?g:b(o):null,depthTest:{func:y(o)},depthWrite:e?r.writeDepth&&w:v(o),colorWrite:O,polygonOffset:e||t?null:j(r.enableOffset)})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}}R.shader=new h(P,(()=>import("../shaders/WaterSurface.glsl.js")));class D extends C{constructor(){super(...arguments),this.output=s.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.isDraped=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1}}o([d({count:s.COUNT})],D.prototype,"output",void 0),o([d({count:m.COUNT})],D.prototype,"transparencyPassType",void 0),o([d()],D.prototype,"spherical",void 0),o([d()],D.prototype,"receiveShadows",void 0),o([d()],D.prototype,"hasSlicePlane",void 0),o([d()],D.prototype,"transparent",void 0),o([d()],D.prototype,"enableOffset",void 0),o([d()],D.prototype,"writeDepth",void 0),o([d()],D.prototype,"hasScreenSpaceReflections",void 0),o([d()],D.prototype,"doublePrecisionRequiresObfuscation",void 0),o([d()],D.prototype,"isDraped",void 0),o([d()],D.prototype,"hasMultipassTerrain",void 0),o([d()],D.prototype,"cullAboveGround",void 0),o([d({constValue:a.Water})],D.prototype,"pbrMode",void 0),o([d({constValue:!0})],D.prototype,"useCustomDTRExponentForWater",void 0),o([d({constValue:!0})],D.prototype,"highStepCount",void 0),o([d({constValue:r("enable-feature:clouds-reflections")})],D.prototype,"hasCloudsReflections",void 0),o([d({constValue:!1})],D.prototype,"useFillLights",void 0);export{R as WaterTechnique,D as WaterTechniqueConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import i from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{removeMaybe as o,disposeMaybe as n,isSome as a,isNone as p}from"../../../../core/maybe.js";import{watch as d,initial as h}from"../../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../../core/scheduling.js";import{Milliseconds as l}from"../../../../core/time.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{ComponentObjectCollection as _}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueRepository as f}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{autoDispose as g,AutoDisposableMixin as y}from"../lib/AutoDisposable.js";import{RenderRequestType as R,Decorations as x}from"../lib/basicInterfaces.js";import b from"../lib/CompositingHelper.js";import{textureToDepth as v}from"../lib/depthRangeUtils.js";import{GLMaterialRepository as w}from"../lib/GLMaterialRepository.js";import{MagnifierHelper as C}from"../lib/MagnifierHelper.js";import{Renderer as T}from"../lib/Renderer.js";import{RenderingContext as U}from"../lib/RenderingContext.js";import{TextureRepository as j}from"../lib/TextureRepository.js";import{StippleTextureRepository as A}from"../materials/StippleTextureRepository.js";import{WaterTextureRepository as S}from"../materials/internal/WaterTextureRepository.js";import{removeLoadedShaderModules as q}from"./requireUtils.js";import{ScreenshotManager as M}from"./ScreenshotManager.js";import{createContextOrErrorHTML as D}from"../../../webgl/context-util.js";const O=s.getLogger("esri.views.3d.webgl-engine.parts.View");let H=class extends(y(t)){constructor(e){super({}),this.events=new r,this.waterTextureRepository=new S,this._magnifierHelper=new C,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this._container=e.container,this._initializeContext(e),d((()=>{var e;return null==(e=this.waterTextureRepository)?void 0:e.updating}),(()=>this.requestRender()),h),this._magnifierHelper.events.on("request-render",(()=>this.requestRender())),this._stippleTextureRepository=new A(this._rctx),this._shaderTechniqueRepository=new f({rctx:this._rctx,viewingMode:e.viewingMode,stippleTextureRepository:this._stippleTextureRepository,waterTextureRepository:this.waterTextureRepository}),this._textureRepository=new j(e,this._shaderTechniqueRepository,this._rctx),this._textureRepository.events.on("changed",(e=>this.requestRender(e))),this._materialRepository=new w(this._textureRepository,this._shaderTechniqueRepository,(()=>this.requestRender()),(()=>this.requestRender())),this._compositingHelper=new b(this._rctx,this._shaderTechniqueRepository),this._renderer=new T(this._materialRepository,this._textureRepository,this._shaderTechniqueRepository,this._rctx,this._compositingHelper,this._magnifierHelper,(e=>this.requestRender(e)),((t,r)=>e.schedule(t,r)),e),this._screenshotManager=new M(this._rctx,((e,t,r)=>this._renderer.render(e,t,t,r)),(e=>this.requestRender(e)),e.options.screenshot.renderOverlay,(e=>this.events.emit("force-camera-for-screenshot",e)),(()=>this._renderer.disposeOffscreenBuffers())),this._registerFrameTask(e)}normalizeCtorArgs(){return{}}dispose(){this._container.contains(this._canvas)&&this._container.removeChild(this._canvas),this._frameTask=o(this._frameTask),this._shaderTechniqueRepository=n(this._shaderTechniqueRepository),super.dispose(),this._tmpDepthBuffer=null,this._rctx=null}get performanceInfo(){const e=this._rctx.gl;return{renderer:this._renderer.performanceInfo,textureMemory:void 0!==e.getUsedTextureMemory?e.getUsedTextureMemory():void 0,renderbufferMemory:void 0!==e.getUsedRenderbufferMemory?e.getUsedRenderbufferMemory():void 0,VBOMemory:void 0!==e.getUsedVBOMemory?e.getUsedVBOMemory():void 0}}requestRender(e=R.UPDATE){e===R.UPDATE?this._needsUpdate=!0:this._needsRender=!0}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this._renderer.updating||this._textureRepository.updating||this.waterTextureRepository.updating||this._magnifierHelper.updating}ensureEdgeView(){return this._renderer.ensureEdgeView()}get edgeView(){return this._renderer.edgeView}get textureRepository(){return this._textureRepository}get compositingHelper(){return this._compositingHelper}set magnifier(e){this._magnifierHelper.magnifier=e}updateLightSources(e,t,r){this._renderer.updateLightSources(e,t,r),this.requestRender()}setRenderParameters(e){void 0!==e.idleSuspend&&this._idleSuspend!==!!e.idleSuspend&&(this._idleSuspend=!!e.idleSuspend,this.requestRender()),this._renderer.setRenderParameters(e)}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}modify(e){this._renderer.modify(e),e.clear()}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(e)}get hasShadowsEnabled(){return this._renderer.hasShadowsEnabled}readAccumulatedShadow(e){return this._renderer.readAccumulatedShadow(e[0],e[1])}readHUDVisibility(e,t,r,i,s){this._renderer.readHUDVisibility(e,t,r,i,s)}getMinimalDepthForArea(e,t,r,i,s,o=s){const n=i.constrainWindowSize(t,r,s*i.pixelRatio,o*i.pixelRatio),p=this._ensureDepthBuffer(n);this._renderer.readDepthPixels(i,n[0],n[1],n[2],n[3],p);let d=Number.MAX_VALUE;for(let a=0;a<n[2]*n[3];a++){const e=v(4*a,p,i.nearFar);d>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(d=e)}if(a(e)){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);a(s)&&d>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(d=s)}return d===Number.MAX_VALUE?void 0:d}_ensureDepthBuffer(e){const t=4*e[2]*e[3];return(p(this._tmpDepthBuffer)||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}get renderPlugins(){return this._renderer.renderPlugins}get test(){return{renderer:this._renderer}}get gpuMemoryUsage(){return this._renderer.gpuMemoryUsage}async reloadShaders(){q(),await this._shaderTechniqueRepository.reloadAll(),this.requestRender()}get animationTimestep(){return this._renderer.animationTimestep}_registerFrameTask(e){const t=e.state,r={viewCamera:t.camera,frameHasDecorations:!1};let i=!1,s=R.BACKGROUND,o=!1;const n={preRender:r=>{i=this.updating,s=this._needsUpdate?R.UPDATE:R.BACKGROUND,e.processSyncLayers();const o=l(r.time-this._lastAnimationUpdate);(o>this.animationTimestep||a(this.forcedAnimationTime)||i||this._needsRender)&&(this._renderer.updateAnimation({camera:t.camera,dt:o,forcedTime:this.forcedAnimationTime})&&this.requestRender(R.BACKGROUND),this._lastAnimationUpdate=r.time)},render:()=>{if((this._needsUpdate||this._needsRender||!this._idleSuspend||!this._renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const e=this._needsUpdate&&this._idleSuspend&&this._renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this._renderer.render(null,t.camera,t.contentCamera,x.ON),o=!0,e&&this._renderer.hasWaterReflection&&(this.requestRender(R.BACKGROUND),this._needsWaterReflectionUpdate=!0)}},update:()=>{r.viewCamera=t.camera,r.frameHasDecorations=this._renderer.hasSlicePlane||this._magnifierHelper.enabled,this._textureRepository.update(),this._screenshotManager.update(r)},finish:()=>{o&&(this._renderer.finish(s),o=!1)}};this._frameTask=c(n)}_initializeContext(e){const t=e.options;this._canvas=t.canvas,this._canvas||(this._canvas=document.createElement("canvas")),this._canvas.setAttribute("style","width: 100%; height:100%; display:block;");const r={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:null==t.stencil||t.stencil,powerPreference:"high-performance"},s=D("3d",this._canvas,r);if(p(s)){const e=i("esri-force-webgl");O.error(e)}else this._rctx=this._newRenderingContext(s,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&O.error("WebGL context has alpha channel even though no alpha channel was requested"),!this._rctx.contextAttributes.alpha&&i("safari")>=11&&(this._container.style.backgroundColor="black"),this._container.appendChild(this._canvas)}_newRenderingContext(e,t){const r={disabledExtensions:t.options.deactivatedWebGLExtensions||{},debugWebGLExtensions:t.options.debugWebGLExtensions||{},maxAnisotropy:8},i=(e,r)=>t.resourceController.memoryController.newCache(e,r);if(E.enableContextCache){let t=B.get(e);return t?(t.configure(r),t.newCache=i,t.ref(),t):(t=new U(e,r,i),B.set(e,t),t.ref(),t)}return new U(e,r,i)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("standardDerivatives"),this._rctx.capabilities.enable("shaderTextureLOD"),this._rctx.capabilities.enable("textureFloat")}get componentObjectCollection(){return p(this._componentObjectCollection)&&(this._componentObjectCollection=new _(this._renderer.renderPassManager)),this._componentObjectCollection}set componentObjectCollection(e){this._componentObjectCollection=e}};e([m({type:Boolean,readOnly:!0})],H.prototype,"updating",null),e([g()],H.prototype,"_rctx",void 0),e([g()],H.prototype,"_container",void 0),e([g()],H.prototype,"_canvas",void 0),e([g()],H.prototype,"_stippleTextureRepository",void 0),e([g(),m()],H.prototype,"waterTextureRepository",void 0),e([g(),m()],H.prototype,"_magnifierHelper",void 0),e([g(),m()],H.prototype,"_textureRepository",void 0),e([g()],H.prototype,"_compositingHelper",void 0),e([g()],H.prototype,"_renderer",void 0),e([g()],H.prototype,"_screenshotManager",void 0),e([g()],H.prototype,"componentObjectCollection",null),e([g()],H.prototype,"_componentObjectCollection",void 0),e([m()],H.prototype,"_needsUpdate",void 0),e([m()],H.prototype,"_needsWaterReflectionUpdate",void 0),H=e([u("esri.views.3d.webgl-engine.parts.RenderView")],H);const E={enableContextCache:!1,disposeContextCache:()=>{B.forEach((e=>e.dispose())),B.clear()}},B=new Map;export{H as RenderView,E as test};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import i from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{removeMaybe as o,disposeMaybe as n,isSome as a,isNone as p}from"../../../../core/maybe.js";import{watch as h,initial as d}from"../../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../../core/scheduling.js";import{Milliseconds as l}from"../../../../core/time.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{ComponentObjectCollection as _}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueRepository as f}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{autoDispose as g,AutoDisposableMixin as y}from"../lib/AutoDisposable.js";import{RenderRequestType as R,Decorations as x}from"../lib/basicInterfaces.js";import b from"../lib/CompositingHelper.js";import{textureToDepth as v}from"../lib/depthRangeUtils.js";import{GLMaterialRepository as w}from"../lib/GLMaterialRepository.js";import{MagnifierHelper as C}from"../lib/MagnifierHelper.js";import{Renderer as T}from"../lib/Renderer.js";import{RenderingContext as U}from"../lib/RenderingContext.js";import{TextureRepository as j}from"../lib/TextureRepository.js";import{StippleTextureRepository as A}from"../materials/StippleTextureRepository.js";import{WaterTextureRepository as S}from"../materials/internal/WaterTextureRepository.js";import{removeLoadedShaderModules as q}from"./requireUtils.js";import{ScreenshotManager as M}from"./ScreenshotManager.js";import{createContextOrErrorHTML as D}from"../../../webgl/context-util.js";const O=s.getLogger("esri.views.3d.webgl-engine.parts.View");let H=class extends(y(t)){constructor(e){super({}),this.events=new r,this.waterTextureRepository=new S,this._magnifierHelper=new C,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this._container=e.container,this._initializeContext(e),h((()=>{var e;return null==(e=this.waterTextureRepository)?void 0:e.updating}),(()=>this.requestRender()),d),this._magnifierHelper.events.on("request-render",(()=>this.requestRender())),this._stippleTextureRepository=new A(this._rctx),this._shaderTechniqueRepository=new f({rctx:this._rctx,viewingMode:e.viewingMode,stippleTextureRepository:this._stippleTextureRepository,waterTextureRepository:this.waterTextureRepository}),this._textureRepository=new j(e,this._shaderTechniqueRepository,this._rctx),this._textureRepository.events.on("changed",(e=>this.requestRender(e))),this._materialRepository=new w(this._textureRepository,this._shaderTechniqueRepository,(()=>this.requestRender()),(()=>this.requestRender())),this._compositingHelper=new b(this._rctx,this._shaderTechniqueRepository),this._renderer=new T(this._materialRepository,this._textureRepository,this._shaderTechniqueRepository,this._rctx,this._compositingHelper,this._magnifierHelper,(e=>this.requestRender(e)),((t,r)=>e.schedule(t,r)),e),this._screenshotManager=new M(this._rctx,((e,t,r)=>this._renderer.render(e,t,t,r)),(e=>this.requestRender(e)),e.options.screenshot.renderOverlay,(e=>this.events.emit("force-camera-for-screenshot",e)),(()=>this._renderer.disposeOffscreenBuffers())),this._registerFrameTask(e)}normalizeCtorArgs(){return{}}dispose(){this._container.contains(this._canvas)&&this._container.removeChild(this._canvas),this._frameTask=o(this._frameTask),this._shaderTechniqueRepository=n(this._shaderTechniqueRepository),super.dispose(),this._tmpDepthBuffer=null,this._rctx=null}get performanceInfo(){const e=this._rctx.gl;return{renderer:this._renderer.performanceInfo,textureMemory:void 0!==e.getUsedTextureMemory?e.getUsedTextureMemory():void 0,renderbufferMemory:void 0!==e.getUsedRenderbufferMemory?e.getUsedRenderbufferMemory():void 0,VBOMemory:void 0!==e.getUsedVBOMemory?e.getUsedVBOMemory():void 0}}requestRender(e=R.UPDATE){e===R.UPDATE?this._needsUpdate=!0:this._needsRender=!0}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this._renderer.updating||this._textureRepository.updating||this.waterTextureRepository.updating||this._magnifierHelper.updating}ensureEdgeView(){return this._renderer.ensureEdgeView()}get edgeView(){return this._renderer.edgeView}get textureRepository(){return this._textureRepository}get compositingHelper(){return this._compositingHelper}set magnifier(e){this._magnifierHelper.magnifier=e}updateLightSources(e,t,r){this._renderer.updateLightSources(e,t,r),this.requestRender()}setRenderParameters(e){void 0!==e.idleSuspend&&this._idleSuspend!==!!e.idleSuspend&&(this._idleSuspend=!!e.idleSuspend,this.requestRender()),this._renderer.setRenderParameters(e)}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}modify(e){this._renderer.modify(e),e.clear()}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(e)}getAlpha(){return this._rctx.contextAttributes.alpha}get hasShadowsEnabled(){return this._renderer.hasShadowsEnabled}readAccumulatedShadow(e){return this._renderer.readAccumulatedShadow(e[0],e[1])}readHUDVisibility(e,t,r,i,s){this._renderer.readHUDVisibility(e,t,r,i,s)}getMinimalDepthForArea(e,t,r,i,s,o=s){const n=i.constrainWindowSize(t,r,s*i.pixelRatio,o*i.pixelRatio),p=this._ensureDepthBuffer(n);this._renderer.readDepthPixels(i,n[0],n[1],n[2],n[3],p);let h=Number.MAX_VALUE;for(let a=0;a<n[2]*n[3];a++){const e=v(4*a,p,i.nearFar);h>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(h=e)}if(a(e)){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);a(s)&&h>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(h=s)}return h===Number.MAX_VALUE?void 0:h}_ensureDepthBuffer(e){const t=4*e[2]*e[3];return(p(this._tmpDepthBuffer)||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}get renderPlugins(){return this._renderer.renderPlugins}get test(){return{renderer:this._renderer}}get gpuMemoryUsage(){return this._renderer.gpuMemoryUsage}async reloadShaders(){q(),await this._shaderTechniqueRepository.reloadAll(),this.requestRender()}get animationTimestep(){return this._renderer.animationTimestep}_registerFrameTask(e){const t=e.state,r={viewCamera:t.camera,frameHasDecorations:!1};let i=!1,s=R.BACKGROUND,o=!1;const n={preRender:r=>{i=this.updating,s=this._needsUpdate?R.UPDATE:R.BACKGROUND,e.processSyncLayers();const o=l(r.time-this._lastAnimationUpdate);(o>this.animationTimestep||a(this.forcedAnimationTime)||i||this._needsRender)&&(this._renderer.updateAnimation({camera:t.camera,dt:o,forcedTime:this.forcedAnimationTime})&&this.requestRender(R.BACKGROUND),this._lastAnimationUpdate=r.time)},render:()=>{if((this._needsUpdate||this._needsRender||!this._idleSuspend||!this._renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const e=this._needsUpdate&&this._idleSuspend&&this._renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this._renderer.render(null,t.camera,t.contentCamera,x.ON),o=!0,e&&this._renderer.hasWaterReflection&&(this.requestRender(R.BACKGROUND),this._needsWaterReflectionUpdate=!0)}},update:()=>{r.viewCamera=t.camera,r.frameHasDecorations=this._renderer.hasSlicePlane||this._magnifierHelper.enabled,this._textureRepository.update(),this._screenshotManager.update(r)},finish:()=>{o&&(this._renderer.finish(s),o=!1)}};this._frameTask=c(n)}_initializeContext(e){const t=e.options;this._canvas=t.canvas,this._canvas||(this._canvas=document.createElement("canvas")),this._canvas.setAttribute("style","width: 100%; height:100%; display:block;");const r={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:null==t.stencil||t.stencil,powerPreference:"high-performance"},s=D("3d",this._canvas,r);if(p(s)){const e=i("esri-force-webgl");O.error(e)}else this._rctx=this._newRenderingContext(s,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&O.error("WebGL context has alpha channel even though no alpha channel was requested"),!this._rctx.contextAttributes.alpha&&i("safari")>=11&&(this._container.style.backgroundColor="black"),this._container.appendChild(this._canvas)}_newRenderingContext(e,t){const r={disabledExtensions:t.options.deactivatedWebGLExtensions||{},debugWebGLExtensions:t.options.debugWebGLExtensions||{},maxAnisotropy:8},i=(e,r)=>t.resourceController.memoryController.newCache(e,r);if(E.enableContextCache){let t=B.get(e);return t?(t.configure(r),t.newCache=i,t.ref(),t):(t=new U(e,r,i),B.set(e,t),t.ref(),t)}return new U(e,r,i)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("standardDerivatives"),this._rctx.capabilities.enable("shaderTextureLOD"),this._rctx.capabilities.enable("textureFloat")}get componentObjectCollection(){return p(this._componentObjectCollection)&&(this._componentObjectCollection=new _(this._renderer.renderPassManager)),this._componentObjectCollection}set componentObjectCollection(e){this._componentObjectCollection=e}};e([m({type:Boolean,readOnly:!0})],H.prototype,"updating",null),e([g()],H.prototype,"_rctx",void 0),e([g()],H.prototype,"_container",void 0),e([g()],H.prototype,"_canvas",void 0),e([g()],H.prototype,"_stippleTextureRepository",void 0),e([g(),m()],H.prototype,"waterTextureRepository",void 0),e([g(),m()],H.prototype,"_magnifierHelper",void 0),e([g(),m()],H.prototype,"_textureRepository",void 0),e([g()],H.prototype,"_compositingHelper",void 0),e([g()],H.prototype,"_renderer",void 0),e([g()],H.prototype,"_screenshotManager",void 0),e([g()],H.prototype,"componentObjectCollection",null),e([g()],H.prototype,"_componentObjectCollection",void 0),e([m()],H.prototype,"_needsUpdate",void 0),e([m()],H.prototype,"_needsWaterReflectionUpdate",void 0),H=e([u("esri.views.3d.webgl-engine.parts.RenderView")],H);const E={enableContextCache:!1,disposeContextCache:()=>{B.forEach((e=>e.dispose())),B.clear()}},B=new Map;export{H as RenderView,E as test};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as e,disposeMaybe as t}from"../../../../core/maybe.js";import{createResolver as r}from"../../../../core/promiseUtils.js";import{b as s}from"../../../../chunks/vec4f64.js";import{AutoDisposable as i}from"../lib/AutoDisposable.js";import{RenderRequestType as o,Decorations as n}from"../lib/basicInterfaces.js";import{
|
|
5
|
+
import{isNone as e,disposeMaybe as t}from"../../../../core/maybe.js";import{createResolver as r}from"../../../../core/promiseUtils.js";import{b as s}from"../../../../chunks/vec4f64.js";import{AutoDisposable as i}from"../lib/AutoDisposable.js";import{RenderRequestType as o,Decorations as n}from"../lib/basicInterfaces.js";import{createEmptyImageData as a,resampleHermite as h}from"../../../support/screenshotUtils.js";import{PixelFormat as c,DataType as l,TargetType as f,DepthStencilTargetType as d}from"../../../webgl/enums.js";import{FramebufferObject as u}from"../../../webgl/FramebufferObject.js";class g extends i{constructor(e,t,r,s,i,o){super(),this._rctx=e,this._renderScene=t,this._requestRenderScene=r,this._renderOverlay=s,this._forceCameraHook=i,this._disposeOffscreenBuffers=o,this.supersample=!0,this._screenshotQueue=new Array}dispose(){this._rctx=null}takeScreenshot(e){this._requestRenderScene(o.BACKGROUND);const t=r();return this._screenshotQueue.push({settings:e,resolver:t}),t.promise}update(e){for(const t of this._screenshotQueue){if(this.isDisposed){t.resolver.reject();continue}const r={...t.settings,pixelRatio:t.settings.pixelRatio*e.viewCamera.pixelRatio},s=this._renderScreenshot(e,r);t.resolver(s)}this._screenshotQueue.length=0}_renderScreenshotOverlay(t,r,s){if(e(this._renderOverlay))return r;t.width=r.width,t.height=r.height;const i=t.getContext("2d"),o=s.pixelRatio;return i.save(),i.translate(0,r.height),i.scale(1,-1),s.region&&i.translate(-s.region.x,-s.region.y),i.scale(o,o),r=this._renderOverlay(t,r),i.restore(),r}_readbackScreenshot(e,t){return e.resample?this._readbackScreenshotResampled(e,t):this._readbackScreenshotImmediate(e,t)}_readbackScreenshotResampled(e,t){const{framebufferWidth:r,framebufferHeight:s,region:i,resample:o}=e,n=this._ensureScreenshotEncodeCanvas();let f=a(r,s,n);this._rctx.gl.readPixels(0,0,r,s,c.RGBA,l.UNSIGNED_BYTE,new Uint8Array(f.data.buffer)),t(),f=this._renderScreenshotOverlay(n,f,{...e,region:null});const d=a(i.width,i.height,n);return h(f,d,!0,o.region.x,s-(o.region.y+o.region.height),o.region.width,o.region.height)}_readbackScreenshotImmediate(e,t){const{framebufferHeight:r,region:s}=e,i=this._ensureScreenshotEncodeCanvas(),o=a(s.width,s.height,i);return this._rctx.gl.readPixels(s.x,r-(s.y+s.height),s.width,s.height,c.RGBA,l.UNSIGNED_BYTE,new Uint8Array(o.data.buffer)),t(),this._renderScreenshotOverlay(i,o,e)}_renderScreenshot(e,r){let i=null;const o=e.viewCamera,{framebufferWidth:a,framebufferHeight:h}=r;let c=!1;const l=r.disableDecorations&&e.frameHasDecorations,g=a!==o.fullWidth||h!==o.fullHeight,_=r.ignorePadding&&o.pixelRatio!==r.pixelRatio,m=g||l||_;if(m){const e=o.clone();if(r.ignorePadding){const t=s(e.padding);for(let s=0;s<4;s++)t[s]=Math.round(t[s]/e.pixelRatio*r.pixelRatio);e.padding=t}e.fullWidth=a,e.fullHeight=h,e.pixelRatio=r.pixelRatio;const t=o.fovX-e.fovX,l=o.fovY-e.fovY;t<0&&t<l?e.fovX=o.fovX:l<0&&l<t&&(e.fovY=o.fovY),this._forceCameraHook(e),c=!0,i=new u(this._rctx,{width:e.fullWidth,height:e.fullHeight,colorTarget:f.TEXTURE,depthStencilTarget:d.DEPTH_STENCIL_RENDER_BUFFER}),this._renderScene(i,e,r.disableDecorations?n.OFF:n.ON),this._disposeOffscreenBuffers()}const p=()=>{this._rctx.bindFramebuffer(null),t(i)},b=this._readbackScreenshot(r,p);if(p(),m&&!this._rctx.contextAttributes.alpha)for(let t=3;t<b.data.length;t+=4)b.data[t]=255;return c&&this._forceCameraHook(o),b}_ensureScreenshotEncodeCanvas(){return this._screenshotEncodeCanvas||(this._screenshotEncodeCanvas=document.createElement("canvas")),this._screenshotEncodeCanvas}}export{g as ScreenshotManager};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutputOptions.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/PositionAttribute.glsl.js";import"../core/shaderLibrary/attributes/SymbolColor.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/AlphaDiscard.glsl.js";import"../core/shaderLibrary/util/HeaderComment.glsl.js";import"../core/shaderLibrary/util/MixExternalColor.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3Uniform.js";import"../core/shaderModules/Float4Uniform.js";import"../core/shaderModules/FloatUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/Matrix4Uniform.js";import"../core/shaderModules/ShaderBuilder.js";import"../core/shaderModules/Texture2DUniform.js";import"../lib/basicInterfaces.js";import"../lib/VertexAttribute.js";export{b as build}from"../../../../chunks/DefaultMaterial.glsl.js";
|
|
5
|
+
import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutputOptions.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/PositionAttribute.glsl.js";import"../core/shaderLibrary/attributes/SymbolColor.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/AlphaDiscard.glsl.js";import"../core/shaderLibrary/util/HeaderComment.glsl.js";import"../core/shaderLibrary/util/MixExternalColor.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3Uniform.js";import"../core/shaderModules/Float4Uniform.js";import"../core/shaderModules/FloatUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/Matrix4Uniform.js";import"../core/shaderModules/ShaderBuilder.js";import"../core/shaderModules/Texture2DUniform.js";import"../core/shaderTechnique/BindType.js";import"../lib/basicInterfaces.js";import"../lib/VertexAttribute.js";export{b as build}from"../../../../chunks/DefaultMaterial.glsl.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Logger.js";import{isSome as r}from"../../../../core/maybe.js";import{c as i,f as t}from"../../../../chunks/vec3f64.js";import{ViewingMode as o}from"../../../ViewingMode.js";import{ShaderOutput as s}from"../core/shaderLibrary/ShaderOutputOptions.js";import{TextureCoordinateAttributeType as a}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormalDrawParameters as n}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{bindVerticalOffsetUniforms as l}from"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{bindPBRUniforms as m}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{bindReadShadowMapDraw as p}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{doublePrecisionRequiresObfuscation as c}from"../core/shaderLibrary/util/DoublePrecision.glsl.js";import{ReloadableShaderModule as u}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as h}from"../core/shaderTechnique/ShaderTechnique.js";import{AlphaDiscardMode as f,DepthTestFunction as d,TransparencyPassType as g,CullFaceOptions as b}from"../lib/basicInterfaces.js";import{Default3D as x}from"../lib/DefaultVertexAttributeLocations.js";import{
|
|
5
|
+
import e from"../../../../core/Logger.js";import{isSome as r}from"../../../../core/maybe.js";import{c as i,f as t}from"../../../../chunks/vec3f64.js";import{ViewingMode as o}from"../../../ViewingMode.js";import{ShaderOutput as s}from"../core/shaderLibrary/ShaderOutputOptions.js";import{TextureCoordinateAttributeType as a}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormalDrawParameters as n}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{bindVerticalOffsetUniforms as l}from"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{bindPBRUniforms as m}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{bindReadShadowMapDraw as p}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{doublePrecisionRequiresObfuscation as c}from"../core/shaderLibrary/util/DoublePrecision.glsl.js";import{ReloadableShaderModule as u}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as h}from"../core/shaderTechnique/ShaderTechnique.js";import{AlphaDiscardMode as f,DepthTestFunction as d,TransparencyPassType as g,CullFaceOptions as b}from"../lib/basicInterfaces.js";import{Default3D as x}from"../lib/DefaultVertexAttributeLocations.js";import{blendingDefault as M,oitBlending as y,oitDepthTest as T,getOITPolygonOffset as P}from"../lib/OrderIndependentTransparency.js";import{Program as j}from"../lib/Program.js";import{stencilWriteMaskOn as w,stencilToolMaskBaseParams as v,stencilBaseAllZerosParams as O}from"../lib/StencilUtils.js";import{colorMixModes as S,bindScreenSizePerspective as U}from"../materials/internal/MaterialUtil.js";import{D as L}from"../../../../chunks/DefaultMaterial.glsl.js";import{CompareFunction as D}from"../../../webgl/enums.js";import{makePipelineState as C,cullingParams as A,defaultDepthWriteParams as _,defaultColorWriteParams as z}from"../../../webgl/renderState.js";const q=e.getLogger("esri.views.3d.webgl-engine.shaders.DefaultTechnique");class F extends n{constructor(){super(...arguments),this.origin=i(),this.slicePlaneLocalOrigin=this.origin}}class N extends h{initializeConfiguration(e,r){r.spherical=e.viewingMode===o.Global,r.doublePrecisionRequiresObfuscation=c(e.rctx),r.textureCoordinateType=r.hasColorTexture||r.hasMetalnessAndRoughnessTexture||r.hasEmissionTexture||r.hasOcclusionTexture||r.hasNormalTexture?a.Default:a.None}initializeProgram(e){return this._initializeProgram(e,N.shader)}_initializeProgram(e,r){const i=r.get().build(this.configuration);return new j(e.rctx,i,x)}bindPass(e,i){this.program.bindPass(e,i);const t=this.configuration.output;this.configuration.hasModelTransformation&&(r(e.modelTransformation)?this.program.setUniformMatrix4fv("model",e.modelTransformation):q.warnOnce("hasModelTransformation true, but no modelTransformation found.")),t===s.Alpha&&(this.program.setUniform1f("opacity",e.opacity),this.program.setUniform1f("layerOpacity",e.layerOpacity),this.program.setUniform4fv("externalColor",e.externalColor),this.program.setUniform1i("colorMixMode",S[e.colorMixMode])),t===s.Color&&(i.lighting.setUniforms(this.program,!1),this.program.setUniform3fv("ambient",e.ambient),this.program.setUniform3fv("diffuse",e.diffuse),this.program.setUniform4fv("externalColor",e.externalColor),this.program.setUniform1i("colorMixMode",S[e.colorMixMode]),this.program.setUniform1f("opacity",e.opacity),this.program.setUniform1f("layerOpacity",e.layerOpacity),m(this.program,e,this.configuration.pbrMode)),l(this.program,e,i),U(e.screenSizePerspective,this.program,"screenSizePerspectiveAlignment"),e.textureAlphaMode!==f.Mask&&e.textureAlphaMode!==f.MaskBlend||this.program.setUniform1f("textureAlphaCutoff",e.textureAlphaCutoff),r(i.shadowMap)&&i.shadowMap.bind(this.program),r(i.ssaoHelper)&&i.ssaoHelper.bind(this.program,i.camera)}bindDraw(e,r){if(this.program.bindDraw(e,r),this.program.rebindTextures(),this.configuration.output===s.Color){const i=this.configuration.instancedDoublePrecision?t(r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):e.origin;p(this.program,r.shadowMap,i)}}_convertDepthTestFunction(e){return e===d.Lequal?D.LEQUAL:D.LESS}_setPipeline(e,r){const i=this.configuration,t=e===g.NONE,o=e===g.FrontFace;return C({blending:i.output!==s.Color&&i.output!==s.Alpha||!i.transparent?null:t?M:y(e),culling:I(i)&&A(i.cullFace),depthTest:{func:T(e,this._convertDepthTestFunction(i.customDepthTest))},depthWrite:t||o?i.writeDepth&&_:null,colorWrite:z,stencilWrite:i.hasOccludees?w:null,stencilTest:i.hasOccludees?r?v:O:null,polygonOffset:t||o?null:P(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._setPipeline(this.configuration.transparencyPassType,!0),this._setPipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,r){return r?this._occludeePipelineState:super.getPipelineState(e,r)}}function I(e){return e.cullFace!==b.None||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}N.shader=new u(L,(()=>import("./DefaultMaterial.glsl.js")));export{F as DefaultMaterialDrawParameters,N as DefaultMaterialTechnique};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutputOptions.js";import{NormalAttributeType as e}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as s}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{NormalsDoubleSidedMode as i}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as r}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{parameter as a}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{AlphaDiscardMode as p,CullFaceOptions as h,TransparencyPassType as n,DepthTestFunction as d}from"../lib/basicInterfaces.js";import{DefaultTechniqueConfiguration as l}from"../materials/DefaultTechniqueConfiguration.js";class c extends l{constructor(){super(...arguments),this.output=o.Color,this.alphaDiscardMode=p.Opaque,this.doubleSidedMode=i.None,this.pbrMode=r.Disabled,this.cullFace=h.None,this.transparencyPassType=n.NONE,this.normalType=e.Attribute,this.textureCoordinateType=s.None,this.customDepthTest=d.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetalnessAndRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1}}t([a({count:o.COUNT})],c.prototype,"output",void 0),t([a({count:p.COUNT})],c.prototype,"alphaDiscardMode",void 0),t([a({count:i.COUNT})],c.prototype,"doubleSidedMode",void 0),t([a({count:r.COUNT})],c.prototype,"pbrMode",void 0),t([a({count:h.COUNT})],c.prototype,"cullFace",void 0),t([a({count:n.COUNT})],c.prototype,"transparencyPassType",void 0),t([a({count:e.COUNT})],c.prototype,"normalType",void 0),t([a({count:s.COUNT})],c.prototype,"textureCoordinateType",void 0),t([a({count:d.COUNT})],c.prototype,"customDepthTest",void 0),t([a()],c.prototype,"spherical",void 0),t([a()],c.prototype,"hasVertexColors",void 0),t([a()],c.prototype,"hasSymbolColors",void 0),t([a()],c.prototype,"hasVerticalOffset",void 0),t([a()],c.prototype,"hasSlicePlane",void 0),t([a()],c.prototype,"hasSliceHighlight",void 0),t([a()],c.prototype,"hasColorTexture",void 0),t([a()],c.prototype,"hasMetalnessAndRoughnessTexture",void 0),t([a()],c.prototype,"hasEmissionTexture",void 0),t([a()],c.prototype,"hasOcclusionTexture",void 0),t([a()],c.prototype,"hasNormalTexture",void 0),t([a()],c.prototype,"hasScreenSizePerspective",void 0),t([a()],c.prototype,"hasVertexTangents",void 0),t([a()],c.prototype,"hasOccludees",void 0),t([a()],c.prototype,"hasMultipassTerrain",void 0),t([a()],c.prototype,"hasModelTransformation",void 0),t([a()],c.prototype,"offsetBackfaces",void 0),t([a()],c.prototype,"vvSize",void 0),t([a()],c.prototype,"vvColor",void 0),t([a()],c.prototype,"receiveShadows",void 0),t([a()],c.prototype,"receiveAmbientOcclusion",void 0),t([a()],c.prototype,"textureAlphaPremultiplied",void 0),t([a()],c.prototype,"instanced",void 0),t([a()],c.prototype,"instancedColor",void 0),t([a()],c.prototype,"instancedDoublePrecision",void 0),t([a()],c.prototype,"doublePrecisionRequiresObfuscation",void 0),t([a()],c.prototype,"writeDepth",void 0),t([a()],c.prototype,"transparent",void 0),t([a()],c.prototype,"enableOffset",void 0),t([a()],c.prototype,"cullAboveGround",void 0),t([a({constValue:!0})],c.prototype,"hasVvInstancing",void 0),t([a({constValue:!1})],c.prototype,"useCustomDTRExponentForWater",void 0),t([a({constValue:!1})],c.prototype,"supportsTextureAtlas",void 0),t([a({constValue:!0})],c.prototype,"useFillLights",void 0);export{c as DefaultMaterialTechniqueConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../chunks/vec2.js";import"../../../../chunks/vec2f64.js";import"../../../../chunks/vec4f64.js";import"../../layers/graphics/sdfPrimitives.js";import"../core/shaderLibrary/ShaderOutputOptions.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/hud/AlignPixel.glsl.js";import"../core/shaderLibrary/hud/HUD.glsl.js";import"../core/shaderLibrary/hud/HUDOcclusionPass.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/AlphaDiscard.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import"../core/shaderLibrary/util/ScreenSizePerspective.glsl.js";import"../core/shaderModules/Float2Uniform.js";import"../core/shaderModules/Float4sUniform.js";import"../core/shaderModules/Float4Uniform.js";import"../core/shaderModules/FloatsUniform.js";import"../core/shaderModules/FloatUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"../core/shaderModules/Texture2DUniform.js";import"../core/shaderTechnique/BindType.js";import"../lib/basicInterfaces.js";import"../lib/VertexAttribute.js";export{b as bindHUDMaterialUniforms,a as build,c as calculateAnchorPosForRendering}from"../../../../chunks/HUDMaterial.glsl.js";
|
|
5
|
+
import"../../../../core/maybe.js";import"../../../../chunks/vec2.js";import"../../../../chunks/vec2f64.js";import"../../../../chunks/vec4f64.js";import"../../layers/graphics/sdfPrimitives.js";import"../core/shaderLibrary/ShaderOutputOptions.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/hud/AlignPixel.glsl.js";import"../core/shaderLibrary/hud/HUD.glsl.js";import"../core/shaderLibrary/hud/HUDOcclusionPass.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/AlphaDiscard.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import"../core/shaderLibrary/util/ScreenSizePerspective.glsl.js";import"../core/shaderModules/Float2Uniform.js";import"../core/shaderModules/Float4sUniform.js";import"../core/shaderModules/Float4Uniform.js";import"../core/shaderModules/FloatsUniform.js";import"../core/shaderModules/FloatUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"../core/shaderModules/Texture2DUniform.js";import"../core/shaderTechnique/BindType.js";import"../lib/basicInterfaces.js";import"../lib/VertexAttribute.js";export{b as bindHUDMaterialUniforms,a as build,c as calculateAnchorPosForRendering}from"../../../../chunks/HUDMaterial.glsl.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ViewingMode as r}from"../../../ViewingMode.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutputOptions.js";import{bindVerticalOffsetUniforms as t}from"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{bindHUDUniforms as e}from"../core/shaderLibrary/hud/HUD.glsl.js";import{bindMultipassGeometryTexture as o}from"../core/shaderLibrary/shading/MultipassGeometryTest.glsl.js";import{bindScreenSizePerspectiveUniforms as s}from"../core/shaderLibrary/util/ScreenSizePerspective.glsl.js";import{ReloadableShaderModule as a}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as n}from"../core/shaderTechnique/ShaderTechnique.js";import{TransparencyPassType as l}from"../lib/basicInterfaces.js";import{Default3D as
|
|
5
|
+
import{ViewingMode as r}from"../../../ViewingMode.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutputOptions.js";import{bindVerticalOffsetUniforms as t}from"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{bindHUDUniforms as e}from"../core/shaderLibrary/hud/HUD.glsl.js";import{bindMultipassGeometryTexture as o}from"../core/shaderLibrary/shading/MultipassGeometryTest.glsl.js";import{bindScreenSizePerspectiveUniforms as s}from"../core/shaderLibrary/util/ScreenSizePerspective.glsl.js";import{ReloadableShaderModule as a}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as n}from"../core/shaderTechnique/ShaderTechnique.js";import{TransparencyPassType as l}from"../lib/basicInterfaces.js";import{Default3D as p}from"../lib/DefaultVertexAttributeLocations.js";import{oitBlending as u}from"../lib/OrderIndependentTransparency.js";import{Program as m}from"../lib/Program.js";import{b as h,H as c}from"../../../../chunks/HUDMaterial.glsl.js";import{BlendFactor as f,CompareFunction as g,PrimitiveType as d}from"../../../webgl/enums.js";import{simpleBlendingParams as b,defaultDepthWriteParams as y,makePipelineState as j,defaultColorWriteParams as O}from"../../../webgl/renderState.js";class T extends n{initializeConfiguration(i,t){t.spherical=i.viewingMode===r.Global}initializeProgram(r){const i=T.shader.get().build(this.configuration);return new m(r.rctx,i,p)}bindPass(r,a){this.program.bindPass(r,a),this.program.setUniform1f("cameraGroundRelative",a.camera.aboveGround?1:-1),this.program.setUniform1f("perDistancePixelRatio",Math.tan(a.camera.fovY/2)/(a.camera.fullViewport[2]/2)),this.program.setUniform1f("polygonOffset",r.shaderPolygonOffset),t(this.program,r,a),s(this.program,r),this.configuration.output===i.Occlusion?o(this.program,a.multipassGeometry):(e(this.program,a),h(this.program,r,a.camera.pixelRatio||1),this.configuration.occlusionTestEnabled&&this.program.bindTexture("hudVisibilityTexture",a.hudVisibilityTexture))}bindDraw(r,i){this.program.bindDraw(r,i),this.program.rebindTextures()}_setPipelineState(r){const t=this.configuration,e=r===l.NONE,o=r===l.FrontFace,s=this.configuration.hasPolygonOffset&&P,a=(e||o)&&t.output!==i.Highlight?(t.depthEnabled||t.output===i.Occlusion)&&y:null;return j({blending:t.output===i.Color||t.output===i.Alpha||t.output===i.Highlight?e?S:u(r):null,depthTest:{func:g.LEQUAL},depthWrite:a,colorWrite:O,polygonOffset:s})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}get primitiveType(){return this.configuration.output===i.Occlusion?d.POINTS:d.TRIANGLES}}T.shader=new a(c,(()=>import("./HUDMaterial.glsl.js")));const P={factor:0,units:-4},S=b(f.ONE,f.ONE_MINUS_SRC_ALPHA);export{T as HUDMaterialTechnique};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../core/shaderLibrary/ShaderOutputOptions.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/util/AlphaDiscard.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2Uniform.js";import"../core/shaderModules/FloatUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"../core/shaderModules/Texture2DUniform.js";import"../core/shaderTechnique/BindType.js";import"../lib/basicInterfaces.js";import"../lib/VertexAttribute.js";export{b as build}from"../../../../chunks/ImageMaterial.glsl.js";
|
|
5
|
+
import"../../../../core/maybe.js";import"../../../../chunks/vec2f64.js";import"../core/shaderLibrary/ShaderOutputOptions.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/util/AlphaDiscard.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2Uniform.js";import"../core/shaderModules/FloatUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/ShaderBuilder.js";import"../core/shaderModules/Texture2DUniform.js";import"../core/shaderTechnique/BindType.js";import"../lib/basicInterfaces.js";import"../lib/VertexAttribute.js";export{b as build}from"../../../../chunks/ImageMaterial.glsl.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutputOptions.js";import{
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutputOptions.js";import{NoParameters as r}from"../core/shaderModules/interfaces.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as a,TransparencyPassType as n}from"../lib/basicInterfaces.js";import{Default3D as l}from"../lib/DefaultVertexAttributeLocations.js";import{oitBlending as p,oitDepthTest as c,oitDepthWrite as u,getOITPolygonOffset as h}from"../lib/OrderIndependentTransparency.js";import{Program as d}from"../lib/Program.js";import{stencilWriteMaskOn as m,stencilToolMaskBaseParams as f,stencilBaseAllZerosParams as b}from"../lib/StencilUtils.js";import{DefaultTechniqueConfiguration as g}from"../materials/DefaultTechniqueConfiguration.js";import{I as y}from"../../../../chunks/ImageMaterial.glsl.js";import{BlendFactor as T}from"../../../webgl/enums.js";import{simpleBlendingParams as O,makePipelineState as P,cullingParams as S,defaultDepthWriteParams as j,defaultColorWriteParams as v}from"../../../webgl/renderState.js";class N extends r{}class w extends s{initializeProgram(e){const t=w.shader.get().build(this.configuration);return new d(e.rctx,t,l)}bindDraw(e,t){this.program.bindDraw(e,t),this.program.rebindTextures()}_setPipelineState(e,r){const i=this.configuration,s=e===n.NONE,o=e===n.FrontFace;return P({blending:i.output!==t.Color&&i.output!==t.Alpha||!i.transparent?null:s?_:p(e),culling:S(i.cullFace),depthTest:{func:c(e)},depthWrite:s?i.writeDepth&&j:u(e),colorWrite:v,stencilWrite:i.hasOccludees?m:null,stencilTest:i.hasOccludees?r?f:b:null,polygonOffset:s||o?null:h(i.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)}}w.shader=new i(y,(()=>import("./ImageMaterial.glsl.js")));const _=O(T.ONE,T.ONE_MINUS_SRC_ALPHA);class C extends g{constructor(){super(...arguments),this.output=t.Color,this.cullFace=a.None,this.hasSlicePlane=!1,this.transparent=!1,this.enableOffset=!0,this.writeDepth=!0,this.hasOccludees=!1,this.transparencyPassType=n.NONE,this.hasMultipassTerrain=!1,this.cullAboveGround=!1}}e([o({count:t.COUNT})],C.prototype,"output",void 0),e([o({count:a.COUNT})],C.prototype,"cullFace",void 0),e([o()],C.prototype,"hasSlicePlane",void 0),e([o()],C.prototype,"transparent",void 0),e([o()],C.prototype,"enableOffset",void 0),e([o()],C.prototype,"writeDepth",void 0),e([o()],C.prototype,"hasOccludees",void 0),e([o({count:n.COUNT})],C.prototype,"transparencyPassType",void 0),e([o()],C.prototype,"hasMultipassTerrain",void 0),e([o()],C.prototype,"cullAboveGround",void 0);export{N as ImageMaterialPassParameters,w as ImageMaterialTechnique,C as ImageMaterialTechniqueConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ShaderOutput as e}from"../core/shaderLibrary/ShaderOutputOptions.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{TransparencyPassType as r}from"../lib/basicInterfaces.js";import{
|
|
5
|
+
import{ShaderOutput as e}from"../core/shaderLibrary/ShaderOutputOptions.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{TransparencyPassType as r}from"../lib/basicInterfaces.js";import{blendingDefault as n,oitBlending as l,oitDepthTest as s,oitDepthWrite as o}from"../lib/OrderIndependentTransparency.js";import{Program as a}from"../lib/Program.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{stencilWriteMaskOn as p,stencilToolMaskBaseParams as u,stencilBaseAllZerosParams as d,depthCompareAlways as h,stencilToolTransparentOccluderParams as T,stencilWriteMaskOff as m,stencilToolMaskOccluderParams as f,depthCompareLess as P}from"../lib/StencilUtils.js";import{VertexAttribute as g}from"../lib/VertexAttribute.js";import{L as b}from"../../../../chunks/LineMarker.glsl.js";import{makePipelineState as O,defaultDepthWriteParams as S,defaultColorWriteParams as E}from"../../../webgl/renderState.js";const A=new Map([[g.POSITION,0],[g.UV0,2],[g.AUXPOS1,3],[g.SIZE,6],[g.SIZEFEATUREATTRIBUTE,6],[g.COLOR,5],[g.COLORFEATUREATTRIBUTE,5],[g.OPACITYFEATUREATTRIBUTE,7]]);class R extends i{initializeProgram(e){const t=R.shader.get().build(this.configuration);return new a(e.rctx,t,A)}bindDraw(e,t){this.program.bindDraw(e,t),this.program.rebindTextures()}_makePipelineState(t,i){const a=this.configuration,c=t===r.NONE;return O({blending:a.output===e.Color||a.output===e.Alpha?c?n:l(t):null,depthTest:{func:s(t)},depthWrite:c?a.writeDepth&&S:o(t),colorWrite:E,stencilWrite:a.hasOccludees?p:null,stencilTest:a.hasOccludees?i?u:d:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(){return this.configuration.occluder&&(this._occluderPipelineTransparent=O({blending:n,depthTest:h,depthWrite:null,colorWrite:E,stencilWrite:null,stencilTest:T}),this._occluderPipelineOpaque=O({blending:n,depthTest:h,depthWrite:null,colorWrite:E,stencilWrite:m,stencilTest:f}),this._occluderPipelineMaskWrite=O({blending:null,depthTest:P,depthWrite:null,colorWrite:null,stencilWrite:p,stencilTest:u})),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===c.TRANSPARENT_OCCLUDER_MATERIAL?this._occluderPipelineTransparent:e===c.OCCLUDER_MATERIAL?this._occluderPipelineOpaque:this._occluderPipelineMaskWrite:super.getPipelineState(e,t)}}R.shader=new t(b,(()=>import("./LineMarker.glsl.js")));export{R as LineMarkerTechnique,A as markerVertexAttributeLocations};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutputOptions.js";import{parameter as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TransparencyPassType as
|
|
5
|
+
import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutputOptions.js";import{parameter as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TransparencyPassType as i}from"../lib/basicInterfaces.js";import{DefaultTechniqueConfiguration as r}from"../materials/DefaultTechniqueConfiguration.js";class s extends r{constructor(){super(...arguments),this.output=t.Color,this.transparencyPassType=i.NONE,this.occluder=!1,this.hasSlicePlane=!1,this.writeDepth=!1,this.draped=!1,this.hasCap=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1}}o([e({count:t.COUNT})],s.prototype,"output",void 0),o([e({count:i.COUNT})],s.prototype,"transparencyPassType",void 0),o([e()],s.prototype,"occluder",void 0),o([e()],s.prototype,"hasSlicePlane",void 0),o([e()],s.prototype,"writeDepth",void 0),o([e()],s.prototype,"draped",void 0),o([e()],s.prototype,"hasCap",void 0),o([e()],s.prototype,"vvSize",void 0),o([e()],s.prototype,"vvColor",void 0),o([e()],s.prototype,"vvOpacity",void 0),o([e()],s.prototype,"hasOccludees",void 0),o([e()],s.prototype,"hasMultipassTerrain",void 0),o([e()],s.prototype,"cullAboveGround",void 0),o([e({constValue:!0})],s.prototype,"hasVvInstancing",void 0),o([e({constValue:!0})],s.prototype,"hasSliceTranslatedView",void 0);export{s as LineMarkerTechniqueConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutputOptions.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/PositionAttribute.glsl.js";import"../core/shaderLibrary/attributes/SymbolColor.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/AlphaDiscard.glsl.js";import"../core/shaderLibrary/util/MixExternalColor.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3Uniform.js";import"../core/shaderModules/Float4Uniform.js";import"../core/shaderModules/FloatUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/Matrix4Uniform.js";import"../core/shaderModules/ShaderBuilder.js";import"../core/shaderModules/Texture2DUniform.js";import"../lib/basicInterfaces.js";import"../lib/VertexAttribute.js";export{b as build}from"../../../../chunks/RealisticTree.glsl.js";
|
|
5
|
+
import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutputOptions.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/PositionAttribute.glsl.js";import"../core/shaderLibrary/attributes/SymbolColor.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/AlphaDiscard.glsl.js";import"../core/shaderLibrary/util/MixExternalColor.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3Uniform.js";import"../core/shaderModules/Float4Uniform.js";import"../core/shaderModules/FloatUniform.js";import"../core/shaderModules/interfaces.js";import"../core/shaderModules/Matrix4Uniform.js";import"../core/shaderModules/ShaderBuilder.js";import"../core/shaderModules/Texture2DUniform.js";import"../core/shaderTechnique/BindType.js";import"../lib/basicInterfaces.js";import"../lib/VertexAttribute.js";export{b as build}from"../../../../chunks/RealisticTree.glsl.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutputOptions.js";import{PBRMode as t}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{OverlayMode as r}from"../core/shaderLibrary/terrain/Overlay.glsl.js";import{parameter as i}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as s}from"../materials/DefaultTechniqueConfiguration.js";class a extends s{constructor(){super(...arguments),this.output=o.Color,this.overlayMode=r.Disabled,this.spherical=!1,this.atmosphere=!1,this.receiveShadows=!1,this.hasSlicePlane=!1,this.backfaceCullingEnabled=!1,this.stencilEnabled=!1,this.textureFadingEnabled=!1,this.hasBackgroundColor=!1,this.useGrid=!1,this.renderOccluded=!1,this.hasScreenSpaceReflections=!1,this.tileBorders=!1,this.screenSizePerspective=!1}}e([i({count:o.COUNT})],a.prototype,"output",void 0),e([i({count:r.COUNT})],a.prototype,"overlayMode",void 0),e([i()],a.prototype,"spherical",void 0),e([i()],a.prototype,"atmosphere",void 0),e([i()],a.prototype,"receiveShadows",void 0),e([i()],a.prototype,"hasSlicePlane",void 0),e([i()],a.prototype,"backfaceCullingEnabled",void 0),e([i()],a.prototype,"stencilEnabled",void 0),e([i()],a.prototype,"textureFadingEnabled",void 0),e([i()],a.prototype,"hasBackgroundColor",void 0),e([i()],a.prototype,"useGrid",void 0),e([i()],a.prototype,"renderOccluded",void 0),e([i()],a.prototype,"hasScreenSpaceReflections",void 0),e([i()],a.prototype,"tileBorders",void 0),e([i()],a.prototype,"screenSizePerspective",void 0),e([i({constValue:t.Disabled})],a.prototype,"pbrMode",void 0),e([i({constValue:!1})],a.prototype,"receiveAmbientOcclusion",void 0),e([i({constValue:!1})],a.prototype,"highStepCount",void 0),e([i({constValue:!1})],a.prototype,"useCustomDTRExponentForWater",void 0),e([i({constValue:!1})],a.prototype,"
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutputOptions.js";import{PBRMode as t}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{OverlayMode as r}from"../core/shaderLibrary/terrain/Overlay.glsl.js";import{parameter as i}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as s}from"../materials/DefaultTechniqueConfiguration.js";class a extends s{constructor(){super(...arguments),this.output=o.Color,this.overlayMode=r.Disabled,this.spherical=!1,this.atmosphere=!1,this.receiveShadows=!1,this.hasSlicePlane=!1,this.backfaceCullingEnabled=!1,this.stencilEnabled=!1,this.textureFadingEnabled=!1,this.hasBackgroundColor=!1,this.useGrid=!1,this.renderOccluded=!1,this.hasScreenSpaceReflections=!1,this.tileBorders=!1,this.screenSizePerspective=!1}}e([i({count:o.COUNT})],a.prototype,"output",void 0),e([i({count:r.COUNT})],a.prototype,"overlayMode",void 0),e([i()],a.prototype,"spherical",void 0),e([i()],a.prototype,"atmosphere",void 0),e([i()],a.prototype,"receiveShadows",void 0),e([i()],a.prototype,"hasSlicePlane",void 0),e([i()],a.prototype,"backfaceCullingEnabled",void 0),e([i()],a.prototype,"stencilEnabled",void 0),e([i()],a.prototype,"textureFadingEnabled",void 0),e([i()],a.prototype,"hasBackgroundColor",void 0),e([i()],a.prototype,"useGrid",void 0),e([i()],a.prototype,"renderOccluded",void 0),e([i()],a.prototype,"hasScreenSpaceReflections",void 0),e([i()],a.prototype,"tileBorders",void 0),e([i()],a.prototype,"screenSizePerspective",void 0),e([i({constValue:t.Disabled})],a.prototype,"pbrMode",void 0),e([i({constValue:!1})],a.prototype,"receiveAmbientOcclusion",void 0),e([i({constValue:!1})],a.prototype,"highStepCount",void 0),e([i({constValue:!1})],a.prototype,"useCustomDTRExponentForWater",void 0),e([i({constValue:!1})],a.prototype,"useFillLights",void 0);export{a as TerrainTechniqueConfiguration};
|