From 278647b551354d6c51dff51849ad7adacfdde028 Mon Sep 17 00:00:00 2001
From: nimadez <111365948+nimadez@users.noreply.github.com>
Date: Wed, 28 Aug 2024 14:42:35 +0330
Subject: [PATCH] Update 4.3.5
---
CHANGELOG.md | 15 +
README.md | 21 +-
electron.js | 3 +
index.html | 123 +++---
libs/addons/WorkerPool.js | 102 +++++
package.json | 2 +-
scripts/blender-importer.py | 8 +-
scripts/ws-connect.py | 88 +++--
server.js | 48 +++
src/main.js | 429 ++++++++++++---------
src/modules/bakery/{baker.js => bakery.js} | 2 +-
src/modules/loaders/magicavoxel.js | 2 +-
src/modules/modules.js | 15 +-
src/modules/pathtracer/pathtracer.js | 107 +++--
src/modules/raycaster/raycaster.js | 12 -
src/modules/three.js | 37 +-
src/modules/worker/processor.js | 54 ---
src/modules/worker/worker.js | 104 +++--
18 files changed, 664 insertions(+), 508 deletions(-)
create mode 100644 libs/addons/WorkerPool.js
mode change 100755 => 100644 scripts/ws-connect.py
create mode 100644 server.js
rename src/modules/bakery/{baker.js => bakery.js} (98%)
delete mode 100644 src/modules/worker/processor.js
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fd4c6479..8d86b7f7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,20 @@
All notable changes to this project will be documented in this file.
+## 4.3.5
+- ~~Update to babylonjs 7.22.3~~
+ - The update was rolled back, serious bug (no mouseover on Z axis)
+- New detachable floating panels!
+- Review and improve menus (faster and more managable)
+- Improve websockets client and server
+- Standalone node.js server (Electron alternative)
+- Improve three.js module (less memory, faster load time)
+- Fix camera-related visual artifacts (fov 0.1 issue)
+- Improve modules and pathtracer code
+- Add three.js WorkerPool library (more stable)
+
+> - You shouldn't notice a change unless you move the panel
+> - The left button moves the panel, the center button hides the panel and the right button resets the panel to its original position and close it.
+
## 4.3.4 x1.5
- Faster startup time (avg. 2s to 0.5s - x1.5 faster)
- Change default PT material to lambert
diff --git a/README.md b/README.md
index 04f12a3d..8f954376 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
Voxel-based 3D modeling application
[https://nimadez.github.io/voxel-builder/](https://nimadez.github.io/voxel-builder/)
-```Version 4.3.4 Beta```
+```Version 4.3.5 Beta```
[Changelog](https://github.com/nimadez/voxel-builder/blob/main/CHANGELOG.md)
[Installation](https://github.com/nimadez/voxel-builder#installation)
@@ -50,12 +50,13 @@ Voxel-based 3D modeling application
- Blender importer script
**More**
+- Unique handcrafted user-interface woven into the code
- Minimum dependency, portable, online and offline
- Ad-free, no miners and trackers, no logging
- Extras [?](https://github.com/nimadez/voxel-builder/wiki/Extras)
## Installation
-Install [Electron](https://github.com/electron/electron/releases) for Linux or Windows
+Install [Electron](https://github.com/electron/electron/releases) for Linux or Windows *(optional)*
```
electron-v*-linux-x64.zip
electron-v*-win32-x64.zip
@@ -64,7 +65,12 @@ Get and run Voxel Builder
```
git clone https://github.com/nimadez/voxel-builder.git
cd voxel-builder
+
+# Start with Electron:
electron .
+
+# Start with Node.js:
+node server.js
```
Update to the latest version
```
@@ -98,17 +104,10 @@ Failed to import GLB meshes for voxelization
Multiple meshes need to have the same properties or they won't merge,
the only solution is to merge meshes before exporting to GLB.
```
-Visual artifacts and Moire patterns
-```
-These are related to thin-instances and nothing special can be done at this time.
-Reproduce: set camera FOV to 0.1 and press F to fit camera
-(but usually you don't need that FOV, use orthographic mode)
-```
Wacom tablet crashes randomly and throws warning on Linux (GNOME)
```
Warning: BJS - Max number of touches exceeded. Ignoring touches in excess of 2.
-This is a Babylon.js and Wayland issue that needs to be fixed.
-(wayland uses multiple pointers, one for each input device)
+This problem is related to Babylon.js and nothing can be done.
```
## FAQ
@@ -141,6 +140,8 @@ How to run Blender importer script?
↑ Features and uix overhaul
↑ New SPS particles to build the world
↑ I wrote a playground for learning Babylon.js
+
+"I don't mean to compete, GL is nostalgic for me."
```
Version 3.0.0 *(BJS 4)* to 4.2.2 *(BJS 6)*
diff --git a/electron.js b/electron.js
index 58f26391..276e9336 100644
--- a/electron.js
+++ b/electron.js
@@ -1,3 +1,6 @@
+// Aug 2019 https://nimadez.github.io/
+// Voxel Builder Electron
+
if (!require('electron').app.requestSingleInstanceLock())
require('electron').app.exit(0);
diff --git a/index.html b/index.html
index 9d283daf..25be80a1 100644
--- a/index.html
+++ b/index.html
@@ -40,7 +40,7 @@
--cat-bg: #282d38;
--cat-color: #636f85;
--cat-border: #3e485caa;
- --menu-bg: #2c323fdd;
+ --menu-bg: #2c323fee;
--confirm: #222731ee;
--borders: #161a2050;
--white: #97a5b8;
@@ -82,15 +82,15 @@
#loadingscreen .logo { color: orange; font-family: var(--font); font-size: 24px; letter-spacing: 0.08em; width: 200px; height: 24px; position: absolute; left: 50%; top: 50%; margin-left: -100px; margin-top: -12px; text-align: center; }
#loadingscreen .logo :first-child { font-weight: normal; color: var(--white); }
#loadingscreen .progress { animation: progress 8s infinite; background: orange; width: 0; max-width: 200px; height: 1px; left: 50%; top: 50%; margin-left: -100px; margin-top: -10px; position: fixed; text-align: center; }
- #canvas_render { z-index: 0; image-rendering: pixelated; position: absolute; width: 100%; height: 100%; background: linear-gradient(180deg, #434b5c 0%, #313544 100%); }
- #canvas_palette { z-index: 1; image-rendering: pixelated; position: relative; width: 100%; height: 32000px; }
- #canvas_pt { image-rendering: pixelated; width: 100%; height: 100%; cursor: cell;
+ #canvas { z-index: 0; image-rendering: pixelated; position: absolute; width: 100%; height: 100%; background: linear-gradient(180deg, #434b5c 0%, #313544 100%); }
+ #canvas_render { image-rendering: pixelated; width: 100%; height: 100%; cursor: cell;
background-color: #363d46;
background-image: linear-gradient(45deg, #30373d 25%, transparent 20%), linear-gradient(-45deg, #30373d 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #30373d 75%), linear-gradient(-45deg, transparent 75%, #30373d 75%);
background-size: 38px 38px; background-position: 0 0, 0 19px, 19px -19px, -19px 0; }
+ #canvas_palette { z-index: 1; image-rendering: pixelated; position: relative; width: 100%; height: 32000px; }
#menus { display: none; }
- .menu_R { z-index: 500; background: var(--menu-bg); position: absolute; top: 0; right: 0; padding: 0 4px 4px 4px; transition: all 60ms; width: 120px; height: fit-content; margin-right: -200px; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; }
+ .menu_R { z-index: 1000; display: none; background: var(--menu-bg); position: absolute; top: 0; right: 275px; padding: 0 4px 4px 4px; width: 120px; height: fit-content; margin-right: -200px; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; }
.menu_R li { background: none; text-align: left; border: none; padding: 0; cursor: default; }
.menu_R li:hover { background: none; }
.menu_R li div.flex { display: flex; }
@@ -99,10 +99,9 @@
.menu_R .category { color: var(--cat-color); background: var(--cat-bg); border: solid 1px var(--cat-border); font-size: 10px; letter-spacing: 0.08em; text-shadow: 1px 1px 0 #222; text-align: center; margin: 3px 0 3px 0; padding: 3px 0 2px 0; border-radius: 4px; }
.menu_R .category:hover { color: var(--cat-color); background: var(--cat-bg); cursor: default; }
.menu_R :first-child { cursor: pointer; }
- .menu_R :first-child span { color: var(--cat-color); letter-spacing: 0.08em; font-size: 10px; vertical-align: -2px; }
- .menu_R li i:first-child { color: var(--cat-color); margin-top: 3px; }
- .menu_R li:hover i:first-child { color: steelblue; }
- .menu_L { z-index: 500; background: var(--menu-bg); position: absolute; top: 0; left: 0; padding: 0 4px 4px 4px; transition: all 60ms; width: 120px; height: fit-content; margin-left: -200px; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; }
+ .menu_R li div i { color: var(--cat-color); margin-top: 3px; }
+ .menu_R li div:hover i { color: steelblue; }
+ .menu_L { z-index: 1000; display: none; background: var(--menu-bg); position: absolute; top: 0; left: 275px; padding: 0 4px 4px 4px; width: 120px; height: fit-content; margin-left: -200px; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; }
.menu_L li { background: none; text-align: left; border: none; padding: 0; cursor: default; }
.menu_L li:hover { background: none; }
.menu_L li div.flex { display: flex; }
@@ -111,9 +110,8 @@
.menu_L .category { color: var(--cat-color); background: var(--cat-bg); border: solid 1px var(--cat-border); font-size: 10px; letter-spacing: 0.08em; text-shadow: 1px 1px 0 #222; text-align: center; margin: 3px 0 3px 0; padding: 3px 0 2px 0; border-radius: 4px; }
.menu_L .category:hover { color: var(--cat-color); background: var(--cat-bg); cursor: default; }
.menu_L :first-child { cursor: pointer; }
- .menu_L :first-child span { color: var(--cat-color); letter-spacing: 0.08em; font-size: 10px; vertical-align: -2px; }
- .menu_L li i:first-child { color: var(--cat-color); margin-top: 3px; transform: rotate(180deg); }
- .menu_L li:hover i:first-child { color: steelblue; }
+ .menu_L li div i { color: var(--cat-color); margin-top: 3px; }
+ .menu_L li div:hover i { color: steelblue; }
#toolbar_top { z-index: 500; width: 200px; left: 50%; margin-left: -100px; top: 0; text-align: center; position: fixed; }
#toolbar_C { display: flex; }
#toolbar_C li { color: var(--btn-color); width: 100%; padding: 8px 0 6px 0; letter-spacing: 0.05em; border: 1px var(--borders); border-radius: 0; border-top: none; cursor: pointer; }
@@ -169,7 +167,7 @@
#menu-texture img { object-fit: fill; border: solid 1px #6b798d; width: 24px; height: 21px; margin: -2px 2px 3px 2px; cursor: pointer; }
#menu-storage img { object-fit: contain; background: #2b334190; border: dotted 1px #1e1f24; width: 115px; height: 60px; margin-left: 1px; cursor: pointer; }
#menu-storage li div button { font-size: 11px; letter-spacing: 0.05em; width: 59px; padding: 5px 0 5px 0; }
- #menu-pathtracer li .btn_select_pt { color: steelblue; }
+ #menu-render li .btn_select_pt { color: steelblue; }
#btn-symm-axis-s:hover { background: var(--input-bg); }
#btn-symm-axis-x:hover { background: var(--input-bg); }
#btn-symm-axis-y:hover { background: var(--input-bg); }
@@ -200,6 +198,7 @@
#ws_status { font-size: 11px; color: indianred; }
.spacer { height: 3px; }
.row { display: flex; width: 100%; align-items: center; }
+ .row_panel { display: flex; width: 100%; align-items: center; gap: 11px; text-indent: 6px; }
.material-icons { font-family: 'Material Icons'; font-weight: normal; font-style: normal; font-size: 16px; vertical-align: middle; text-align: center; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr; pointer-events: none; font-feature-settings: 'liga'; -webkit-font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased; }
::placeholder { color: #45515c; }
::-webkit-scrollbar { width: 5px; }
@@ -217,7 +216,7 @@
input[type=color] { height: 18px; }
input[type=color]::-moz-color-swatch { border: none; }
select { text-indent: 2px; }
- #palette { top: 158px; bottom: 178px; scrollbar-color: steelblue transparent; }
+ #palette { top: 158px; bottom: 215px; scrollbar-color: steelblue transparent; }
#bakerylist { top: 158px; scrollbar-color: steelblue transparent; }
#bakerylist .item_name { width: 55px; }
#menu-inscreen-bottom { bottom: 22px; }
@@ -225,35 +224,35 @@