From acb541cc4e41c0c02b75a3a0c939128c4de93678 Mon Sep 17 00:00:00 2001 From: Andreas Sundquist Date: Mon, 9 Jun 2025 13:50:08 -0700 Subject: [PATCH] Renamed "forge" to "spark". Updated meta-references and future domain. (#40) --- .github/workflows/ci-linux.yml | 4 +- .github/workflows/ci-windows.yaml | 4 +- README.md | 40 +++---- biome.json | 2 +- docs/docs/community-resources.md | 14 +-- docs/docs/controls.md | 6 +- docs/docs/dyno-overview.md | 10 +- docs/docs/dyno-stdlib.md | 8 +- docs/docs/index.md | 20 ++-- docs/docs/loading-splats.md | 4 +- docs/docs/overview.md | 10 +- docs/docs/packed-splats.md | 8 +- docs/docs/performance.md | 4 +- docs/docs/procedural-splats.md | 8 +- .../{forge-renderer.md => spark-renderer.md} | 34 +++--- ...{forge-viewpoint.md => spark-viewpoint.md} | 24 ++-- docs/docs/splat-editing.md | 2 +- docs/docs/splat-mesh.md | 6 +- docs/docs/system-design.md | 18 +-- docs/overrides/partials/header.html | 2 +- docs/stylesheets/{forge.css => spark.css} | 0 examples.html | 16 +-- examples/assets.json | 50 ++++----- examples/dynamic-lighting/index.html | 14 +-- examples/editor/index.html | 16 +-- examples/envmap/index.html | 12 +- examples/hello-world/carousel.html | 6 +- examples/hello-world/index.html | 6 +- examples/interactivity/index.html | 6 +- examples/js/get-asset-url.js | 2 +- examples/js/preloader.js | 8 +- ...ding_black.gif => spark_loading_black.gif} | Bin ...ding_white.gif => spark_loading_white.gif} | Bin examples/multiple-splats/index.html | 6 +- examples/multiple-viewpoints/index.html | 14 +-- examples/particle-animation/index.html | 12 +- examples/particle-simulation/index.html | 12 +- examples/procedural-splats/index.html | 8 +- examples/raycasting/index.html | 6 +- examples/viewer/index.html | 30 ++--- .../viewer/{forge-logo.svg => spark-logo.svg} | 0 .../{forge-viewer.svg => spark-viewer.svg} | 0 index.html | 8 +- mkdocs.yml | 10 +- package-lock.json | 23 ++-- package.json | 20 ++-- rust/.gitignore | 2 +- rust/Cargo.lock | 20 ++-- rust/Cargo.toml | 4 +- rust/build_rust_wasm.ps1 | 2 +- rust/build_rust_wasm.sh | 2 +- .../Cargo.toml | 2 +- .../README.md | 10 +- .../src/lib.rs | 0 .../src/raycast.rs | 0 .../src/sort.rs | 0 scripts/compress-to-spz.js | 2 +- scripts/deploy-site.js | 4 +- src/PackedSplats.ts | 2 +- src/Readback.ts | 2 +- src/{ForgeRenderer.ts => SparkRenderer.ts} | 104 +++++++++--------- src/{ForgeViewpoint.ts => SparkViewpoint.ts} | 84 +++++++------- src/SplatAccumulator.ts | 2 +- src/SplatEdit.ts | 2 +- src/SplatGenerator.ts | 2 +- src/SplatGeometry.ts | 2 +- src/SplatMesh.ts | 4 +- src/controls.ts | 6 +- src/index.ts | 6 +- src/utils.ts | 4 +- src/worker.ts | 4 +- vite.config.ts | 6 +- 72 files changed, 396 insertions(+), 395 deletions(-) rename docs/docs/{forge-renderer.md => spark-renderer.md} (77%) rename docs/docs/{forge-viewpoint.md => spark-viewpoint.md} (89%) rename docs/stylesheets/{forge.css => spark.css} (100%) rename examples/js/{forge_loading_black.gif => spark_loading_black.gif} (100%) rename examples/js/{forge_loading_white.gif => spark_loading_white.gif} (100%) rename examples/viewer/{forge-logo.svg => spark-logo.svg} (100%) rename examples/viewer/{forge-viewer.svg => spark-viewer.svg} (100%) rename rust/{forge-internal-rs => spark-internal-rs}/Cargo.toml (91%) rename rust/{forge-internal-rs => spark-internal-rs}/README.md (78%) rename rust/{forge-internal-rs => spark-internal-rs}/src/lib.rs (100%) rename rust/{forge-internal-rs => spark-internal-rs}/src/raycast.rs (100%) rename rust/{forge-internal-rs => spark-internal-rs}/src/sort.rs (100%) rename src/{ForgeRenderer.ts => SparkRenderer.ts} (91%) rename src/{ForgeViewpoint.ts => SparkViewpoint.ts} (91%) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 20cc3fe..aece633 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -1,4 +1,4 @@ -name: Forge CI Linux +name: Spark CI Linux on: push: branches: @@ -10,7 +10,7 @@ permissions: contents: read jobs: test: - name: forge + name: spark runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/ci-windows.yaml b/.github/workflows/ci-windows.yaml index 1c26e5b..413eaa4 100644 --- a/.github/workflows/ci-windows.yaml +++ b/.github/workflows/ci-windows.yaml @@ -1,4 +1,4 @@ -name: Forge CI Windows +name: Spark CI Windows on: push: branches: @@ -10,7 +10,7 @@ permissions: contents: read jobs: test: - name: forge + name: spark runs-on: windows-latest strategy: matrix: diff --git a/README.md b/README.md index 05fe887..c85508a 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,27 @@

- ![Forge logo](https://github.com/user-attachments/assets/d9cec150-8ca1-47f4-b7d9-4782aa629166#gh-dark-mode-only) - ![Forge logo](https://github.com/user-attachments/assets/adb2f0d7-df30-49e5-be7f-75c14f008735#gh-light-mode-only) + ![Spark logo](https://github.com/user-attachments/assets/d9cec150-8ca1-47f4-b7d9-4782aa629166#gh-dark-mode-only) + ![Spark logo](https://github.com/user-attachments/assets/adb2f0d7-df30-49e5-be7f-75c14f008735#gh-light-mode-only)

An advanced 3D Gaussian Splatting renderer for THREE.js

[Features](#features) - [Getting Started](#getting-started) - - Documentation - - FAQ + Documentation - + FAQ

- [![License](https://img.shields.io/badge/license-MIT-%23d43e4c)](https://github.com/forge-gfx/forge/blob/main/LICENSE) - [![npm version](https://img.shields.io/npm/v/forge?color=d43e4c)](https://www.npmjs.com/package/forge) + [![License](https://img.shields.io/badge/license-MIT-%23d43e4c)](https://github.com/sparkjs-dev/spark/blob/main/LICENSE) + [![npm version](https://img.shields.io/npm/v/@sparkjs-dev/spark?color=d43e4c)](https://www.npmjs.com/package/@sparkjs-dev/spark)

- + @@ -38,7 +38,7 @@ - Real-time splat color editing, displacement, and skeletal animation - Shader graph system to dynamically create/edit splats on the GPU -Check out all the [examples](https://forge.dev/examples/) +Check out all the [examples](https://sparkjs.dev/examples/) ## Getting Started @@ -53,13 +53,13 @@ Copy the following code into an `index.html` file. { "imports": { "three": "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.174.0/three.module.js", - "@forge-gfx/forge": "https://forge.dev/releases/forge/0.1.0/forge.module.js" + "@sparkjs-dev/spark": "https://sparkjs.dev/releases/spark/0.2.0/spark.module.js" } } @@ -100,26 +100,26 @@ Remix the [glitch starter template](https://glitch.com/edit/#!/forge-dev) ### NPM ```shell -npm install @forge-gfx/forge +npm install @sparkjs-dev/spark ``` ## Run Examples locally Install [Rust](https://www.rust-lang.org/tools/install) if it's not already installed in your machine. -Next, build Forge by running: +Next, build Spark by running: ``` npm install npm run build ``` -This will first build the Rust Wasm component (can be invoked via `npm run build:wasm`), then Forge itself (`npm run build`). +This will first build the Rust Wasm component (can be invoked via `npm run build:wasm`), then Spark itself (`npm run build`). 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: ``` npm run assets:download ``` -Once you've built Forge and optionally downloaded the assets, you can now run the examples: +Once you've built Spark and optionally downloaded the assets, you can now run the examples: ``` npm start ``` @@ -183,7 +183,7 @@ Edit markdown in `/docs` directory npm run docs ``` -### Build Forge website +### Build Spark website Build the static site and docs in a `site` directory. @@ -197,9 +197,9 @@ You can run any static server in the `site` directory but for convenience you ca npm run site:serve ``` -### Deploy Forge website +### Deploy Spark website -The following command will generate a static site from the `docs` directory and push it to the [repo](https://github.com/forge-gfx/forge-gfx.github.io) that hosts the site via `gh-pages` +The following command will generate a static site from the `docs` directory and push it to the [repo](https://github.com/sparkjs-dev/sparkjs-dev.github.io) that hosts the site via `gh-pages` ``` npm run site:deploy diff --git a/biome.json b/biome.json index 816cc0c..13ca1ce 100644 --- a/biome.json +++ b/biome.json @@ -11,7 +11,7 @@ "dist/*", "examples/showcase/hello-gsplat", "rust/target", - "rust/forge-internal-rs/pkg", + "rust/spark-internal-rs/pkg", "src/vrButton.ts", "site", "site-repo", diff --git a/docs/docs/community-resources.md b/docs/docs/community-resources.md index 125c5b6..9e4b117 100644 --- a/docs/docs/community-resources.md +++ b/docs/docs/community-resources.md @@ -1,16 +1,16 @@ # Community Resources -A collection of resources and examples created by the community. To add your own, please submit a PR to edit this page at [forge-gfx/forge](https://github.com/forge-gfx/forge/tree/main/docs/docs/community-resources.md). +A collection of resources and examples created by the community. To add your own, please submit a PR to edit this page at [sparkjs-dev/spark](https://github.com/sparkjs-dev/spark/tree/main/docs/docs/community-resources.md). ## Discord -Join the [Forge Discord](https://discord.gg/W39qmSKemS) to connect with other users and developers. +Join the [Spark Discord](https://discord.gg/W39qmSKemS) to connect with other users and developers. ## React Examples -Forge can be used alongside or within React for declarative scene management, dynamic rendering, and state management between your user interface and the 3D scene. See the following examples for how to use Forge with React. +Spark can be used alongside or within React for declarative scene management, dynamic rendering, and state management between your user interface and the 3D scene. See the following examples for how to use Spark with React. -- [`forge-react-basic`](https://github.com/forge-gfx/forge-react-basic): A basic example of creating a `` and THREE.js scene with Forge. -- [`forge-react-r3f`](https://github.com/forge-gfx/forge-react-r3f): Use Forge declaratively in React with [React Three Fiber](https://r3f.docs.pmnd.rs). -- [`forge-react-router`](https://github.com/forge-gfx/forge-react-router): An example of using Forge and React Three Fiber with [React Router](https://reactrouter.com) v7 framework mode with SSR. -- [`forge-react-nextjs`](https://github.com/forge-gfx/forge-react-nextjs): An example of using Forge and React Three Fiber with Next.js App Router. +- [`spark-react-basic`](https://github.com/sparkjs-dev/spark-react-basic): A basic example of creating a `` and THREE.js scene with Spark. +- [`spark-react-r3f`](https://github.com/sparkjs-dev/spark-react-r3f): Use Spark declaratively in React with [React Three Fiber](https://r3f.docs.pmnd.rs). +- [`spark-react-router`](https://github.com/sparkjs-dev/spark-react-router): An example of using Spark and React Three Fiber with [React Router](https://reactrouter.com) v7 framework mode with SSR. +- [`spark-react-nextjs`](https://github.com/sparkjs-dev/spark-react-nextjs): An example of using Spark and React Three Fiber with Next.js App Router. diff --git a/docs/docs/controls.md b/docs/docs/controls.md index b91a721..48b722a 100644 --- a/docs/docs/controls.md +++ b/docs/docs/controls.md @@ -1,9 +1,9 @@ # Controls -A program using `Forge` can use any camera control scheme that is compatible with THREE.js and will typically manipulate a `THREE.Camera` object's transform. `Forge` also ships with simple, intuitive controls for navigating 3D space that use the keyboard + mouse, game pad, or mobile multi-touch. To add these controls, you can create a `ForgeControls` instance: +A program using `Spark` can use any camera control scheme that is compatible with THREE.js and will typically manipulate a `THREE.Camera` object's transform. `Spark` also ships with simple, intuitive controls for navigating 3D space that use the keyboard + mouse, game pad, or mobile multi-touch. To add these controls, you can create a `SparkControls` instance: ```typescript -const controls = new ForgeControls({ +const controls = new SparkControls({ canvas: HTMLCanvasElement; }); @@ -13,7 +13,7 @@ renderer.setAnimationLoop((time) => { }); ``` -`ForgeControls` instantiates two classes `FpsMovement` and `PointerControls` that it updates internally. You can also instantiate and use these two classes separately: +`SparkControls` instantiates two classes `FpsMovement` and `PointerControls` that it updates internally. You can also instantiate and use these two classes separately: ## `class FpsMovement` diff --git a/docs/docs/dyno-overview.md b/docs/docs/dyno-overview.md index aca9608..00a3625 100644 --- a/docs/docs/dyno-overview.md +++ b/docs/docs/dyno-overview.md @@ -1,12 +1,12 @@ # Dyno shaders -The `dyno` shader graph system is one of the architectural pillars of Forge, allowing you to create custom computation graphs using Javascript (and optionally GLSL) that are compiled to GLSL and run on the GPU, similar to shader graph systems in modern 3D graphics engines. +The `dyno` shader graph system is one of the architectural pillars of Spark, allowing you to create custom computation graphs using Javascript (and optionally GLSL) that are compiled to GLSL and run on the GPU, similar to shader graph systems in modern 3D graphics engines. -A core component of this system is the class `Dyno` and its subclasses, which can be thought of as function blocks with multiple typed inputs and outputs. Values passed between such blocks are of type `DynoVal`, where `T` must be a `DynoType`, representing a GPU type in GLSL. Using TypeScript, Forge ensures type safety and static validation of the GPU computation graph. +A core component of this system is the class `Dyno` and its subclasses, which can be thought of as function blocks with multiple typed inputs and outputs. Values passed between such blocks are of type `DynoVal`, where `T` must be a `DynoType`, representing a GPU type in GLSL. Using TypeScript, Spark ensures type safety and static validation of the GPU computation graph. All `dyno` code is contained within `src/dyno`, and has definitions which cover all built-in GLSL ES 3.0 types (`"int"`, `"float"`, `"vec"`, etc.) and most of the standard functions (`mul`, `cross`, `texelFetch`, etc.). Note that regular Javascript functions can't be part of a `dyno` computation graph: instead of `x + y` you should use `dyno.add(x, y)`. You can also define your own custom types and `dyno` blocks, both by compositing existing `dyno` functions or by writing GLSL code directly. -Forge currently uses these Dynos in two main places: +Spark currently uses these Dynos in two main places: - Dynamically generating splats from `SplatGenerator`/`SplatMesh` into the scene - Computing the splat distance metric for CPU readback and sorting @@ -17,7 +17,7 @@ Learning to build and use `dyno` programs is probably best approached by startin ## `type DynoType` -A `DynoType` can be either a string that corresponds to a built-in GLSL type, or `{ type: "MyType" }` for a user-defined type. These types are used both for identifying value types `DynoVal` and for declaring input/output types for `Dyno` blocks, for example `{ index: "int" }` or `{ gsplat: Gsplat }` (`Gsplat` is defined as `{ type: "Gsplat" }`). Forge uses these to enforce TypeScript constraints on inputs+outputs of `Dyno` blocks to generate correct GLSL code. +A `DynoType` can be either a string that corresponds to a built-in GLSL type, or `{ type: "MyType" }` for a user-defined type. These types are used both for identifying value types `DynoVal` and for declaring input/output types for `Dyno` blocks, for example `{ index: "int" }` or `{ gsplat: Gsplat }` (`Gsplat` is defined as `{ type: "Gsplat" }`). Spark uses these to enforce TypeScript constraints on inputs+outputs of `Dyno` blocks to generate correct GLSL code. ### Build-in types @@ -25,7 +25,7 @@ A built-in GLSL type can be single-valued (`"int"`, `"uint"`, `"float"`, `"bool" ### Custom types -Forge defines a handful of custom types that are useful: `Gsplat`, `TPackedSplats`, `SdfArray`, `TRgbaArray`, and `SplatSkinning`. For example, in `src/dyno/splats.ts` we define `Gsplat` as `{ type: "Gsplat" }` along with a helper function: +Spark defines a handful of custom types that are useful: `Gsplat`, `TPackedSplats`, `SdfArray`, `TRgbaArray`, and `SplatSkinning`. For example, in `src/dyno/splats.ts` we define `Gsplat` as `{ type: "Gsplat" }` along with a helper function: ```typescript export const defineGsplat = unindent(` diff --git a/docs/docs/dyno-stdlib.md b/docs/docs/dyno-stdlib.md index f394129..65c2723 100644 --- a/docs/docs/dyno-stdlib.md +++ b/docs/docs/dyno-stdlib.md @@ -1,6 +1,6 @@ # Dyno Standard Library -The Forge `dyno` system provides a standard library of `Dyno` blocks that cover most of the built-in functions in GLSL ES 3.0, including data conversion, logic, math, trigonometry, linear algebra, texture lookups, transforms, managing uniform variables, hashing & RNG, and of course managing splat data. +The Spark `dyno` system provides a standard library of `Dyno` blocks that cover most of the built-in functions in GLSL ES 3.0, including data conversion, logic, math, trigonometry, linear algebra, texture lookups, transforms, managing uniform variables, hashing & RNG, and of course managing splat data. We use the convention of PascalCase for the names of the `Dyno` classes, and camelCase for the names of equivalent helper functions that are more ergonomic to use. For example, you can equivalently write: ```typescript @@ -157,7 +157,7 @@ The following math functions follow standard GLSL ES 3.0 semantics, for example ## Uniform variables -Constant values and literals in `dyno` programs should not be changed often because it incurs a recompilation. To have a variable that can be changed every frame, you can declare a "uniform". The base class for uniforms provided by Forge is `DynoUniform`, which importantly contains a type, current value, and update function. +Constant values and literals in `dyno` programs should not be changed often because it incurs a recompilation. To have a variable that can be changed every frame, you can declare a "uniform". The base class for uniforms provided by Spark is `DynoUniform`, which importantly contains a type, current value, and update function. To update a uniform, simply assign a new value to the `value` property of the uniform. Alternatively, you can construct a `DynoUniform` with an `update` function that is called for each execution. This function can either update `value` directly, or return any non-`undefined` value to have it updated. @@ -193,7 +193,7 @@ Use the following helper functions for more ergonomic creation of uniforms. ## Hashing & Random number generation -When a `dyno` program executes, each invocation for a given splat/index is effectively run in parallel, separate from the rest. In order to incorporate randomness into a `dyno` program, you must use the inputs available to the program, which is often just the `index` of the splat itself. Forge provides functions to hash any scalar or vector (integer or float) into 1-4 components of either a uint32 or float, using the PCG random number generator. +When a `dyno` program executes, each invocation for a given splat/index is effectively run in parallel, separate from the rest. In order to incorporate randomness into a `dyno` program, you must use the inputs available to the program, which is often just the `index` of the splat itself. Spark provides functions to hash any scalar or vector (integer or float) into 1-4 components of either a uint32 or float, using the PCG random number generator. | **Function** | **Description** | |----------|-------------| @@ -211,7 +211,7 @@ When a `dyno` program executes, each invocation for a given splat/index is effec ## Splat data -Forge makes it easier to work with splat data by defining the GLSL struct `Gsplat` which contains the following fields: +Spark makes it easier to work with splat data by defining the GLSL struct `Gsplat` which contains the following fields: | **Field** | **Type** | **Description** | |----------|-------------|-------------| diff --git a/docs/docs/index.md b/docs/docs/index.md index 79326f0..4b8a409 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -2,7 +2,7 @@ ## Quick Start -Copy and paste code below in an `index.html` file or remix in the [Web Playground](https://glitch.com/edit/#!/forge-dev) +Copy and paste code below in an `index.html` file or remix in the [Web Playground](https://glitch.com/edit/#!/sparkjs-dev) ```html @@ -10,13 +10,13 @@ Copy and paste code below in an `index.html` file or remix in the [Web Playgroun { "imports": { "three": "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.174.0/three.module.js", - "@forge-gfx/forge": "https://forge.dev/releases/forge/0.1.0/forge.module.js" + "@sparkjs-dev/spark": "https://sparkjs.dev/releases/spark/0.2.0/spark.module.js" } } @@ -77,13 +77,13 @@ import { SplatMesh, SplatEdit, - ForgeRenderer, + SparkRenderer, SplatEditSdf, SplatEditSdfType, SplatEditRgbaBlendMode, FpsMovement, PointerControls, - } from "@forge-gfx/forge"; + } from "@sparkjs-dev/spark"; import { getAssetFileURL } from "/examples/js/get-asset-url.js"; const canvas = document.getElementById("canvas"); @@ -96,9 +96,9 @@ renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElement) - // Create a ForgeRenderer and add it to the scene to render all the Gsplats. - const forge = new ForgeRenderer({ renderer }); - scene.add(forge); + // Create a SparkRenderer and add it to the scene to render all the Gsplats. + const spark = new SparkRenderer({ renderer }); + scene.add(spark); const splatURL = await getAssetFileURL("fireplace.spz"); const fireplace = new SplatMesh({ url: splatURL }); diff --git a/examples/editor/index.html b/examples/editor/index.html index 304973c..fa4495b 100644 --- a/examples/editor/index.html +++ b/examples/editor/index.html @@ -2,7 +2,7 @@ - Forge • Editor + Spark • Editor