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 to engine v1.71 #295

Merged
merged 5 commits into from
May 23, 2024
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
4,655 changes: 408 additions & 4,247 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "model-viewer",
"version": "4.10.1",
"version": "4.11.0",
"author": "PlayCanvas<[email protected]>",
"homepage": "https://playcanvas.com",
"description": "PlayCanvas glTF Viewer",
Expand Down Expand Up @@ -60,29 +60,26 @@
"@rollup/plugin-typescript": "^11.1.6",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"@typescript-eslint/eslint-plugin": "^7.10.0",
"@typescript-eslint/parser": "^7.10.0",
"concurrently": "^8.2.2",
"cross-env": "^7.0.3",
"eslint": "^8.56.0",
"fflate": "^0.8.2",
"handlebars": "^4.7.8",
"playcanvas": "^1.70.3",
"playcanvas": "^1.71.1",
"prop-types": "^15.8.1",
"qrious": "^4.0.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-visibility-sensor": "^5.1.1",
"rollup": "^4.17.2",
"rollup": "^4.18.0",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-sass": "^1.12.22",
"serve": "^14.2.3",
"tslib": "^2.6.2",
"typescript": "^5.4.5"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "4.12.0"
},
"scripts": {
"build": "rollup -c",
"watch": "rollup -c -w",
Expand Down
4 changes: 4 additions & 0 deletions src/debug-lines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ class DebugLines {
const blendIndices = it.element[SEMANTIC_BLENDINDICES];
const blendWeights = it.element[SEMANTIC_BLENDWEIGHT];

if (!positions || !normals) {
return;
}

const numVertices = vertexBuffer.getNumVertices();
const p0 = new Vec3();
const p1 = new Vec3();
Expand Down
4 changes: 2 additions & 2 deletions src/index.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<html>
<head>
<title>PlayCanvas glTF Viewer</title>
<meta name="description" content="Fast and lightweight glTF 2.0 scene viewer powered by the PlayCanvas WebGL engine">
<meta name="keywords" content="glTF, GLB, WebGL, PlayCanvas, Viewer">
<meta name="description" content="Fast and lightweight glTF 2.0 and gaussian splatting PLY scene viewer powered by the PlayCanvas engine.">
<meta name="keywords" content="glTF, GLB, PLY, WebGL, WebGPU, PlayCanvas, Viewer">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
{{#hasPublicPath}}
Expand Down
1 change: 1 addition & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const skyboxes = [

const observerData: ObserverData = {
ui: {
fullscreen: false,
active: null,
spinner: false,
error: null
Expand Down
4 changes: 2 additions & 2 deletions src/multiframe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ void main(void) {
`;

const supportsFloat16 = (device: WebglGraphicsDevice): boolean => {
return device.extTextureHalfFloat && device.textureHalfFloatRenderable;
return device.textureHalfFloatRenderable;
};

const supportsFloat32 = (device: WebglGraphicsDevice): boolean => {
return device.extTextureFloat && device.textureFloatRenderable;
return device.textureFloatRenderable;
};

// lighting source should be stored HDR
Expand Down
2 changes: 1 addition & 1 deletion src/projective-skybox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void main(void) {

vec3 final_dir = mix(view_dir, env_dir, tripodParams.w) * cubeMapRotationMatrix;

vec3 linear = SKYBOX_DECODE_FNC(textureCube(texture_cubeMap, fixSeamsStatic(final_dir * vec3(-1.0, 1.0, 1.0), SKYBOX_MIP)));
vec3 linear = SKYBOX_DECODE_FNC(textureCube(texture_cubeMap, final_dir * vec3(-1.0, 1.0, 1.0)));

gl_FragColor = vec4(gammaCorrectOutput(toneMap(processEnvironment(linear))), 1.0);
}
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface HierarchyNode {

export interface ObserverData {
ui: {
fullscreen: boolean,
active?: string,
spinner: boolean,
error?: string,
Expand Down
5 changes: 4 additions & 1 deletion src/ui/left-panel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ class LeftPanel extends React.Component <{ observerData: ObserverData, setProper
}

componentDidUpdate(prevProps: Readonly<{ observerData: ObserverData; setProperty: SetProperty; }>): void {
if (!this.isMobile && prevProps.observerData.scene.nodes === '[]' && this.props.observerData.scene.nodes !== '[]') {
if (!this.isMobile &&
!this.props.observerData.ui.fullscreen &&
this.props.observerData.scene.nodes !== '[]' &&
prevProps.observerData.scene.nodes === '[]') {
openPanel();
}
}
Expand Down
24 changes: 15 additions & 9 deletions static/manifest.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
{
"name": "Model Viewer",
"short_name": "Model Viewer",
"description": "Fast and lightweight glTF 2.0 and gaussian splat PLY viewer.",
"display": "fullscreen",
"start_url": "/viewer/",
"scope": "/viewer/",
"background_color": "black",
"categories": ["productivity", "utilities"],
"description": "Fast and lightweight glTF viewer.",
"dir": "auto",
"display": "standalone",
"icons": [{
"src": "playcanvas-logo.png",
"sizes": "64x64",
"type": "image/png"
}],
"lang": "en-US",
"name": "PlayCanvas glTF Viewer",
"orientation": "any",
"prefer_related_applications": false,
"short_name": "glTF Viewer",
"start_url": "."
"file_handlers": [
{
"action": "/viewer/",
"accept": {
"application/ply": [".ply"],
"model/gltf-binary": [".glb"]
}
}
]
}
Loading