Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
"license": "MIT",
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@types/three": "0.178.0",
"@types/three": "0.183.1",
"lefthook": "1.11.12",
"lil-gui": "^0.20.0",
"onchange": "7.1.0",
"stats.js": "^0.17.0",
"three": "^0.178.0",
"three": "^0.183.2",
"ts-node": "10.9.2",
"typescript": "^5.7.3",
"vite": "^6.0.11",
Expand All @@ -61,7 +61,7 @@
"fflate": "^0.8.2"
},
"peerDependencies": {
"three": "^0.178.0"
"three": "^0.183.2"
},
"keywords": ["3d", "three.js", "gsplats", "3dgs", "gaussian", "splats"]
}
8 changes: 4 additions & 4 deletions src/PackedSplats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,10 @@ export class PackedSplats {
dispose() {
if (this.target) {
this.target.dispose();
this.target.texture.source.data = null;
this.target = null;
}
if (this.source) {
this.source.dispose();
this.source.source.data = null;
this.source = null;
}

Expand All @@ -264,7 +262,6 @@ export class PackedSplats {
const texture = dyno.value;
if (texture?.isTexture) {
texture.dispose();
texture.source.data = null;
}
}
}
Expand Down Expand Up @@ -542,7 +539,10 @@ export class PackedSplats {
this.source.type = THREE.UnsignedIntType;
this.source.internalFormat = "RGBA32UI";
this.source.needsUpdate = true;
} else if (this.packedArray.buffer !== this.source.image.data.buffer) {
} else if (
!this.source.image.data ||
this.packedArray.buffer !== this.source.image.data.buffer
) {
// The source texture is the right size, update the data
this.source.image.data = new Uint8Array(this.packedArray.buffer);
}
Expand Down
5 changes: 4 additions & 1 deletion src/RgbaArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ export class RgbaArray {
this.source.type = THREE.UnsignedByteType;
this.source.internalFormat = "RGBA8";
this.source.needsUpdate = true;
} else if (this.array.buffer !== this.source.image.data.buffer) {
} else if (
!this.source.image.data ||
this.array.buffer !== this.source.image.data.buffer
) {
this.source.image.data = new Uint8Array(this.array.buffer);
}
this.source.needsUpdate = true;
Expand Down
2 changes: 1 addition & 1 deletion src/shaders/splatVertex.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ uniform float focalAdjustment;
uniform usampler2DArray packedSplats;
uniform vec4 rgbMinMaxLnScaleMinMax;

#ifdef USE_LOGDEPTHBUF
#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
bool isPerspectiveMatrix( mat4 m ) {
return m[ 2 ][ 3 ] == - 1.0;
}
Expand Down
Loading