Skip to content

Commit 02717e7

Browse files
committed
Docs updates for v2.0
1 parent 7443be5 commit 02717e7

5 files changed

Lines changed: 13 additions & 16 deletions

File tree

docs/docs/0.1-2.0-migration-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Spark 2.0 was designed with backward-compatibility in mind. We expect most 0.1 a
44

55
## Update Spark dependencies
66

7-
- Install the latest version using NPM: `npm install @sparkjsdev/spark@2.0.0-preview`, or update your project's `package.json` to the latest Spark 2.0 release: `"@sparkjsdev/spark": "sparkjsdev/spark#v2.0.0-preview"`.
7+
- Install the latest version using NPM: `npm install @sparkjsdev/spark@2.0.0`, or update your project's `package.json` to the latest Spark 2.0 release: `"@sparkjsdev/spark": "^2.0.0"`.
88

99
- The minimum THREE.js version is r179 in order to support 2D array textures when rendering to multiple targets ([THREE.js #31476](https://github.com/mrdoob/three.js/pull/31476)). Make sure you're project's `package.json` includes THREE.js using `"three": "0.179.0"` or higher.
1010
```
1111
"dependencies": {
1212
"three": "0.180.0",
13-
"@sparkjsdev/spark": "sparkjsdev/spark#v2.0.0-preview"
13+
"@sparkjsdev/spark": "^2.0.0"
1414
},
1515
```
1616

docs/docs/index.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ Copy and paste code below in an `index.html` file or remix in the [Web Playgroun
1616
</script>
1717
<script type="module">
1818
import * as THREE from "three";
19-
import { SplatMesh } from "@sparkjsdev/spark";
19+
import { SparkRenderer, SplatMesh } from "@sparkjsdev/spark";
2020
2121
const scene = new THREE.Scene();
2222
const camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.01, 1000);
2323
const renderer = new THREE.WebGLRenderer();
2424
renderer.setSize(window.innerWidth, window.innerHeight);
2525
document.body.appendChild(renderer.domElement)
2626
27+
const spark = new SparkRenderer({ renderer });
28+
scene.add(spark);
29+
2730
const splatURL = "https://sparkjs.dev/assets/splats/butterfly.spz";
2831
const butterfly = new SplatMesh({ url: splatURL });
2932
butterfly.quaternion.set(1, 0, 0, 0);
@@ -40,13 +43,14 @@ Copy and paste code below in an `index.html` file or remix in the [Web Playgroun
4043
## Install with NPM
4144

4245
```shell
43-
npm install sparkjsdev/spark#v2.0.0-preview
46+
npm install @sparkjsdev/spark
4447
```
4548
## Develop and contribute to Spark
4649

4750
Build Spark (It requires [Rust](https://www.rust-lang.org/tools/install) installed in your machine)
4851
```
4952
npm install
53+
npm run build:wasm
5054
npm run dev
5155
```
5256

docs/docs/spark-renderer.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SparkRenderer
22

3-
Spark internally uses a `SparkRenderer` object in your `THREE.Scene` to perform splat rendering. Spark will automatically create a `SparkRenderer` and add it to your scene if you don't create one yourself. For more advanced use cases such as multiple viewpoints, rendering environment maps, or tuning rendering parameters such as Level-of-Detail (LoD), you can create your own `SparkRenderer` and add it anywhere in the scene, for example at the root:
3+
Spark internally uses a `SparkRenderer` object in your `THREE.Scene` to perform splat rendering. Create a `SparkRenderer` and add it anywhere to your scene (for example at the root), and use it to adjust rendering parameters such as Level-of-Detail (LoD):
44
```typescript
55
const spark = new SparkRenderer({
66
renderer: myThreeJsWebGlRenderer,
@@ -13,16 +13,10 @@ scene.add(spark);
1313

1414
```typescript
1515
const spark = new SparkRenderer({
16-
// Commonly used parameters
1716
renderer: THREE.WebGLRenderer;
1817
maxStdDev?: number;
19-
focalDistance?: number;
20-
apertureAngle?: number;
21-
falloff?: number;
22-
focalAdjustment?: number;
2318
sortRadial?: boolean;
2419
lodSplatScale?: number;
25-
2620
pagedExtSplats?: boolean;
2721
target?: { width: number; height: number; doubleBuffer?: boolean },
2822
});

docs/docs/system-design.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ Each `SparkRenderer` has a default `SparkViewpoint` that reads back a list of al
1111
Finally, on the next THREE.js render() call, `SparkRenderer` invokes a single instanced geometry draw call to draw all the scene's splats in the correct back-to-front order, merging with other opaque THREE.js geometry using the Z buffer. The sort order lags the render by at least one frame, but possibly more on older devices, but is not usually perceptible.
1212

1313
```typescript
14-
// Optionally add a SparkRenderer to the scene to manage SplatMesh rendering.
15-
// If none is created, Spark will create one for you automatically.
14+
// Add a SparkRenderer to the scene to manage SplatMesh rendering.
1615
const spark = new SparkRenderer({ renderer: webGlRenderer });
1716
scene.add(spark);
1817
```

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)