@sparkjsdev/spark 0.1.0 → 0.1.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 +20 -20
- package/dist/assets/{worker-DnqMl73p.js.map → worker-DN5J0FWb.js.map} +1 -1
- package/dist/assets/{worker-DQiiPuma.js.map → worker-Do1mGyaZ.js.map} +1 -1
- package/dist/spark.cjs.js +83 -77
- package/dist/spark.cjs.js.map +1 -1
- package/dist/spark.cjs.min.js +22 -22
- package/dist/spark.cjs.min.js.map +1 -1
- package/dist/spark.module.js +83 -77
- package/dist/spark.module.js.map +1 -1
- package/dist/spark.module.min.js +1278 -1274
- package/dist/spark.module.min.js.map +1 -1
- package/dist/types/{ForgeRenderer.d.ts → SparkRenderer.d.ts} +11 -11
- package/dist/types/{ForgeViewpoint.d.ts → SparkViewpoint.d.ts} +6 -6
- package/dist/types/controls.d.ts +1 -1
- package/dist/types/index.d.ts +3 -3
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
|
|
3
|
-

|
|
4
|
+

|
|
5
5
|
|
|
6
6
|
<h3 align="center">An advanced 3D Gaussian Splatting renderer for THREE.js</h3>
|
|
7
7
|
<div align="center">
|
|
8
8
|
|
|
9
9
|
[Features](#features) -
|
|
10
10
|
[Getting Started](#getting-started) -
|
|
11
|
-
<a href="https://
|
|
12
|
-
<a href="https://
|
|
11
|
+
<a href="https://sparkjs.dev/">Documentation</a> -
|
|
12
|
+
<a href="https://sparkjs.dev/">FAQ</a>
|
|
13
13
|
</div>
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
16
|
<div align="center">
|
|
17
17
|
|
|
18
|
-
[](https://github.com/
|
|
19
|
-
[](https://github.com/sparkjsdev/spark/blob/main/LICENSE)
|
|
19
|
+
[](https://www.npmjs.com/package/@sparkjsdev/spark)
|
|
20
20
|
|
|
21
21
|
</div>
|
|
22
22
|
|
|
23
23
|
<p>
|
|
24
|
-
<a href="https://
|
|
24
|
+
<a href="https://sparkjs.dev" target="_blank">
|
|
25
25
|
<picture>
|
|
26
26
|
</picture>
|
|
27
27
|
</a>
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
- Real-time splat color editing, displacement, and skeletal animation
|
|
39
39
|
- Shader graph system to dynamically create/edit splats on the GPU
|
|
40
40
|
|
|
41
|
-
Check out all the [examples](https://
|
|
41
|
+
Check out all the [examples](https://sparkjs.dev/examples/)
|
|
42
42
|
|
|
43
43
|
## Getting Started
|
|
44
44
|
|
|
@@ -53,13 +53,13 @@ Copy the following code into an `index.html` file.
|
|
|
53
53
|
{
|
|
54
54
|
"imports": {
|
|
55
55
|
"three": "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.174.0/three.module.js",
|
|
56
|
-
"@
|
|
56
|
+
"@sparkjsdev/spark": "https://sparkjs.dev/releases/spark/0.1.1/spark.module.js"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
</script>
|
|
60
60
|
<script type="module">
|
|
61
61
|
import * as THREE from "three";
|
|
62
|
-
import { SplatMesh } from "@
|
|
62
|
+
import { SplatMesh } from "@sparkjsdev/spark";
|
|
63
63
|
|
|
64
64
|
const scene = new THREE.Scene();
|
|
65
65
|
const camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 1000);
|
|
@@ -67,7 +67,7 @@ Copy the following code into an `index.html` file.
|
|
|
67
67
|
renderer.setSize(window.innerWidth, window.innerHeight);
|
|
68
68
|
document.body.appendChild(renderer.domElement)
|
|
69
69
|
|
|
70
|
-
const splatURL = "https://
|
|
70
|
+
const splatURL = "https://sparkjs.dev/assets/splats/butterfly.spz";
|
|
71
71
|
const butterfly = new SplatMesh({ url: splatURL });
|
|
72
72
|
butterfly.quaternion.set(1, 0, 0, 0);
|
|
73
73
|
butterfly.position.set(0, 0, -3);
|
|
@@ -82,7 +82,7 @@ Copy the following code into an `index.html` file.
|
|
|
82
82
|
|
|
83
83
|
### Web Editor
|
|
84
84
|
|
|
85
|
-
Remix the [glitch starter template](https://glitch.com/edit/#!/
|
|
85
|
+
Remix the [glitch starter template](https://glitch.com/edit/#!/sparkjs-dev)
|
|
86
86
|
|
|
87
87
|
### CDN
|
|
88
88
|
|
|
@@ -91,7 +91,7 @@ Remix the [glitch starter template](https://glitch.com/edit/#!/forge-dev)
|
|
|
91
91
|
{
|
|
92
92
|
"imports": {
|
|
93
93
|
"three": "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.174.0/three.module.js",
|
|
94
|
-
"
|
|
94
|
+
"@sparkjsdev/spark": "https://sparkjs.dev/releases/spark/0.2.0/spark.module.js"
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
</script>
|
|
@@ -100,26 +100,26 @@ Remix the [glitch starter template](https://glitch.com/edit/#!/forge-dev)
|
|
|
100
100
|
### NPM
|
|
101
101
|
|
|
102
102
|
```shell
|
|
103
|
-
npm install @
|
|
103
|
+
npm install @sparkjsdev/spark
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
## Run Examples locally
|
|
107
107
|
|
|
108
108
|
Install [Rust](https://www.rust-lang.org/tools/install) if it's not already installed in your machine.
|
|
109
109
|
|
|
110
|
-
Next, build
|
|
110
|
+
Next, build Spark by running:
|
|
111
111
|
```
|
|
112
112
|
npm install
|
|
113
113
|
npm run build
|
|
114
114
|
```
|
|
115
|
-
This will first build the Rust Wasm component (can be invoked via `npm run build:wasm`), then
|
|
115
|
+
This will first build the Rust Wasm component (can be invoked via `npm run build:wasm`), then Spark itself (`npm run build`).
|
|
116
116
|
|
|
117
117
|
The examples fetch assets from a remote URL. This step is optional, but offline development and faster loading times are possible if you download and cache the assets files locally with the following command:
|
|
118
118
|
```
|
|
119
119
|
npm run assets:download
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
Once you've built
|
|
122
|
+
Once you've built Spark and optionally downloaded the assets, you can now run the examples:
|
|
123
123
|
```
|
|
124
124
|
npm start
|
|
125
125
|
```
|
|
@@ -183,7 +183,7 @@ Edit markdown in `/docs` directory
|
|
|
183
183
|
npm run docs
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
-
### Build
|
|
186
|
+
### Build Spark website
|
|
187
187
|
|
|
188
188
|
Build the static site and docs in a `site` directory.
|
|
189
189
|
|
|
@@ -197,9 +197,9 @@ You can run any static server in the `site` directory but for convenience you ca
|
|
|
197
197
|
npm run site:serve
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
-
### Deploy
|
|
200
|
+
### Deploy Spark website
|
|
201
201
|
|
|
202
|
-
The following command will generate a static site from the `docs` directory and push it to the [repo](https://github.com/
|
|
202
|
+
The following command will generate a static site from the `docs` directory and push it to the [repo](https://github.com/sparkjsdev/sparkjs-dev.github.io) that hosts the site via `gh-pages`
|
|
203
203
|
|
|
204
204
|
```
|
|
205
205
|
npm run site:deploy
|