@arcgis/core 5.1.0-next.16 → 5.1.0-next.18
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/{da5deed75e1a170a49b3.js → fd125618f513bc2f5206.js} +13 -13
- package/chunks/HUDMaterial.glsl.js +41 -64
- package/chunks/MeasurementArrow.glsl.js +7 -8
- package/chunks/RealisticTree.glsl.js +3 -3
- package/chunks/RibbonLine.glsl.js +29 -35
- package/chunks/Terrain.glsl.js +24 -24
- package/config.js +1 -1
- package/kernel.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/symbols/Symbol3DLayer.d.ts +12 -18
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/BufferCache.js +2 -0
- package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerOriginData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/TextureBufferCache.js +2 -0
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VboCache.js +2 -0
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +7 -7
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/alphaCutoff.glsl.js +2 -0
- package/views/webgl/VertexArrayObject.js +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as s,filterInPlace as o}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{getOrCreateMapValue as n}from"../../../../../core/MapUtils.js";import{NestedMap as r}from"../../../../../core/NestedMap.js";import{nullUid as a}from"../../../../../core/uid.js";import{property as i,subclass as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as s,filterInPlace as o}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{getOrCreateMapValue as n}from"../../../../../core/MapUtils.js";import{NestedMap as r}from"../../../../../core/NestedMap.js";import{nullUid as a}from"../../../../../core/uid.js";import{property as i,subclass as c}from"../../../../../core/accessorSupport/decorators.js";import{assert as l}from"../../lib/Util.js";import{bufferRangePool as f,mergeAdjacentRanges as u}from"./BufferRange.js";import{Instance as d}from"./Instance.js";import{PerBaseInstanceData as h}from"./PerBaseInstanceData.js";import{PerBufferData as m,hasVao as p}from"./PerBufferData.js";import{PerOriginData as g}from"./PerOriginData.js";import{VaoWriter as y}from"./VaoWriter.js";let v=class extends t{constructor(e){super(e),this._vaoWriter=null,this._useMetalWorkaround=!1,this._hasOccludees=!1}destroy(){for(const e of this.dataByBaseInstance.values()){for(const t of e.dataByOrigin.values())for(const e of t.buffers)this._vaoWriter?.deleteBuffer(e);e.dispose()}this.dataByBaseInstance.clear(),this.uninitializeRenderContext()}initializeRenderContext(e){this._useMetalWorkaround=e.renderContext.rctx.isAssumedMetalDriver,this._vaoWriter=new y(this.material,e.renderContext.rctx)}uninitializeRenderContext(){this._useMetalWorkaround=!1,this._vaoWriter=null}get hasOccludees(){return this._hasOccludees}modify(e,t){this._applyUpdates(e,t),this._applyAddsAndRemoves(e),this._updateDrawCommands()}get canCompact(){for(const e of this.dataByBaseInstance.values())for(const t of e.dataByOrigin.values())if(t.buffers.some(e=>e.holes.geometry.length>1))return!0;return!1}compact(e){if(!this.canCompact)return!1;let t=!1;for(const o of this.dataByBaseInstance.values())for(const n of o.dataByOrigin.values()){const r=new Array;for(let t=0;t<n.buffers.length&&!e.done;){const o=n.buffers[t];o.holes.geometry.length<=1?++t:(o.instances.forEach(({geometry:e})=>r.push(e)),this._vaoWriter?.deleteBuffer(o),s(n.buffers,o,void 0,{last:t}),e.madeProgress())}if(r.length>0){const{baseInstanceData:e}=o;n.buffers.forEach(t=>this._applyAdds(e,t,r));const s=null!=e;for(;r.length>0;)n.buffers.push(this._applyAndRebuild(e,new m(s,this._vaoWriter.targetBuffers),r,null));t=!0}}return t}updateHighlights(e){this.highlightOrderMap=e;for(const t of this.dataByBaseInstance.values())for(const s of t.dataByOrigin.values())for(const t of s.buffers)t.updateHighlights(e)}_applyUpdates(e,t){const o=this._vaoWriter;if(null==o)return void e.clearUpdates();let n;const r=this._useMetalWorkaround?(e,t)=>{n??=new Map;let s=n.get(t);s||(s=[],n.set(t,s)),s.push(e)}:(e,t)=>o.updateInstance(e,t);for(const i of e.updates){if(t.done)return;const{renderGeometry:o,updateType:n}=i;s(e.pending.updates,i),t.madeProgress();const c=this.dataByBaseInstance.get(o.geometry.baseGeometry?.id??a),l=c?.dataByOrigin.get(o.localOrigin.id)?.findBuffer(o.id);if(null==l)return;const f=l.instances.get(o.id);6&n&&r(f,l),25&n&&(l.drawCommandsDirty=!0)}n&&o.updateInstancesMetal(n)}_computeDeltas(e,t){const s=new Map;for(const o of e){const e=o.localOrigin;if(null==e)continue;const t=o.geometry.baseGeometry,r=n(s,t??null,b);let a=r.get(e,null);null==a&&(a=new B(e.vec3,t),r.set(e,null,a)),a.changes.push(o)}for(const o of t){const e=o.localOrigin;if(null==e)continue;const t=o.geometry.baseGeometry,r=this.dataByBaseInstance.get(t?.id??a),i=r?.dataByOrigin.get(e.id)?.findBuffer(o.id);if(null==i)continue;const c=n(s,t??null,b);let l=c.get(e,i);null==l&&(l=new B(e.vec3,t),c.set(e,i,l)),l.changes.push(o)}return s}_applyAddsAndRemoves(e){const{_vaoWriter:t,dataByBaseInstance:o}=this;if(null==t)return void e.clearAddsAndRemoves();const r=this._computeDeltas(e.adds,e.removes);for(const[i,c]of r){const e=n(o,i?.id??a,()=>new h(t.createBaseInstanceData(i)));for(const[o,r]of c.outerMap()){const a=r.get(null),i=a?.changes??[];c.delete(o,null);const f=n(e.dataByOrigin,o.id,()=>new g(o.vec3));for(const[n,u]of r){if(c.delete(o,n),null==n&&l(!1,"No VAO for removed geometries"),n.instances.size===u.changes.length){t.deleteBuffer(n),s(f.buffers,n),0===f.buffers.length&&0===i.length&&e.dataByOrigin.delete(o.id);continue}switch(t.evaluateBufferAllocation(n.numElements.geometry,i,u.changes,n)){case 0:u.changes.forEach(({id:e})=>n.deleteInstance(e)),n.instances.forEach(({geometry:e})=>i.push(e)),t.deleteBuffer(n),s(f.buffers,n);break;case 1:this._applyAndRebuild(e.baseInstanceData,n,i,u);break;case 2:this._applyRemoves(n,u)}}if(i.length>0){const{baseInstanceData:s}=e,o=null!=s;for(const e of f.buffers)this._applyAdds(s,e,i);const{targetBuffers:n}=t;for(;i.length>0;)f.buffers.push(this._applyAndRebuild(s,new m(o,n),i,null))}}0===e.dataByOrigin.size&&(e.dispose(),o.delete(e.id))}e.clearAddsAndRemoves()}_updateDrawCommands(){this._hasOccludees=!1;for(const e of this.dataByBaseInstance.values())for(const t of e.dataByOrigin.values())for(const e of t.buffers)e.updateIfDrawCommandsDirty(this.highlightOrderMap),this._hasOccludees||=e.hasOccludees}_applyAndRebuild(e,t,s,o){if(o)for(const l of o.changes)t.deleteInstance(l.id);const n=this._vaoWriter,{targetBuffers:r}=n,a={},i={};for(const l of r)a[l]=n.maxElements(l),i[l]=t.numElements[l];for(;s.length>0;){const e=s.pop(),o={};for(const t of r)o[t]=n.elementCount(e.geometry,t);if(r.some(e=>i[e]+o[e]>a[e]&&i[e]>0)){s.push(e);break}for(const t of r)i[t]+=o[t];const c=new d(e,{geometry:f.acquire(0,0),texture:f.acquire(0,0)},this.highlightOrderMap);t.addInstance(e.id,c)}t.resetInstanceSummary(),n.reallocateBuffer(e,t,i);const c=n.rebuildInstances(i,t.writeableInstances.values(),t);t.updateInstances(),t.clearHoles();for(const l of r)t.holes[l].push(f.acquire(c[l],t.getEndElement(l)));return t.updateDrawCommands(this.highlightOrderMap),t}_applyRemoves(e,t){const{_vaoWriter:s}=this;if(0===t.changes.length||null==s)return;const{targetBuffers:o}=s,n={},r={};for(const a of o)n[a]=[],r[a]=f.acquire(1/0,-1/0);for(const a of t.changes){const t=a.id,s=e.instances.get(t);if(s){if(this._useMetalWorkaround)for(const e of o){const t=s.targetRanges[e],o=r[e];o.from=Math.min(o.from,t.from),o.to=Math.max(o.to,t.to)}for(const e of o){const t=s.targetRanges[e],o=n[e],r=o.at(-1);r?.to===t.from?r.to=t.to:r?.from===t.to?r.from=t.from:o.push(f.acquire(t.from,t.to))}e.deleteInstance(t)}}for(const a of o)u(n[a]);this._useMetalWorkaround?s.clearHolesMetal(e.instances.values(),r,e):s.clearHoles(n,e);for(const a of o)f.release(r[a]);for(const a of o){const t=e.holes[a];for(const e of n[a])t.push(e)}e.drawCommandsDirty=!0}_applyAdds(e,t,s){if(0===s.length||null==this._vaoWriter)return;if(!p(t))return void this._applyAndRebuild(e,t,s,null);const n=this._vaoWriter,{targetBuffers:r}=n,a={};for(const o of r){const e=t.numElements[o],r=s.reduce((e,{geometry:t})=>e+n.elementCount(t,o),0);a[o]=Math.min(e+r,n.maxElements(o))}if(n.canGrow(t,a))return void this._applyAndRebuild(e,t,s,null);t.mergeHoles();const i={},c={};for(const o of r)i[o]=[],c[o]=f.acquire(1/0,-1/0);for(const{geometry:o}of s){const e={},s={};for(const a of r)e[a]=n.elementCount(o,a),s[a]=_(t.holes[a],e[a]);if(r.every(e=>null!=s[e]))for(const t of r){const o=s[t];if(i[t].push(o),this._useMetalWorkaround){const s=c[t];s.from=Math.min(s.from,o),s.to=Math.max(s.to,o+e[t])}}else for(const t of r)i[t].push(null)}const l=this._addInstances(s,t,i);if(this._useMetalWorkaround){if(r.some(e=>!Number.isFinite(c[e].from)||!Number.isFinite(c[e].to)))return;for(const e of l);n.writeInstanceRangeMetal(c,t.instances.values(),t)}else n.writeRandomInstances(a,l,t);o(s,(e,t)=>r.some(e=>null==i[e][t]))}*_addInstances(e,t,s){const o=e.length,n=this._vaoWriter,{targetBuffers:r}=n;for(let a=0;a<o;++a){const o=e[a];if(r.some(e=>null==s[e][a]))continue;const i={};for(const e of r){const t=s[e][a];i[e]=f.acquire(t,t+n.elementCount(o.geometry,e))}const c=new d(o,i,this.highlightOrderMap);t.addInstance(o.id,c),t.drawCommandsDirty=!0,yield c}}static prune(){y.prune()}get test(){}};e([i({constructOnly:!0})],v.prototype,"dataByBaseInstance",void 0),e([i({constructOnly:!0})],v.prototype,"material",void 0),e([i()],v.prototype,"highlightOrderMap",void 0),v=e([c("esri.views.3d.webgl-engine.materials.renderers.MergedBuffer")],v);class B{constructor(e,t){this.origin=e,this.baseInstance=t,this.changes=new Array}}function _(e,t){if(0===t)return 0;const o=e.find(e=>e.numElements>=t);if(null==o)return null;const n=o.from;return o.from+=t,o.numElements<=0&&(s(e,o),f.release(o)),n}function b(){return new r}export{v as MergedBuffer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{property as
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{property as r,subclass as t}from"../../../../../core/accessorSupport/decorators.js";import{SyncRenderPlugin as s}from"../../effects/RenderPlugin.js";import{MergedBuffer as i}from"./MergedBuffer.js";import{VaoRenderer as a}from"./VaoRenderer.js";let n=class extends s{constructor(e){super(e),this._dataByBaseInstance=new Map,this._buffer=null,this._renderer=null,this.drapedPriority=0}initialize(){this._buffer=new i({material:this.material,dataByBaseInstance:this._dataByBaseInstance,highlightOrderMap:this.highlightOrderMap}),this._renderer=new a({material:this.material,dataByBaseInstance:this._dataByBaseInstance})}destroy(){this._buffer.destroy(),this._renderer.destroy()}hasHighlight(e){return this._renderer.hasHighlight(e)}initializeRenderContext(e){this._buffer.initializeRenderContext(e),this._renderer.initializeRenderContext(e)}uninitializeRenderContext(){this._buffer.uninitializeRenderContext(),this._renderer.uninitializeRenderContext()}get produces(){return this._renderer.produces}get hasOccludees(){return this._buffer.hasOccludees}get hasOnlyOccluders(){return!!(-2&this.renderOccludedFlags)}get hasEmitters(){return this.material.hasEmissions}get isDecoration(){return this.material.parameters.isDecoration}get renderOccludedFlags(){return this.material.renderOccludedFlags}get testsTransparentRenderOrder(){return"test"===process.env.NODE_ENV?this.material.testsTransparentRenderOrder:0}get numGeometries(){let e=0;for(const r of this._dataByBaseInstance.values())for(const t of r.dataByOrigin.values())e+=t.buffers.reduce((e,r)=>e+r.instances.size,0);return e}get usedMemory(){let e=0;for(const r of this._dataByBaseInstance.values())for(const t of r.dataByOrigin.values())e+=t.buffers.reduce((e,r)=>e+r.vao.usedMemory,0);return e}forEachGeometry(e){for(const r of this._dataByBaseInstance.values())for(const t of r.dataByOrigin.values())for(const r of t.buffers)for(const{geometry:t}of r.instances.values())e(t)}modify(e,r){this._buffer.modify(e,r),this._renderer.updateHighlights()}get canCompact(){return this._buffer.canCompact}compact(e){return this._buffer.compact(e)}updateHighlights(e){this.highlightOrderMap=e,this._buffer.updateHighlights(e),this._renderer.updateHighlights()}updateAnimation(e){return this.material.update(e)}acquireTechniques(e){return this._renderer.acquireTechniques(e)}render(e,r){return this._renderer.render(e,r)}static prune(){i.prune()}get test(){}};e([r({constructOnly:!0})],n.prototype,"material",void 0),e([r()],n.prototype,"highlightOrderMap",void 0),n=e([t("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],n);export{n as MergedRenderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import s from"../../../../../core/PooledArray.js";import{assert as e}from"../../lib/Util.js";import{bufferRangePool as n,mergeAdjacentRanges as a}from"./BufferRange.js";import{DrawCommand as i}from"./DrawCommand.js";import{InstancedCommandVAO as o}from"./InstancedCommandVAO.js";import{InstancedCommandVAOs as r}from"./InstancedCommandVAOs.js";import{defaultHighlightName as h}from"../../../../support/HighlightDefaults.js";class m{constructor(t,s){this.isInstanced=t,this.targetBuffers=s,this.vao=null,this.textureBuffer=null,this.vaoEndElement=0,this.textureEndElement=0,this._instances=new Map,this.hasHiddenInstances=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.highlightNames=new Set,this.drawCommandsDefault=c(),this.drawCommandsHighlights=new Map,this.drawCommandsOccludees=c(),this.drawCommandsShadowHighlightRest=c(),this._instancedCommandVAOs=null;const e={},n={};for(const a of s)e[a]=0,n[a]=[];this._numElements=e,this._holes=n}
|
|
2
|
+
import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import s from"../../../../../core/PooledArray.js";import{assert as e}from"../../lib/Util.js";import{bufferRangePool as n,mergeAdjacentRanges as a}from"./BufferRange.js";import{DrawCommand as i}from"./DrawCommand.js";import{InstancedCommandVAO as o}from"./InstancedCommandVAO.js";import{InstancedCommandVAOs as r}from"./InstancedCommandVAOs.js";import{defaultHighlightName as h}from"../../../../support/HighlightDefaults.js";class m{constructor(t,s){this.isInstanced=t,this.targetBuffers=s,this.vao=null,this.textureBuffer=null,this.vaoEndElement=0,this.textureEndElement=0,this._instances=new Map,this.hasHiddenInstances=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.highlightNames=new Set,this.drawCommandsDefault=c(),this.drawCommandsHighlights=new Map,this.drawCommandsOccludees=c(),this.drawCommandsShadowHighlightRest=c(),this._instancedCommandVAOs=null;const e={},n={};for(const a of s)e[a]=0,n[a]=[];this._numElements=e,this._holes=n}getTargetBuffer(t){return"geometry"===t?this.vao?.buffer("geometry"):this.textureBuffer}get numElements(){return this._numElements}get instances(){return this._instances}get writeableInstances(){return this._instances}clearHoles(){for(const t of this.targetBuffers){const s=this._holes[t];for(const t of s)n.release(t);s.length=0}}getEndElement(t){return"geometry"===t?this.vaoEndElement:this.textureEndElement}get holes(){return this._holes}get hasHighlights(){return this.highlightNames.size>0}get instancedCommandVAOs(){return this._instancedCommandVAOs}resetInstanceSummary(){this.hasHiddenInstances=!1,this.hasOccludees=!1,this.highlightNames.clear()}updateIfDrawCommandsDirty(t){if(this.drawCommandsDirty){this.resetInstanceSummary();for(const t of this.instances.values())this.updateDrawState(t);this.updateDrawCommands(t)}}addInstance(t,s){e(!this._instances.has(t)),this._instances.set(t,s);for(const e of this.targetBuffers)this._numElements[e]+=s.targetRanges[e].numElements}deleteInstance(t){const s=this._instances.get(t);if(s){for(const t of this.targetBuffers){const e=s.targetRanges[t];this._numElements[t]-=e.numElements,n.release(e)}this._instances.delete(t)}}updateInstances(){const{targetBuffers:t}=this,s={};for(const e of t)s[e]=0;for(const e of this._instances.values()){for(const n of t)s[n]+=e.targetRanges[n].numElements;this.updateDrawState(e)}this._numElements=s}updateDrawState(t){if(t.isVisible){const{highlightName:s}=t;s&&this.highlightNames.add(s),t.hasOccludees&&(this.hasOccludees=!0)}else this.hasHiddenInstances=!0}updateDrawCommands(t){this._updateDrawCommands(t),this._updateInstancedCommandVAOs()}_updateDrawCommands(t){if(this.drawCommandsDefault.clear(),this.drawCommandsOccludees.clear(),this.drawCommandsDirty=!1,0===this._instances.size)return;const{sortedInstances:s}=this;if(this._updateHighlightDrawCommands(t,s),!this.needsMultipleCommands){const t=this.drawCommandsDefault.pushNew(),s=this.holes.geometry.at(0);return this.vao&&1===this.holes.geometry.length&&s.to===this.vaoEndElement?(t.first=0,void(t.count=s.from)):(t.first=1/0,t.count=0,this._instances.forEach(s=>{t.first=Math.min(t.first,s.targetRanges.geometry.from),t.count=Math.max(t.count,s.targetRanges.geometry.to)}),void(t.count-=t.first))}for(const e of s)e.isVisible&&l(e.hasOccludees?this.drawCommandsOccludees:this.drawCommandsDefault,e)}get sortedInstances(){return Array.from(this._instances.values()).sort(({targetRanges:{geometry:t}},{targetRanges:{geometry:s}})=>t.from===s.from?t.to-s.to:t.from-s.from)}updateHighlights(t){this.highlightNames.clear();const s=this.sortedInstances;for(const e of s)e.updateHighlightOptions(t),e.isVisible&&e.highlightName&&this.highlightNames.add(e.highlightName);this._updateHighlightDrawCommands(t,s),this._updateInstancedCommandVAOs()}mergeHoles(){const t=this._holes;for(const s of this.targetBuffers)a(t[s])}_updateHighlightDrawCommands(s,e){const{drawCommandsHighlights:n,drawCommandsShadowHighlightRest:a}=this;n.clear(),a.clear();for(const i of e){if(i.updateHighlightOptions(s),!i.isVisible)continue;const{highlightName:e}=i;if(e){this.highlightNames.add(e);l(t(n,e,c),i)}e&&e===h||l(a,i)}}_updateInstancedCommandVAOs(){const t=this.vao;if(!this.isInstanced||null==t)return;this._instancedCommandVAOs??=new r;const s=this._instancedCommandVAOs,e=s.commandVAOs.copy();s.clear();const n=s.commandVAOs,a=(s,a)=>{for(const i of s){const{first:s,count:r}=i,h=n.get(s,r)??e.pop(s,r)??new o(t.shallowCloneWithBaseInstances(new Map([["geometry",i.first]])),i.count);n.set(s,r,h),a.push(h)}};a(this.drawCommandsDefault,s.drawCommandsDefault);for(const[i,o]of this.drawCommandsHighlights){const t=new Array;a(o,t),s.drawCommandsHighlights.set(i,t)}a(this.drawCommandsOccludees,s.drawCommandsOccludees),a(this.drawCommandsShadowHighlightRest,s.drawCommandsShadowHighlightRest);for(const i of e.values())i.dispose();e.clear()}get needsMultipleCommands(){return this.hasOccludees||this.hasHighlights||this.hasHiddenInstances}}function d(t){return null!=t.vao}function c(){return new s({allocator:t=>t||new i,deallocator:t=>t})}function l(t,{targetRanges:{geometry:s}}){const e=t.back();if(null==e){const e=t.pushNew();return e.first=s.from,void(e.count=s.numElements)}if(u(e,s)){const t=s.from-e.first+s.numElements;e.count=t}else{const e=t.pushNew();e.first=s.from,e.count=s.numElements}}function u(t,s){return t.first+t.count>=s.from}export{m as PerBufferData,d as hasVao};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
class s{constructor(s){this.origin=s,this.buffers=new Array}dispose(){
|
|
2
|
+
class s{constructor(s){this.origin=s,this.buffers=new Array}dispose(){this.buffers.length=0}findBuffer(s){return this.buffers.find(r=>r.instances.has(s))}}export{s as PerOriginData};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{TextureBuffer as e}from"../../lib/TextureBackedBuffer/TextureBuffer.js";import{BufferCache as r}from"./BufferCache.js";class f{constructor(f,t){this._cache=new r(f.newCache,r=>new e(f,t,r),"TextureBufferCache")}dispose(){this._cache.dispose()}newTextureBuffer(e){return this._cache.newBuffer(e)}deleteTextureBuffer(e){return this._cache.deleteBuffer(e)}}export{f as TextureBufferCache};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{nextHighestPowerOfTwo as t}from"../../../../../core/mathUtils.js";import{
|
|
2
|
+
import{nextHighestPowerOfTwo as t}from"../../../../../core/mathUtils.js";import{copy as e,invert as r,transpose as o}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as a}from"../../../support/buffer/glUtil.js";import{VertexArrayObject as n}from"../../lib/VertexArrayObject.js";import{getMaxItemCount as f,getMaxByteSize as u}from"../../lib/TextureBackedBuffer/TextureBackedBufferUtils.js";import{bufferRangePool as i}from"./BufferRange.js";import{DrawCommand as c}from"./DrawCommand.js";import{BaseInstanceData as l}from"./PerBaseInstanceData.js";import{VertexBuffer as m}from"../../../../webgl/VertexBuffer.js";class g{constructor(t,e){this._rctx=e,this._vaoCacheValue=null,this._instanceVboCacheValue=null,this._textureBufferCacheValue=null;const r=t.createBufferWriter();this._bufferWriter=r;const o=["geometry"],s="textureBufferLayout"in r&&null!=r.textureBufferLayout;this.useTextureBuffer=s,s&&o.push("texture"),this.targetBuffers=o}get _vaoCache(){return this._vaoCacheValue??=this._rctx.getVaoCache(a(this._bufferWriter.layout)),this._vaoCacheValue}get _instanceVboCache(){return this._instanceVboCacheValue??=this._rctx.getVboCache(a(this._bufferWriter.layout,1)),this._instanceVboCacheValue}get _textureBufferCache(){return this.useTextureBuffer?(this._textureBufferCacheValue??=this._rctx.getTextureBufferCache(this._bufferWriter.textureBufferLayout),this._textureBufferCacheValue):null}maxElements(t){if("texture"===t){const t=this._targetLayout("texture");return null==t?0:f(this._rctx,t)}return Math.floor(b/this._targetStrideBytes(t))}_targetStrideBytes(t){return this._targetLayout(t)?.stride??0}_targetLayout(t){return"geometry"===t?this._bufferWriter.layout:"baseInstance"===t?this._bufferWriter.baseInstanceLayout:this._bufferWriter.textureBufferLayout}evaluateBufferAllocation(t,e,r,o){const s=this._targetStrideBytes("geometry"),a=e.reduce((t,{geometry:e})=>t+this.vertexElementCount(e),0),n=r.reduce((t,{geometry:e})=>t+this.vertexElementCount(e),0),f=Math.min((t+a-n)*s,b),u=o.vao?.buffer("geometry"),i=u?.sizeBytes??0;return f>_&&f<i/2?0:f>i?1:2}deleteBuffer(t){t.isInstanced?(t.instancedCommandVAOs?.dispose(),this._instanceVboCache.deleteVbo(t.vao?.mutableBuffer("geometry")),t.vao?.disposeVAOOnly()):this._vaoCache.deleteVao(t.vao),this._textureBufferCache?.deleteTextureBuffer(t.textureBuffer),t.vao=null,t.textureBuffer=null,t.vaoEndElement=0,t.textureEndElement=0}createBaseInstanceData(t){const{_bufferWriter:e}=this;if(null==t||null==e.baseInstanceLayout||null==e.writeBaseInstance||null==e.elementCountBaseInstance)return null;const r=this._targetLayout("baseInstance"),o=e.elementCountBaseInstance(t.attributes),s=o*r.stride,n=new m(this._rctx,a(r));n.setSize(Math.ceil(s));const f=d(s),u=r.createView(f.buffer);e.writeBaseInstance(t.attributes,u),n.setSubData(f,0,0,s);const i=new c;return i.first=0,i.count=o,new l(t,n,i)}reallocateBuffer(t,e,r){if(this.deleteBuffer(e),null!=t){const o=t.baseInstanceBuffer,s=r.geometry*this._targetStrideBytes("geometry"),a=this._instanceVboCache.newVbo(C(s));e.vao=new n(this._rctx,new Map([["baseInstance",o],["geometry",a]]))}else{const t=r.geometry*this._targetStrideBytes("geometry");e.vao=this._vaoCache.newVao(C(t))}const o=this._targetLayout("texture"),s=this._textureBufferCache;if(null!=o&&null!=s){const t=C(r.texture*o.stride),a=Math.ceil(t/o.stride);e.textureBuffer=s.newTextureBuffer(a)}e.vaoEndElement=Math.floor((e.vao?.getByteLength("geometry")??0)/this._targetStrideBytes("geometry")),e.textureEndElement=e.textureBuffer?.itemCount??0}elementCount(t,e){const{attributes:r}=t;return"geometry"===e?this._bufferWriter.elementCount(r):"baseInstance"===e?this._bufferWriter.elementCountBaseInstance?.(r)??0:this._bufferWriter.elementCountTextureBuffer?.(r)??0}vertexElementCount(t){return this._bufferWriter.elementCount(t.attributes)}textureElementCount(t){return this._bufferWriter.elementCountTextureBuffer?.(t.attributes)??0}canGrow(t,e){const r=this.targetBuffers.map(r=>this._evaluateTargetBufferGrowth(r,t,e));return r.every(({canGrow:t})=>t)&&r.some(({needsToGrow:t})=>t)}_evaluateTargetBufferGrowth(t,e,r){const o=this._targetLayout(t),s=e.getTargetBuffer(t);if(null==o||null==s)return{needsToGrow:null!=o,canGrow:!0};return{needsToGrow:r[t]*o.stride>s.sizeBytes,canGrow:"geometry"===t?s.sizeBytes<C(b-_):s.sizeBytes<u(this._rctx,o)}}clearHoles(t,e){for(const r of this.targetBuffers){const o=this._targetStrideBytes(r),s=t[r],a=s.reduce((t,e)=>Math.max(t,e.numElements),0)*o,n=d(a);n.fill(0,0,a);for(const t of s)this._setTargetSubData(r,e,o,t,n)}}clearHolesMetal(t,e,r){const{targetBuffers:o}=this,s={};let a=0;for(const u of o){const t=e[u].numElements*this._targetStrideBytes(u);s[u]=a,a+=w(t)}const n=d(a);n.fill(0,0,a);const f={};for(const u of o)f[u]=this._targetLayout(u)?.createView(n.buffer,s[u]);for(const u of t){const t=u.targetRanges.geometry;if(!(t.from>=e.geometry.from&&t.to<=e.geometry.to))continue;const r={};for(const s of o)r[s]=u.targetRanges[s].from-e[s].from;this._writeGeometry(u.geometry,f,r,u.targetRanges)}for(const u of o)this._setTargetSubData(u,r,this._targetStrideBytes(u),e[u],n,s[u])}writeRandomInstances(t,e,r){const{targetBuffers:o}=this,s={},a={},n={},f={};let u=0;for(const m of o)s[m]=t[m]*this._targetStrideBytes(m),a[m]=u,n[m]=0,f[m]=i.acquire(0,0),u+=w(s[m]);const c=d(u),l={};for(const i of o)l[i]=this._targetLayout(i)?.createView(c.buffer,a[i]);for(const i of e){for(const t of o){const e=i.targetRanges[t],o=f[t];o.to===e.from||(o.numElements>0&&this._setTargetSubData(t,r,this._targetStrideBytes(t),f[t],c,a[t]),o.from=e.from,n[t]=0)}this._writeGeometry(i.geometry,l,n,i.targetRanges);for(const t of o){const e=i.targetRanges[t];n[t]+=e.numElements,f[t].to=e.to}}for(const m of o){const t=f[m];t.numElements>0&&this._setTargetSubData(m,r,this._targetStrideBytes(m),t,c,a[m]),i.release(f[m])}}writeInstanceRangeMetal(t,e,r){const{targetBuffers:o}=this,s={},a={};let n=0;for(const i of o)s[i]=t[i].numElements*this._targetStrideBytes(i),a[i]=n,n+=w(s[i]);const f=d(n),u={};for(const i of o)u[i]=this._targetLayout(i)?.createView(f.buffer,a[i]);f.fill(0,0,n);for(const i of e){const e=i.targetRanges.geometry;if(!(e.from>=t.geometry.from&&e.to<=t.geometry.to))continue;const r={},s={};for(const a of o){const e=i.targetRanges[a];r[a]=e.from-t[a].from,s[a]=e}this._writeGeometry(i.geometry,u,r,s)}for(const i of o)t[i].numElements>0&&this._setTargetSubData(i,r,this._targetStrideBytes(i),t[i],f,a[i])}rebuildInstances(t,e,r){const{targetBuffers:o}=this,s={},a={},n={};let f=0;for(const i of o)s[i]=t[i]*this._targetStrideBytes(i),a[i]=f,f+=w(s[i]),n[i]=0;const u=d(f),c={};for(const i of o)c[i]=this._targetLayout(i)?.createView(u.buffer,a[i]);for(const i of e){const t={},e={};for(const r of o){t[r]=n[r],n[r]+=this.elementCount(i.geometry.geometry,r);const o=i.targetRanges[r];o.from=t[r],o.to=n[r],e[r]=o}this._writeGeometry(i.geometry,c,t,e)}for(const l of o){const t=i.acquire(0,n[l]);this._setTargetSubData(l,r,this._targetStrideBytes(l),t,u,a[l]),i.release(t)}return n}updateInstance(t,e){const{targetBuffers:r}=this,o={},s={};let a=0;for(const i of r){const e=this._targetStrideBytes(i);o[i]=this.elementCount(t.geometry.geometry,i)*e,s[i]=a,a+=w(o[i])}const n=d(a),f={},u={};for(const i of r)u[i]=0,f[i]=this._targetLayout(i)?.createView(n.buffer,s[i]);this._writeGeometry(t.geometry,f,u,t.targetRanges);for(const i of r)this._setTargetSubData(i,e,this._targetStrideBytes(i),t.targetRanges[i],n,s[i])}updateInstancesMetal(t){const{targetBuffers:e}=this;for(const[r,o]of t){const t={};for(const r of e)t[r]=i.acquire(1/0,-1/0);for(const r of o)for(const o of e){const e=t[o],s=r.targetRanges[o];e.from=Math.min(e.from,s.from),e.to=Math.max(e.to,s.to)}this.writeInstanceRangeMetal(t,r.instances.values(),r);for(const r of e)i.release(t[r])}}_writeGeometry(t,s,a,n){const{_bufferWriter:f}=this;null!=f&&(e(h,t.transformation),h[12]-=t.localOrigin.vec3[0],h[13]-=t.localOrigin.vec3[1],h[14]-=t.localOrigin.vec3[2],r(y,h),o(y,y),f.write(h,y,t.geometry.attributes,t.geometry.olidColor,s.geometry,a.geometry,n.texture),null!=s.texture&&f.writeTextureBuffer&&f.writeTextureBuffer(h,y,t.geometry.attributes,s.texture,a.texture))}_setTargetSubData(t,e,r,o,s,a=0){if("geometry"===t){const n=e.getTargetBuffer(t);n?.setSubData(s,o.from*r,a,o.numElements*r)}else if("texture"===t){const r=e.getTargetBuffer(t);r?.setSubData(s.buffer,o.from,a,o.numElements)}}static prune(){x=new Uint8Array(_)}}const h=s(),y=s(),_=262144,B=1024,b=16777216;let x=new Uint8Array(_);function d(t){return x.byteLength<t&&(x=new Uint8Array(t)),x}function w(t){return 4*Math.ceil(t/4)}function C(e){return e<=B?B:e<_?t(e):Math.max(Math.min(Math.ceil(1.5*e/_)*_,b),e)}export{g as VaoWriter};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{BufferCache as e}from"./BufferCache.js";import{VertexBuffer as t}from"../../../../webgl/VertexBuffer.js";class s{constructor(s,r){this._rctx=s,this._layout=r,this._cache=new e(s.newCache,e=>{const s=new t(this._rctx,this._layout);return s.setSize(e),s},"VBOCache")}dispose(){this._cache.dispose()}newVbo(e){return this._cache.newBuffer(e)}deleteVbo(e){this._cache.deleteBuffer(e)}}export{s as VboCache};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.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/hud/HUDVisibility.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/output/ReadDepth.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/ScreenSizePerspective.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float4BindUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DBindUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"
|
|
2
|
+
import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.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/hud/HUDVisibility.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/output/ReadDepth.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/ScreenSizePerspective.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float4BindUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DBindUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"./alphaCutoff.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build,c as calculateAnchorPosition}from"../../../../chunks/HUDMaterial.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"
|
|
2
|
+
import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"./alphaCutoff.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/MeasurementArrow.glsl.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{isColor as o}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as r}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as l}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{ColorConversion as i}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{If as a,glsl as s}from"../core/shaderModules/glsl.js";import{alphaCutoff as t}from"
|
|
3
|
-
void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${a(
|
|
4
|
-
${a(
|
|
5
|
-
${a(d
|
|
2
|
+
import{isColor as o}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as r}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as l}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{ColorConversion as i}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{If as a,glsl as s}from"../core/shaderModules/glsl.js";import{alphaCutoff as t}from"./alphaCutoff.glsl.js";function e(e,n){e.include(l,n),e.include(r,n),e.fragment.include(i);const{output:f,oitPass:u,hasEmission:m,discardInvisibleFragments:d,oitPremultipliedAlpha:p,snowCover:g}=n,C=9===f,c=o(f)&&1===u,h=o(f)&&2===u,v=o(f)&&1!==u;let b=0;(v||c)&&e.outputs.add("fragColor","vec4",b++),m&&e.outputs.add("fragEmission","vec4",b++),c&&e.outputs.add("fragAlpha","float",b++),e.fragment.include(t),e.fragment.code.add(s`
|
|
3
|
+
void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${a(g,", float snow")}) {
|
|
4
|
+
${a(C,"finalColor.a = 1.0;")}
|
|
5
|
+
${a(d,"if (finalColor.a < alphaCutoff) { discard; }")}
|
|
6
6
|
|
|
7
|
-
${a(
|
|
7
|
+
${a(c,`${a(p,"fragColor = finalColor;","fragColor = premultiplyAlpha(finalColor);")}\n fragAlpha = finalColor.a;`)}
|
|
8
8
|
${a(h&&p&&d,"finalColor.rgb /= finalColor.a;")}
|
|
9
9
|
${a(v,"fragColor = finalColor;")}
|
|
10
|
-
${a(m,`fragEmission = ${a(
|
|
10
|
+
${a(m,`fragEmission = ${a(g,"mix(finalColor.a * getEmissions(emissiveSymbolColor), vec4(0.0), snow);","finalColor.a * getEmissions(emissiveSymbolColor);")}`)}
|
|
11
11
|
calculateOcclusionAndOutputHighlight();
|
|
12
|
-
${a(
|
|
12
|
+
${a(C,"outputObjectAndLayerIdColor();")}
|
|
13
13
|
}
|
|
14
14
|
`)}export{e as outputColorHighlightOLID};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstanceColor.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/MaskedColor.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.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/MainLighting.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/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../core/shaderLibrary/util/MixExternalColor.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../effects/weather/SnowCover.glsl.js";import"../materials/internal/MaterialUtil.js";import"./
|
|
2
|
+
import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstanceColor.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/MaskedColor.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.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/MainLighting.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/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../core/shaderLibrary/util/MixExternalColor.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../effects/weather/SnowCover.glsl.js";import"../materials/internal/MaterialUtil.js";import"./alphaCutoff.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/RealisticTree.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import"../core/shaderLibrary/shading/LineStipple.glsl.js";import"../core/shaderLibrary/shading/MarkerSizing.glsl.js";import"../core/shaderLibrary/shading/PiUtils.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/NoPerspective.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float4BindUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatBindUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"./
|
|
2
|
+
import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import"../core/shaderLibrary/shading/LineStipple.glsl.js";import"../core/shaderLibrary/shading/MarkerSizing.glsl.js";import"../core/shaderLibrary/shading/PiUtils.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/NoPerspective.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float4BindUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatBindUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"./alphaCutoff.glsl.js";import"./AnimatedLine.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build,r as ribbonlineNumRoundJoinSubdivisions}from"../../../../chunks/RibbonLine.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../core/libs/gl-matrix-2/math/vec3.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexTangent.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/output/OutputHighlightOverlay.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/terrain/Overlay.glsl.js";import"../core/shaderLibrary/terrain/TerrainTexture.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4DrawUniform.js";import"../core/shaderModules/Texture2DBindUniform.js";import"./
|
|
2
|
+
import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../core/libs/gl-matrix-2/math/vec3.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexTangent.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/output/OutputHighlightOverlay.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/terrain/Overlay.glsl.js";import"../core/shaderLibrary/terrain/TerrainTexture.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4DrawUniform.js";import"../core/shaderModules/Texture2DBindUniform.js";import"./alphaCutoff.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{T as TerrainPassParameters,b as build}from"../../../../chunks/Terrain.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{toConst as e}from"../../core/compilerUtils.js";import t from"../../core/Logger.js";import{disposeMaybe as r}from"../../core/maybe.js";import{baseTypedArrayMemory as s}from"../../core/memoryEstimations.js";import{ResourceType as i}from"./enums.js";import{bindVertexBufferLayout as n}from"./Util.js";import{fromBuffers as o}from"./VertexAttributeLocations.js";const f=()=>t.getLogger("esri.views.webgl.VertexArrayObject");let
|
|
2
|
+
import{toConst as e}from"../../core/compilerUtils.js";import t from"../../core/Logger.js";import{disposeMaybe as r}from"../../core/maybe.js";import{baseTypedArrayMemory as s}from"../../core/memoryEstimations.js";import{ResourceType as i}from"./enums.js";import{bindVertexBufferLayout as n}from"./Util.js";import{fromBuffers as o}from"./VertexAttributeLocations.js";const f=()=>t.getLogger("esri.views.webgl.VertexArrayObject");let u=class t{constructor(t,r,s,i,n){this._context=t,this._indexBuffer=s,this._buffers=r instanceof Map?r:new Map([["geometry",r]]),this._baseInstances=null==i?new Map:"number"==typeof i?new Map([["geometry",i]]):i,this.locations=n??e(o(this._buffers))}get glName(){return this._glName}get context(){return this._context}get buffers(){return e(this._buffers)}buffer(e="geometry"){return this.buffers.get(e)}mutableBuffer(e="geometry"){return this._buffers.get(e)}get indexBuffer(){return this._indexBuffer}getByteLength(e){return this.buffer(e)?.sizeBytes??0}vertexCount(e){const t=this.buffer(e);return t?t.sizeBytes/t.layout[0].stride:0}get usedMemory(){return Array.from(this._buffers.values()).reduce((e,t)=>e+t.usedMemory,this._indexBuffer?.usedMemory??0+(this._buffers.size+(this._indexBuffer?1:0))*s)}dispose(){this._context?(this._buffers.forEach(e=>e.dispose()),this._buffers.clear(),this._indexBuffer=r(this._indexBuffer),this.disposeVAOOnly()):(this._glName||this._buffers.size>0)&&f().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(i.VertexArrayObject,this)),this._context=null):this._glName&&f().warn("Leaked WebGL VAO")}bind(e=this.locations){const t=this._context.gl;this._glName?t.bindVertexArray(this._glName):(this._context.instanceCounter.increment(i.VertexArrayObject,this),this._glName=t.createVertexArray(),t.bindVertexArray(this._glName),this._bindLayout(e))}_bindLayout(e){const{_buffers:t,_indexBuffer:r}=this;if(t||f().error("Vertex buffer dictionary is empty!"),t.forEach((t,r)=>n(this._context,e,t,this._baseInstances.get(r)??0)),null!=r){const e=this._context.gl;this._context.gl.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r.glName)}}unbind(){this._context.gl.bindVertexArray(null)}shallowCloneWithBaseInstances(e){return new t(this._context,this._buffers,this._indexBuffer,e)}};export{u as VertexArrayObject};
|