Skip to content

Commit fce749c

Browse files
committed
Initial commit
0 parents  commit fce749c

129 files changed

Lines changed: 64575 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# FIX CRLF always when developer has not set
2+
# Linux/Mac: git config --global core.autocrlf input
3+
# Windows: git config --global core.autocrlf true
4+
# Auto detect text files and perform LF normalization
5+
* text=auto
6+
* eol=lf
7+
8+
*.html text
9+
*.glsl text
10+
*.js text
11+
*.md text
12+
*.ts text

.github/workflows/ci-linux.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Forge CI Linux
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
permissions:
10+
contents: read
11+
jobs:
12+
test:
13+
name: forge
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
node-version: ['22.x']
18+
steps:
19+
- name: Use Node.js ${{ matrix['node-version'] }}
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix['node-version'] }}
23+
24+
- name: Checkout Repo
25+
uses: actions/checkout@v4
26+
27+
- name: Install dependencies
28+
run: npm install
29+
30+
- name: Lint
31+
run: npm run lint
32+
33+
- name: Tests
34+
run: npm run test

.github/workflows/ci-windows.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Forge CI Windows
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
permissions:
10+
contents: read
11+
jobs:
12+
test:
13+
name: forge
14+
runs-on: windows-latest
15+
strategy:
16+
matrix:
17+
node-version: ['22.x']
18+
steps:
19+
- name: Use Node.js ${{ matrix['node-version'] }}
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix['node-version'] }}
23+
24+
- name: Set git to use LF
25+
run: |
26+
git config --global core.autocrlf false
27+
git config --global core.eol lf
28+
- uses: actions/checkout@v4
29+
30+
- name: Checkout Repo
31+
uses: actions/checkout@v4
32+
33+
- name: Install dependencies
34+
run: npm install
35+
36+
- name: Lint
37+
run: npm run lint
38+
39+
- name: Tests
40+
run: npm run test

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.DS_Store
2+
examples/assets
3+
examples/js/vendor
4+
examples/showcase/assets
5+
node_modules/
6+
site/
7+
*.zip
8+
*.gltf

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright © 2025 WORLD LABS TECHNOLOGIES, INC.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
<p align="center">
2+
<picture>
3+
<img alt="Forge" src="https://github.com/user-attachments/assets/adb2f0d7-df30-49e5-be7f-75c14f008735" width="auto" height="180">
4+
</picture>
5+
<br>
6+
<h3 align="center">An advanced 3D Gaussian Splatting renderer for THREE.js</h3>
7+
<div align="center">
8+
9+
[Features](#features) -
10+
[Getting Started](#getting-started) -
11+
<a href="https://www.forge.dev/">Documentation</a> -
12+
<a href="https://www.forge.dev/">FAQ</a>
13+
</div>
14+
</p>
15+
16+
<div align="center">
17+
18+
[![License](https://img.shields.io/badge/license-MIT-%23d43e4c)](https://github.com/forge-gfx/forge/blob/main/LICENSE)
19+
[![npm version](https://img.shields.io/npm/v/forge?color=d43e4c)](https://www.npmjs.com/package/forge)
20+
21+
</div>
22+
23+
<p>
24+
<a href="https://www.forge.dev" target="_blank">
25+
<picture>
26+
</picture>
27+
</a>
28+
29+
## Features
30+
31+
- Load multiple splats files simultaneously ([demo]())
32+
- Combine and composite splats with regular Meshes ([demo]())
33+
- Animation ([demo]())
34+
- Real Time Visual Effects ([demo]())
35+
- Multiple Camera Views ([demo]())
36+
- Procedurally generated splats ([demo]())
37+
38+
Check out all the [examples]()
39+
40+
## Getting Started
41+
42+
### Copy code
43+
44+
Copy code below in an `index.html` file.
45+
46+
```html
47+
<style> body {margin: 0;} </style>
48+
<script type="importmap">
49+
{
50+
"imports": {
51+
"three": "/node_modules/three/build/three.module.js",
52+
"@forge-gfx/forge": "/dist/forge.module.js"
53+
}
54+
}
55+
</script>
56+
<script type="module">
57+
import * as THREE from "three";
58+
import { SplatMesh } from "@forge-gfx/forge";
59+
60+
const scene = new THREE.Scene();
61+
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
62+
const renderer = new THREE.WebGLRenderer();
63+
renderer.setSize(window.innerWidth, window.innerHeight);
64+
document.body.appendChild(renderer.domElement)
65+
66+
const butterfly = new SplatMesh({ url: "../assets/basic/butterfly.wlg"});
67+
butterfly.quaternion.set(1, 0, 0, 0);
68+
butterfly.position.set(0, 0, -1);
69+
scene.add(butterfly);
70+
71+
renderer.setAnimationLoop(function animate(time) {
72+
renderer.render(scene, camera);
73+
butterfly.rotation.y += 0.01;
74+
});
75+
</script>
76+
```
77+
78+
### Web Editor
79+
80+
Remix the [glitch starter template](https://glitch.com/edit/#!/forge-dev)
81+
82+
### Usage from CDN
83+
84+
```html
85+
<script type="importmap">
86+
{
87+
"imports": {
88+
"three": "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.174.0/three.module.js",
89+
"forge": "cdn/url/to/forge.module.js"
90+
}
91+
}
92+
</script>
93+
```
94+
95+
### Install with NPM
96+
97+
```shell
98+
npm install forge-dev
99+
```
100+
101+
## Develop and contribute to the project
102+
103+
The examples fetch the assets from an external URL. To work offline is possible to downloading the assets files locally with the following command:
104+
105+
```
106+
npm run assets:download
107+
```
108+
109+
Install [Rust](https://www.rust-lang.org/tools/install) if it's not already installed in your machine.
110+
111+
Next, build Forge by running:
112+
```
113+
npm install
114+
npm run build
115+
```
116+
This will first build the Rust Wasm component (can be invoked via `npm run build:wasm`), then Forge itself (`npm run build`).
117+
118+
Once you've fetched the data and built Forge, you can run run the examples:
119+
```
120+
npm run dev
121+
```
122+
This will run a dev server by default at [http://localhost:8080/](http://localhost:8080/). Check the console log output to see if yours is served on a different port.
123+
124+
## Build troubleshooting
125+
126+
First try cleaning all the build files and re-building everything:
127+
```
128+
npm run clean
129+
npm install
130+
npm run build
131+
```
132+
133+
There's no versioning system for assets. If you need to re-download a specific file you can delete that asset file individually or download all assets from scratch:
134+
135+
```
136+
npm run assets:clean
137+
npm run assets:download
138+
```
139+
140+
## Ignore dist directory during development
141+
142+
To ignore the dist directory and prevent accidental commits and merge conflicts
143+
144+
```
145+
git update-index --assume-unchanged dist/*
146+
```
147+
148+
To revert and be able to commit into to the dist directory again:
149+
150+
```
151+
git update-index --no-assume-unchanged dist/*
152+
```
153+
154+
To liste ignored files in case of need to troubleshoot
155+
156+
```
157+
git ls-files -v | grep '^[a-z]' | cut -c3-
158+
```
159+
160+
## Build docs
161+
162+
Install [Mkdocs Material](https://squidfunk.github.io/mkdocs-material/)
163+
164+
```
165+
pip install mkdocs-material
166+
```
167+
168+
If you hit an `externally managed environment` error on macOS and if you installed python via `brew` try:
169+
170+
```
171+
brew install mkdocs-material
172+
```
173+
174+
Edit markdown in `/docs` directory
175+
176+
```
177+
mkdocs serve
178+
```
179+
180+
## Build Forge website
181+
182+
Build the static site and docs in a `site` directory.
183+
184+
```
185+
npm run site:build
186+
```
187+
188+
You can run any static server in the `site` directory but for convenience you can run
189+
190+
```
191+
npm run site:serve
192+
```
193+
194+
## Deploy Forge website
195+
196+
TO-DO

biome.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"vcs": {
4+
"enabled": false,
5+
"clientKind": "git",
6+
"useIgnoreFile": false
7+
},
8+
"files": {
9+
"ignoreUnknown": false,
10+
"ignore": [
11+
"dist/*",
12+
"examples/showcase/hello-gsplat",
13+
"rust/target",
14+
"rust/forge-internal-rs/pkg",
15+
"src/vrButton.ts",
16+
"site"
17+
]
18+
},
19+
"formatter": {
20+
"enabled": true,
21+
"indentStyle": "space",
22+
"lineEnding": "lf"
23+
},
24+
"organizeImports": {
25+
"enabled": true
26+
},
27+
"linter": {
28+
"enabled": true,
29+
"rules": {
30+
"recommended": true
31+
}
32+
},
33+
"javascript": {
34+
"formatter": {
35+
"quoteStyle": "double"
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)