Skip to content

Commit d98b011

Browse files
committed
Update 4.5.7
1 parent 5d7b603 commit d98b011

File tree

11 files changed

+365
-299
lines changed

11 files changed

+365
-299
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
**Export Meshes**
4343
- Bake voxels to editable meshes
4444
- Bake voxels by color groups
45-
- Unbake exported GLB to voxels
45+
- Unbake exported GLB back to voxels
4646
- glTF compatible editor
4747

4848
**Extensibility**
@@ -52,7 +52,7 @@
5252
- Blender importer script
5353

5454
**More**
55-
- Average startup time 300 ms
55+
- Average startup time 300 ms *(after the first launch)*
5656
- Unique handcrafted user-interface
5757
- Minimum dependency, portable, online and offline
5858
- Ad-free, no trackers, no logging, no loading screens
@@ -141,8 +141,9 @@ git reset --hard $HASH
141141

142142
## History
143143
```
144+
↑ Unsafe WebGPU support
144145
↑ Core initialization
145-
↑ Rendering was left to three and three-gpu-pathtracer
146+
↑ Rendering was left to Three and three-gpu-pathtracer
146147
↑ ES6 (the original index.html playground was moved)
147148
↑ x1.5 faster startup (2s to 300ms)
148149
↑ Migrating to Linux: Firefox ready

media/screenshot.png

-27 KB
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "voxel-builder",
3-
"version": "4.5.6",
3+
"version": "4.5.7",
44
"description": "Voxel-based 3D modeling application",
55
"main": "electron.js",
66
"scripts": {

src/assets/appicon.png

344 Bytes
Loading

src/index.html

Lines changed: 27 additions & 24 deletions
Large diffs are not rendered by default.

src/main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ import * as CORE from './modules/core.js';
1111

1212

1313
const startTime = performance.now();
14+
const adapter = navigator.gpu && await navigator.gpu.requestAdapter();
1415

1516

16-
engine.init().then(eng => {
17+
CORE.preferences.init(adapter);
1718

18-
CORE.preferences.init();
19+
engine.init(CORE.preferences.isWebGPU()).then(eng => {
1920

2021
CORE.mainScene.create(eng).then(scn => {
2122

@@ -25,6 +26,7 @@ engine.init().then(eng => {
2526
CORE.light.init();
2627
CORE.material.init();
2728

29+
CORE.vMesh.init();
2830
CORE.builder.init();
2931
CORE.xformer.init();
3032

src/manifest.webmanifest

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

src/modules/babylon.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ class Engine {
1414
this.isRendering = false;
1515
}
1616

17-
init() {
17+
init(useWebGPU) {
18+
if (useWebGPU)
19+
return this.initWebGPU();
20+
1821
return new Promise(resolve => {
1922
this.engine = new BABYLON.Engine(this.canvas, true, {});
2023
this.engine.disablePerformanceMonitorInBackground = true;
@@ -27,6 +30,21 @@ class Engine {
2730
});
2831
}
2932

33+
initWebGPU() {
34+
return new Promise(async resolve => {
35+
this.engine = new BABYLON.WebGPUEngine(this.canvas);
36+
this.engine.disablePerformanceMonitorInBackground = true;
37+
this.engine.preserveDrawingBuffer = false;
38+
this.engine.premultipliedAlpha = true;
39+
this.engine.enableOfflineSupport = false;
40+
this.engine.doNotHandleContextLost = true;
41+
42+
await this.engine.initAsync();
43+
44+
resolve(this.engine);
45+
});
46+
}
47+
3048
getFps() {
3149
return ~~this.engine.getFps();
3250
}

0 commit comments

Comments
 (0)