dgs-js 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# DGS-JS
|
|
2
|
+
This is the home of the web-based tooling for the **Dynamic Gaussian Splat** (`.dgs`) file format. This repository contains:
|
|
3
|
+
- Javascript bindings for encoding/decoding `.dgs` files
|
|
4
|
+
- Javascript bindings for `.dgs` file utility functions
|
|
5
|
+
- A web-based renderer for `.dgs` files
|
|
6
|
+
|
|
7
|
+
This library is mainly a wrapper over `DGS`, along with a renderer. See the [DGS repo](github.com/splatsdotcom/DGS) for documentation on the `.dgs` file format itself.
|
|
8
|
+
|
|
9
|
+
## Installation + Usage
|
|
10
|
+
To use `DGS-JS` in your own project, you can install the package on `npm`:
|
|
11
|
+
```bash
|
|
12
|
+
npm install dgs-js
|
|
13
|
+
```
|
|
14
|
+
Then, it can be used in your project with a simple:
|
|
15
|
+
```js
|
|
16
|
+
import 'dgs-js'
|
|
17
|
+
```
|
|
18
|
+
Here is a full example rendering a single `.dgs` file:
|
|
19
|
+
```html
|
|
20
|
+
<!DOCTYPE html>
|
|
21
|
+
<html lang="en">
|
|
22
|
+
<head>
|
|
23
|
+
<meta charset="UTF-8">
|
|
24
|
+
<title>DGS Player</title>
|
|
25
|
+
<style>
|
|
26
|
+
html, body
|
|
27
|
+
{
|
|
28
|
+
margin: 0;
|
|
29
|
+
height: 100%;
|
|
30
|
+
background: black;
|
|
31
|
+
}
|
|
32
|
+
dgs-player
|
|
33
|
+
{
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
36
|
+
display: block;
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
39
|
+
|
|
40
|
+
<script type="module">
|
|
41
|
+
import "dgs-player";
|
|
42
|
+
</script>
|
|
43
|
+
</head>
|
|
44
|
+
<body>
|
|
45
|
+
<dgs-player autoplay loop controls src="example.dgs"></dgs-player>
|
|
46
|
+
</body>
|
|
47
|
+
</html>
|
|
48
|
+
```
|
|
49
|
+
`example.dgs` can be found [here](test/example.dgs).
|
|
50
|
+
|
|
51
|
+
## Documentation
|
|
52
|
+
Coming soon!
|
|
53
|
+
|
|
54
|
+
## Building WASM
|
|
55
|
+
This project uses WebAssembly (WASM) for more optmized operations. If you wish to contribute to this project, you will need to build the WASM module yourself. To build, you will need the tools:
|
|
56
|
+
- `CMake`
|
|
57
|
+
- `emscripten`
|
|
58
|
+
|
|
59
|
+
Then, to build the WASM, you will first need to clone the repository and initialize the submodules:
|
|
60
|
+
```bash
|
|
61
|
+
git clone git@github.com:splatsdotcom/DGS-JS.git
|
|
62
|
+
cd DGS-JS
|
|
63
|
+
git submodule update --init --recursive
|
|
64
|
+
```
|
|
65
|
+
Next, you will need to generate build files using `CMake`:
|
|
66
|
+
```
|
|
67
|
+
cd src
|
|
68
|
+
cd wasm
|
|
69
|
+
mkdir build
|
|
70
|
+
cd build
|
|
71
|
+
emcmake cmake ..
|
|
72
|
+
```
|
|
73
|
+
This will generate a Makefile on Unix systems, and a Visual Studio project on windows. On Unix, you can run:
|
|
74
|
+
```
|
|
75
|
+
make
|
|
76
|
+
```
|
|
77
|
+
This will generate `dgs.js` and copy it to the `src/` directory. This is all you need to start development. On Windows, open the genrated `.sln` file in Visual Studio and build from there.
|