Skip to content

Commit

Permalink
Show file select (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
slimbuck authored Jan 22, 2024
1 parent c06d1fc commit 9055c31
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
10 changes: 6 additions & 4 deletions src/splat-debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ void main(void)
class SplatDebug {
splatData: SplatData;
meshInstance: MeshInstance;
size = 2;

constructor(scene: Scene, splat: Splat, splatData: SplatData) {
const device = scene.graphicsDevice;
Expand All @@ -59,7 +60,6 @@ class SplatDebug {
material.name = 'splatDebugMaterial';
material.blendType = BLEND_NORMAL;
material.shader = shader;
material.setParameter('splatSize', 1.0);
material.update();

const x = splatData.getProp('x');
Expand All @@ -81,6 +81,8 @@ class SplatDebug {

this.splatData = splatData;
this.meshInstance = new MeshInstance(mesh, material, splat.root);

this.splatSize = this.size;
}

update() {
Expand All @@ -105,12 +107,12 @@ class SplatDebug {
}

set splatSize(splatSize: number) {
this.meshInstance.material.setParameter('splatSize', splatSize);
this.size = splatSize;
this.meshInstance.material.setParameter('splatSize', splatSize * window.devicePixelRatio);
}

get splatSize() {
// @ts-ignore
return this.meshInstance.material.getParameter('splatSize').data;
return this.size;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/ui/control-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ class ControlPanel extends Panel {
precision: 1,
min: 0,
max: 10,
value: 1
value: 2
});

splatSize.append(splatSizeLabel);
Expand Down
12 changes: 7 additions & 5 deletions src/ui/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,18 +163,20 @@ class EditorUI {
hidden: true
});

// file select
const fileSelect = new Container({
id: 'file-selector-container'
});

controlPanel.append(fileSelect);

editorContainer.append(toolbarContainer);
editorContainer.append(controlPanel);
editorContainer.append(canvasContainer);
appContainer.append(editorContainer);
appContainer.append(errorPopup);
appContainer.append(infoPopup);

// file select
const fileSelect = new Container({
id: 'file-selector-container'
});

this.appContainer = appContainer;
this.controlPanel = controlPanel;
this.canvasContainer = canvasContainer;
Expand Down

0 comments on commit 9055c31

Please sign in to comment.