Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #383

Merged
merged 3 commits into from
Jan 17, 2025
Merged
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
454 changes: 242 additions & 212 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,36 @@
},
"devDependencies": {
"@playcanvas/eslint-config": "^2.0.8",
"@playcanvas/pcui": "^4.6.0",
"@playcanvas/pcui": "^5.1.0",
"@rollup/plugin-alias": "^5.1.1",
"@rollup/plugin-image": "^3.0.3",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-node-resolve": "^16.0.0",
"@rollup/plugin-strip": "^3.0.4",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.1",
"@rollup/plugin-typescript": "^12.1.2",
"@types/wicg-file-system-access": "^2023.10.5",
"@typescript-eslint/eslint-plugin": "^8.18.0",
"@typescript-eslint/parser": "^8.18.0",
"@typescript-eslint/eslint-plugin": "^8.20.0",
"@typescript-eslint/parser": "^8.20.0",
"autoprefixer": "^10.4.20",
"concurrently": "^9.1.0",
"concurrently": "^9.1.2",
"cors": "^2.8.5",
"cross-env": "^7.0.3",
"eslint": "^9.16.0",
"eslint": "^9.18.0",
"eslint-import-resolver-typescript": "^3.7.0",
"globals": "^15.13.0",
"i18next": "^24.1.0",
"globals": "^15.14.0",
"i18next": "^24.2.1",
"i18next-browser-languagedetector": "^8.0.2",
"jest": "^29.7.0",
"jszip": "^3.10.1",
"playcanvas": "^2.3.3",
"postcss": "^8.4.49",
"rollup": "^4.28.1",
"playcanvas": "^2.4.1",
"postcss": "^8.5.1",
"rollup": "^4.30.1",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.82.0",
"rollup-plugin-visualizer": "^5.14.0",
"sass": "^1.83.4",
"serve": "^14.2.4",
"tslib": "^2.8.1",
"typescript": "^5.7.2"
"typescript": "^5.7.3"
}
}
4 changes: 2 additions & 2 deletions src/asset-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class AssetLoader {

asset.on('load', () => {
// support loading 2d splats by adding scale_2 property with almost 0 scale
const splatData = asset.resource.splatData;
const splatData = (asset.resource as GSplatResource).splatData;
if (splatData.getProp('scale_0') && splatData.getProp('scale_1') && !splatData.getProp('scale_2')) {
const scale2 = new Float32Array(splatData.numSplats).fill(Math.log(1e-6));
splatData.addProp('scale_2', scale2);
Expand Down Expand Up @@ -179,7 +179,7 @@ class AssetLoader {
url: loadRequest.url,
filename: loadRequest.filename
});
asset.resource = new GSplatResource(this.device, gsplatData);
asset.resource = new GSplatResource(this.device, gsplatData, []);
resolve(new Splat(asset));
})
.catch((err) => {
Expand Down
2 changes: 1 addition & 1 deletion src/shaders/infinite-grid-shader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const fragmentShader = /* glsl*/ `
bool writeDepth(float alpha) {
vec2 uv = fract(gl_FragCoord.xy / 32.0);
float noise = texture2DLodEXT(blueNoiseTex32, uv, 0.0).y;
float noise = texture2DLod(blueNoiseTex32, uv, 0.0).y;
return alpha > noise;
}
Expand Down
2 changes: 1 addition & 1 deletion src/shaders/sphere-shape-shader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const fragmentShader = /* glsl */ `

bool writeDepth(float alpha) {
vec2 uv = fract(gl_FragCoord.xy / 32.0);
float noise = texture2DLodEXT(blueNoiseTex32, uv, 0.0).y;
float noise = texture2DLod(blueNoiseTex32, uv, 0.0).y;
return alpha > noise;
}

Expand Down
14 changes: 6 additions & 8 deletions src/splat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,9 @@ class Splat extends Element {
this.transformPalette = new TransformPalette(splatResource.device);

this.rebuildMaterial = (bands: number) => {
// @ts-ignore
instance.createMaterial(materialOptions);

const material = instance.material;

const numBands = instance.splat.hasSH ? bands : 0;
material.setDefine('SH_BANDS', `${numBands}`);
const { material } = instance;
material.setDefine('SH_BANDS', `${Math.min(bands, instance.splat.shBands)}`);
material.setParameter('splatState', this.stateTexture);
material.setParameter('splatTransform', this.transformTexture);
material.setParameter('transformPalette', this.transformPalette.texture);
Expand Down Expand Up @@ -263,7 +259,7 @@ class Splat extends Element {
}

get filename() {
return this.asset.file.filename;
return (this.asset.file as any).filename;
}

calcSplatWorldPosition(splatId: number, result: Vec3) {
Expand Down Expand Up @@ -366,7 +362,9 @@ class Splat extends Element {
}

focalPoint() {
return this.asset.resource?.getFocalPoint?.();
// GSplatData has a function for calculating an weighted average of the splat positions
// to get a focal point for the camera, but we use bound center instead
return this.worldBound.center;
}

move(position?: Vec3, rotation?: Quat, scale?: Vec3) {
Expand Down
1 change: 0 additions & 1 deletion src/ui/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class Menu extends Container {

const toggleCollapsed = () => {
document.body.classList.toggle('collapsed');

};

// collapse menu on mobile
Expand Down
Loading