Skip to content

Commit

Permalink
Rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Nov 9, 2023
1 parent e3e218b commit 9a0c331
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 13 deletions.
4 changes: 0 additions & 4 deletions dist/xeokit-sdk.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -80015,7 +80015,6 @@ class TrianglesDataTextureLayer {
const buffer = this._buffer;

state.gl = gl;
const start = performance.now();
textureState.texturePerObjectIdColorsAndFlags = this._dataTextureGenerator.generateTextureForColorsAndFlags(
gl,
buffer.perObjectColors,
Expand Down Expand Up @@ -80111,9 +80110,6 @@ class TrianglesDataTextureLayer {
buffer.edgeIndices32Bits, buffer.lenEdgeIndices32Bits);
}

const end = performance.now();
console.log(`Time taken: ${end - start} milliseconds`);

textureState.finalize();

// Free up memory
Expand Down
4 changes: 0 additions & 4 deletions dist/xeokit-sdk.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -80011,7 +80011,6 @@ class TrianglesDataTextureLayer {
const buffer = this._buffer;

state.gl = gl;
const start = performance.now();
textureState.texturePerObjectIdColorsAndFlags = this._dataTextureGenerator.generateTextureForColorsAndFlags(
gl,
buffer.perObjectColors,
Expand Down Expand Up @@ -80107,9 +80106,6 @@ class TrianglesDataTextureLayer {
buffer.edgeIndices32Bits, buffer.lenEdgeIndices32Bits);
}

const end = performance.now();
console.log(`Time taken: ${end - start} milliseconds`);

textureState.finalize();

// Free up memory
Expand Down
4 changes: 2 additions & 2 deletions dist/xeokit-sdk.es5.js
Original file line number Diff line number Diff line change
Expand Up @@ -18491,13 +18491,13 @@ numVertices:bucketGeometry.numTriangles});this._numPortions++;dataTextureRamStat
* Builds data textures from the appended geometries and loads them into the GPU.
*
* No more portions can then be created.
*/},{key:"finalize",value:function finalize(){var _this93=this;if(this._finalized){return;}var state=this._state;var textureState=this._dataTextureState;var gl=this.model.scene.canvas.gl;var buffer=this._buffer;state.gl=gl;var start=performance.now();textureState.texturePerObjectIdColorsAndFlags=this._dataTextureGenerator.generateTextureForColorsAndFlags(gl,buffer.perObjectColors,buffer.perObjectPickColors,buffer.perObjectVertexBases,buffer.perObjectIndexBaseOffsets,buffer.perObjectEdgeIndexBaseOffsets,buffer.perObjectSolid);textureState.texturePerObjectIdOffsets=this._dataTextureGenerator.generateTextureForObjectOffsets(gl,this._numPortions);textureState.texturePerObjectIdPositionsDecodeMatrix=this._dataTextureGenerator.generateTextureForPositionsDecodeMatrices(gl,buffer.perObjectPositionsDecodeMatrices,buffer.perObjectInstancePositioningMatrices);// const positionsCompressed = new Uint16Array(buffer.lenPositionsCompressed);
*/},{key:"finalize",value:function finalize(){var _this93=this;if(this._finalized){return;}var state=this._state;var textureState=this._dataTextureState;var gl=this.model.scene.canvas.gl;var buffer=this._buffer;state.gl=gl;textureState.texturePerObjectIdColorsAndFlags=this._dataTextureGenerator.generateTextureForColorsAndFlags(gl,buffer.perObjectColors,buffer.perObjectPickColors,buffer.perObjectVertexBases,buffer.perObjectIndexBaseOffsets,buffer.perObjectEdgeIndexBaseOffsets,buffer.perObjectSolid);textureState.texturePerObjectIdOffsets=this._dataTextureGenerator.generateTextureForObjectOffsets(gl,this._numPortions);textureState.texturePerObjectIdPositionsDecodeMatrix=this._dataTextureGenerator.generateTextureForPositionsDecodeMatrices(gl,buffer.perObjectPositionsDecodeMatrices,buffer.perObjectInstancePositioningMatrices);// const positionsCompressed = new Uint16Array(buffer.lenPositionsCompressed);
// for (let i = 0, j = 0, len = buffer.positionsCompressed.length; i < len; i++) {
// const pc = buffer.positionsCompressed[i];
// positionsCompressed.set(pc, j);
// j += pc.length;
// }
textureState.texturePerVertexIdCoordinates=this._dataTextureGenerator.generateTextureForPositions(gl,buffer.positionsCompressed,buffer.lenPositionsCompressed);textureState.texturePerPolygonIdPortionIds8Bits=this._dataTextureGenerator.generateTextureForPackedPortionIds(gl,buffer.perTriangleNumberPortionId8Bits);textureState.texturePerPolygonIdPortionIds16Bits=this._dataTextureGenerator.generateTextureForPackedPortionIds(gl,buffer.perTriangleNumberPortionId16Bits);textureState.texturePerPolygonIdPortionIds32Bits=this._dataTextureGenerator.generateTextureForPackedPortionIds(gl,buffer.perTriangleNumberPortionId32Bits);if(buffer.perEdgeNumberPortionId8Bits.length>0){textureState.texturePerEdgeIdPortionIds8Bits=this._dataTextureGenerator.generateTextureForPackedPortionIds(gl,buffer.perEdgeNumberPortionId8Bits);}if(buffer.perEdgeNumberPortionId16Bits.length>0){textureState.texturePerEdgeIdPortionIds16Bits=this._dataTextureGenerator.generateTextureForPackedPortionIds(gl,buffer.perEdgeNumberPortionId16Bits);}if(buffer.perEdgeNumberPortionId32Bits.length>0){textureState.texturePerEdgeIdPortionIds32Bits=this._dataTextureGenerator.generateTextureForPackedPortionIds(gl,buffer.perEdgeNumberPortionId32Bits);}if(buffer.lenIndices8Bits>0){textureState.texturePerPolygonIdIndices8Bits=this._dataTextureGenerator.generateTextureFor8BitIndices(gl,buffer.indices8Bits,buffer.lenIndices8Bits);}if(buffer.lenIndices16Bits>0){textureState.texturePerPolygonIdIndices16Bits=this._dataTextureGenerator.generateTextureFor16BitIndices(gl,buffer.indices16Bits,buffer.lenIndices16Bits);}if(buffer.lenIndices32Bits>0){textureState.texturePerPolygonIdIndices32Bits=this._dataTextureGenerator.generateTextureFor32BitIndices(gl,buffer.indices32Bits,buffer.lenIndices32Bits);}if(buffer.lenEdgeIndices8Bits>0){textureState.texturePerPolygonIdEdgeIndices8Bits=this._dataTextureGenerator.generateTextureFor8BitsEdgeIndices(gl,buffer.edgeIndices8Bits,buffer.lenEdgeIndices8Bits);}if(buffer.lenEdgeIndices16Bits>0){textureState.texturePerPolygonIdEdgeIndices16Bits=this._dataTextureGenerator.generateTextureFor16BitsEdgeIndices(gl,buffer.edgeIndices16Bits,buffer.lenEdgeIndices16Bits);}if(buffer.lenEdgeIndices32Bits>0){textureState.texturePerPolygonIdEdgeIndices32Bits=this._dataTextureGenerator.generateTextureFor32BitsEdgeIndices(gl,buffer.edgeIndices32Bits,buffer.lenEdgeIndices32Bits);}var end=performance.now();console.log("Time taken: ".concat(end-start," milliseconds"));textureState.finalize();// Free up memory
textureState.texturePerVertexIdCoordinates=this._dataTextureGenerator.generateTextureForPositions(gl,buffer.positionsCompressed,buffer.lenPositionsCompressed);textureState.texturePerPolygonIdPortionIds8Bits=this._dataTextureGenerator.generateTextureForPackedPortionIds(gl,buffer.perTriangleNumberPortionId8Bits);textureState.texturePerPolygonIdPortionIds16Bits=this._dataTextureGenerator.generateTextureForPackedPortionIds(gl,buffer.perTriangleNumberPortionId16Bits);textureState.texturePerPolygonIdPortionIds32Bits=this._dataTextureGenerator.generateTextureForPackedPortionIds(gl,buffer.perTriangleNumberPortionId32Bits);if(buffer.perEdgeNumberPortionId8Bits.length>0){textureState.texturePerEdgeIdPortionIds8Bits=this._dataTextureGenerator.generateTextureForPackedPortionIds(gl,buffer.perEdgeNumberPortionId8Bits);}if(buffer.perEdgeNumberPortionId16Bits.length>0){textureState.texturePerEdgeIdPortionIds16Bits=this._dataTextureGenerator.generateTextureForPackedPortionIds(gl,buffer.perEdgeNumberPortionId16Bits);}if(buffer.perEdgeNumberPortionId32Bits.length>0){textureState.texturePerEdgeIdPortionIds32Bits=this._dataTextureGenerator.generateTextureForPackedPortionIds(gl,buffer.perEdgeNumberPortionId32Bits);}if(buffer.lenIndices8Bits>0){textureState.texturePerPolygonIdIndices8Bits=this._dataTextureGenerator.generateTextureFor8BitIndices(gl,buffer.indices8Bits,buffer.lenIndices8Bits);}if(buffer.lenIndices16Bits>0){textureState.texturePerPolygonIdIndices16Bits=this._dataTextureGenerator.generateTextureFor16BitIndices(gl,buffer.indices16Bits,buffer.lenIndices16Bits);}if(buffer.lenIndices32Bits>0){textureState.texturePerPolygonIdIndices32Bits=this._dataTextureGenerator.generateTextureFor32BitIndices(gl,buffer.indices32Bits,buffer.lenIndices32Bits);}if(buffer.lenEdgeIndices8Bits>0){textureState.texturePerPolygonIdEdgeIndices8Bits=this._dataTextureGenerator.generateTextureFor8BitsEdgeIndices(gl,buffer.edgeIndices8Bits,buffer.lenEdgeIndices8Bits);}if(buffer.lenEdgeIndices16Bits>0){textureState.texturePerPolygonIdEdgeIndices16Bits=this._dataTextureGenerator.generateTextureFor16BitsEdgeIndices(gl,buffer.edgeIndices16Bits,buffer.lenEdgeIndices16Bits);}if(buffer.lenEdgeIndices32Bits>0){textureState.texturePerPolygonIdEdgeIndices32Bits=this._dataTextureGenerator.generateTextureFor32BitsEdgeIndices(gl,buffer.edgeIndices32Bits,buffer.lenEdgeIndices32Bits);}textureState.finalize();// Free up memory
this._buffer=null;this._bucketGeometries={};this._finalized=true;this._deferredSetFlagsDirty=false;//
this._onSceneRendering=this.model.scene.on("rendering",function(){if(_this93._deferredSetFlagsDirty){_this93._uploadDeferredFlags();}_this93._numUpdatesInFrame=0;});}},{key:"isEmpty",value:function isEmpty(){return this._numPortions===0;}},{key:"initFlags",value:function initFlags(portionId,flags,meshTransparent){if(flags&ENTITY_FLAGS.VISIBLE){this._numVisibleLayerPortions++;this.model.numVisibleLayerPortions++;}if(flags&ENTITY_FLAGS.HIGHLIGHTED){this._numHighlightedLayerPortions++;this.model.numHighlightedLayerPortions++;}if(flags&ENTITY_FLAGS.XRAYED){this._numXRayedLayerPortions++;this.model.numXRayedLayerPortions++;}if(flags&ENTITY_FLAGS.SELECTED){this._numSelectedLayerPortions++;this.model.numSelectedLayerPortions++;}if(flags&ENTITY_FLAGS.CLIPPABLE){this._numClippableLayerPortions++;this.model.numClippableLayerPortions++;}if(flags&ENTITY_FLAGS.EDGES){this._numEdgesLayerPortions++;this.model.numEdgesLayerPortions++;}if(flags&ENTITY_FLAGS.PICKABLE){this._numPickableLayerPortions++;this.model.numPickableLayerPortions++;}if(flags&ENTITY_FLAGS.CULLED){this._numCulledLayerPortions++;this.model.numCulledLayerPortions++;}if(meshTransparent){this._numTransparentLayerPortions++;this.model.numTransparentLayerPortions++;}var deferred=true;this._setFlags(portionId,flags,meshTransparent,deferred);this._setFlags2(portionId,flags,deferred);}},{key:"flushInitFlags",value:function flushInitFlags(){this._setDeferredFlags();this._setDeferredFlags2();}},{key:"setVisible",value:function setVisible(portionId,flags,transparent){if(!this._finalized){throw"Not finalized";}if(flags&ENTITY_FLAGS.VISIBLE){this._numVisibleLayerPortions++;this.model.numVisibleLayerPortions++;}else{this._numVisibleLayerPortions--;this.model.numVisibleLayerPortions--;}this._setFlags(portionId,flags,transparent);}},{key:"setHighlighted",value:function setHighlighted(portionId,flags,transparent){if(!this._finalized){throw"Not finalized";}if(flags&ENTITY_FLAGS.HIGHLIGHTED){this._numHighlightedLayerPortions++;this.model.numHighlightedLayerPortions++;}else{this._numHighlightedLayerPortions--;this.model.numHighlightedLayerPortions--;}this._setFlags(portionId,flags,transparent);}},{key:"setXRayed",value:function setXRayed(portionId,flags,transparent){if(!this._finalized){throw"Not finalized";}if(flags&ENTITY_FLAGS.XRAYED){this._numXRayedLayerPortions++;this.model.numXRayedLayerPortions++;}else{this._numXRayedLayerPortions--;this.model.numXRayedLayerPortions--;}this._setFlags(portionId,flags,transparent);}},{key:"setSelected",value:function setSelected(portionId,flags,transparent){if(!this._finalized){throw"Not finalized";}if(flags&ENTITY_FLAGS.SELECTED){this._numSelectedLayerPortions++;this.model.numSelectedLayerPortions++;}else{this._numSelectedLayerPortions--;this.model.numSelectedLayerPortions--;}this._setFlags(portionId,flags,transparent);}},{key:"setEdges",value:function setEdges(portionId,flags,transparent){if(!this._finalized){throw"Not finalized";}if(flags&ENTITY_FLAGS.EDGES){this._numEdgesLayerPortions++;this.model.numEdgesLayerPortions++;}else{this._numEdgesLayerPortions--;this.model.numEdgesLayerPortions--;}this._setFlags(portionId,flags,transparent);}},{key:"setClippable",value:function setClippable(portionId,flags){if(!this._finalized){throw"Not finalized";}if(flags&ENTITY_FLAGS.CLIPPABLE){this._numClippableLayerPortions++;this.model.numClippableLayerPortions++;}else{this._numClippableLayerPortions--;this.model.numClippableLayerPortions--;}this._setFlags2(portionId,flags);}/**
* This will _start_ a "set-flags transaction".
Expand Down
2 changes: 1 addition & 1 deletion dist/xeokit-sdk.min.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/xeokit-sdk.min.es.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/xeokit-sdk.min.es5.js

Large diffs are not rendered by default.

0 comments on commit 9a0c331

Please sign in to comment.