Skip to content

Commit

Permalink
gltf-compressor with geometry compression
Browse files Browse the repository at this point in the history
  • Loading branch information
vineek committed Jan 17, 2024
1 parent 83e0cbc commit 467484f
Show file tree
Hide file tree
Showing 10 changed files with 2,457 additions and 1,103 deletions.
12 changes: 6 additions & 6 deletions app_web/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
glTF Compressor Web App
glTF Sample Viewer Web App
==============================

[![](../assets/images/ToyCar.jpg)](https://github.khronos.org/glTF-Compressor-Release/)
[![](../assets/images/BoomBox.jpg)](https://github.khronos.org/glTF-Sample-Viewer-Release/)

This is the official [Khronos glTF](https://www.khronos.org/gltf/) Compressor using [WebGL](https://www.khronos.org/webgl/), [KTX](https://www.khronos.org/ktx/): [glTF Compressor](https://github.khronos.org/glTF-Compressor-Release/)
This is the official [Khronos glTF 2.0](https://www.khronos.org/gltf/) Sample Viewer using [WebGL](https://www.khronos.org/webgl/): [glTF 2.0 Sample Viewer](https://github.khronos.org/glTF-Sample-Viewer-Release/)


Viewer
======

Link to the live [glTF Compressor](https://github.khronos.org/glTF-Compressor-Release/).
Link to the live [glTF 2.0 Sample Viewer](https://github.khronos.org/glTF-Sample-Viewer-Release/).

Usage
-----
Expand All @@ -20,7 +20,7 @@ Usage

`scroll` : Zoom camera

`GUI` : Use to change models and compression & comparison settings
`GUI` : Use to change models and settings

### Change glTF model

Expand Down Expand Up @@ -57,4 +57,4 @@ Debugging
* Install the [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) or [Debugger for Firefox](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-firefox-debug) extension for Visual Studio Code
* Open the project directory in Visual Studio Code and select `Debug->Add Configuration->Chrome` or `Debug->Add Configuration->Firefox` so the `.vscode/launch.json` file is created.
* Append `/app_web/dist` to `${workspaceFolder}` in the `launch.json` file
* `Debug->Start Debugging` should now launch a Chrome or Firefox window with the sample viewer and VS Code breakpoints should be hit.
* `Debug->Start Debugging` should now launch a Chrome or Firefox window with the sample viewer and VS Code breakpoints should be hit.
854 changes: 642 additions & 212 deletions app_web/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app_web/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { main } from './GltfSVApp.js';
import main from './GltfSVApp.js';

main();
3 changes: 3 additions & 0 deletions app_web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"gl-matrix": "^3.2.1",
"gltf-viewer-source": "../source",
"jpeg-js": "^0.4.3",
"meshoptimizer": "^0.19.0",
"normalize-wheel": "^1.0.1",
"path": "^0.12.7",
"rxjs": "^6.6.3",
Expand All @@ -46,11 +47,13 @@
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^14.1.0",
"@rollup/plugin-replace": "^4.0.0",
"@rollup/plugin-wasm": "^6.1.3",
"concurrently": "^7.4.0",
"eslint": "^8.24.0",
"rollup": "^2.79.1",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-glslify": "^1.3.1",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-polyfill-node": "^0.12.0",
"rollup-plugin-scss": "^3.0.0",
"sass": "^1.55.0",
Expand Down
6 changes: 4 additions & 2 deletions app_web/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import copy from 'rollup-plugin-copy';
import alias from '@rollup/plugin-alias';
import replace from '@rollup/plugin-replace';
import json from '@rollup/plugin-json';
import {wasm} from "@rollup/plugin-wasm";
import nodePolyfills from 'rollup-plugin-polyfill-node';

export default {
Expand All @@ -19,6 +20,7 @@ export default {
}
],
plugins: [
wasm(),
json(),
glslify({
include: ['../source/Renderer/shaders/*', '../source/shaders/*'],
Expand All @@ -27,13 +29,13 @@ export default {
resolve({
browser: true,
preferBuiltins: true,
dedupe: ['gl-matrix', 'axios', 'jpeg-js', 'fast-png']
dedupe: ['gl-matrix', 'axios', 'jpeg-js', 'fast-png', 'meshoptimizer']
}),
scss(),
copy({
targets: [
{ src: ["index.html", "main.js"], dest: "dist/" },
{ src: ["../assets/models/2.0", "!../asset/models/.git"], dest: "dist/assets/models" },
{ src: ["../assets/models/Models", "!../asset/models/.git"], dest: "dist/assets/models" },
{ src: ["../assets/environments/*.hdr", "../assets/environments/*.jpg", "!../asset/environments/.git"], dest: "dist/assets/environments" },
{ src: ["../assets/images"], dest: "dist/assets" },
{ src: ["../assets/ui"], dest: "dist/assets" },
Expand Down
756 changes: 361 additions & 395 deletions app_web/src/logic/uimodel.js

Large diffs are not rendered by default.

Loading

0 comments on commit 467484f

Please sign in to comment.