Skip to content

Commit

Permalink
Remove options
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Dec 18, 2024
1 parent 8413e8b commit f275630
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions example/src/plugins/UnloadTilesPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,7 @@ export class UnloadTilesPlugin {

constructor( options = {} ) {

const {
unloadGeometry = true,
unloadTextures = true,
unloadMaterials = true,
} = options;

this.tiles = null;
this.unloadGeometry = unloadGeometry;
this.unloadMaterials = unloadMaterials;
this.unloadTextures = unloadTextures;
this.estimatedGpuBytes = 0;

}
Expand All @@ -46,30 +37,22 @@ export class UnloadTilesPlugin {
if ( c.material ) {

const material = c.material;
if ( this.unloadMaterials ) {

material.dispose();

}
material.dispose();

if ( this.unloadTextures ) {
for ( const key in material ) {

for ( const key in material ) {
const value = material[ key ];
if ( value && value.isTexture ) {

const value = material[ key ];
if ( value && value.isTexture ) {

value.dispose();

}
value.dispose();

}

}

}

if ( c.geometry && this.unloadGeometry ) {
if ( c.geometry ) {

c.geometry.dispose();

Expand All @@ -83,7 +66,6 @@ export class UnloadTilesPlugin {

};


tiles.forEachLoadedModel( ( scene, tile ) => {

const visible = tiles.visibleSet.has( tile );
Expand Down

0 comments on commit f275630

Please sign in to comment.