Skip to content

Commit

Permalink
Add function to change spherical harmonics degree at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
mkkellogg committed Sep 9, 2024
1 parent b2e8156 commit 093ca0b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/DropInViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ export class DropInViewer extends THREE.Group {
return this.viewer.getSceneCount();
}

setActiveSphericalHarmonicsDegrees(activeSphericalHarmonicsDegrees) {
this.viewer.setActiveSphericalHarmonicsDegrees(activeSphericalHarmonicsDegrees);
}

dispose() {
return this.viewer.dispose();
}
Expand Down
5 changes: 5 additions & 0 deletions src/Viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,11 @@ export class Viewer {
this.renderMode = renderMode;
}

setActiveSphericalHarmonicsDegrees(activeSphericalHarmonicsDegrees) {
this.splatMesh.material.uniforms.sphericalHarmonicsDegree.value = activeSphericalHarmonicsDegrees;
this.splatMesh.material.uniformsNeedUpdate = true;
}

onSplatMeshChanged(callback) {
this.onSplatMeshChangedCallback = callback;
}
Expand Down

0 comments on commit 093ca0b

Please sign in to comment.