Skip to content

Commit e712093

Browse files
committed
logical nodes / functions / if / var declaration and assignment / Swizzle node / and a bunch of other stuff like... formatting everything with prettier......
1 parent e6b7d26 commit e712093

File tree

114 files changed

+7663
-3382
lines changed

Some content is hidden

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

114 files changed

+7663
-3382
lines changed

.devcontainer/devcontainer.json

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
33
{
4-
"name": "Node.js & TypeScript",
5-
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
7-
"features": {
8-
"ghcr.io/devcontainers-extra/features/pnpm:2": {}
9-
}
4+
"name": "Node.js & TypeScript",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
7+
"features": {
8+
"ghcr.io/devcontainers-extra/features/pnpm:2": {}
9+
},
1010

11-
// Features to add to the dev container. More info: https://containers.dev/features.
12-
// "features": {},
11+
// Features to add to the dev container. More info: https://containers.dev/features.
12+
// "features": {},
1313

14-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
15-
// "forwardPorts": [],
14+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
15+
// "forwardPorts": [],
1616

17-
// Use 'postCreateCommand' to run commands after the container is created.
18-
// "postCreateCommand": "yarn install",
17+
// Use 'postCreateCommand' to run commands after the container is created.
18+
// "postCreateCommand": "yarn install",
1919

20-
// Configure tool-specific properties.
21-
// "customizations": {},
20+
// Configure tool-specific properties.
21+
"customizations": {
22+
"vscode": {
23+
"extensions": ["esbenp.prettier-vscode"]
24+
}
25+
}
2226

23-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
24-
// "remoteUser": "root"
27+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
28+
// "remoteUser": "root"
2529
}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ dist-ssr
2626
_*
2727
/layout*.js
2828
/assets
29-
test*
29+
test*
30+
TODO

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"tabWidth": 4,
3+
"useTabs": false,
4+
"semi": true,
5+
"printWidth": 100
6+
}

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# three.js TSL Visual Node Editor
22

3-
### :rocket: [Launch Editor](https://bandinopla.github.io/three.js-visual-node-editor/) :rocket:
3+
### :rocket: [Launch Editor (Alpha)](https://bandinopla.github.io/three.js-visual-node-editor/) :rocket:
4+
*remember it is in alpha state, errors might occur, check the console and report if you can*
45

5-
[![cover](/public/cover.png)](https://bandinopla.github.io/three.js-visual-node-editor/)
6+
7+
[![cover](/git-cover.png)](https://bandinopla.github.io/three.js-visual-node-editor/)
68

79
## **[!] Work in progress | Alpha state** <br/>
810
Visual node editor, inspired by [Blender's shader editor](https://www.blender.org/), is a tool to visually build [Three.js](https://threejs.org/) materials using [Three.js-Shading-Language](https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language). The socket proximity detection was inspired by [Kennedy Richard](https://x.com/KennedyRichard)'s [Nodezator's node editor](https://x.com/KennedyRichard/status/1823905562192449762)
@@ -23,8 +25,14 @@ You can also fix bugs or improve the code/interface. Just clone and do a pull re
2325
### TSL to Visual Nodes:
2426
- :white_check_mark: UV Channel
2527
- :warning: Preview
26-
- :no_entry: Function
28+
- :warning: Functions
2729
- :warning: Uniform
30+
- Conditional / Logic
31+
- :warning: If
32+
- :warning: Declare & Assign variables
33+
- :no_entry: Ternary
34+
- :no_entry: Loop
35+
- :warning: Swizzle
2836
- NodeMaterial
2937
- :no_entry: fragmentNode
3038
- :no_entry: vertexNode
@@ -85,7 +93,7 @@ You can also fix bugs or improve the code/interface. Just clone and do a pull re
8593

8694

8795
- :white_check_mark: Image texture node
88-
- :white_check_mark: Operators
96+
- :warning: Operators (not fully tested)
8997
- :white_check_mark: add
9098
- :white_check_mark: sub
9199
- :white_check_mark: mul
@@ -109,6 +117,7 @@ You can also fix bugs or improve the code/interface. Just clone and do a pull re
109117
- :white_check_mark: shiftLeft
110118
- :white_check_mark: shiftRight
111119
- Math
120+
- :white_check_mark: mx_noise_float
112121
- :white_check_mark: abs
113122
- :white_check_mark: acos
114123
- :white_check_mark: all
@@ -261,8 +270,4 @@ You can also fix bugs or improve the code/interface. Just clone and do a pull re
261270
- :no_entry: oscSawtooth
262271
- Packing
263272
- :no_entry: directionToColor
264-
- :no_entry: colorToDirection
265-
- Conditional / Logic
266-
- :no_entry: If
267-
- :no_entry: Ternary
268-
- :no_entry: Loop
273+
- :no_entry: colorToDirection

eslint.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// eslint.config.js
2+
import eslintPluginJs from "@eslint/js";
3+
import tseslint from "typescript-eslint";
4+
5+
export default tseslint.config(
6+
eslintPluginJs.configs.recommended,
7+
tseslint.configs.recommended,
8+
{
9+
rules: {
10+
"@typescript-eslint/no-explicit-any": "off",
11+
"@typescript-eslint/no-empty-object-type": "off",
12+
"@typescript-eslint/no-this-alias": "off",
13+
"@typescript-eslint/ban-ts-comment":"off"
14+
},
15+
}
16+
);

git-cover.png

98.4 KB
Loading

index.html

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
<!doctype html>
22
<html lang="en">
3-
<head>
3+
4+
<head>
45
<meta charset="UTF-8" />
56
<link rel="shortcut icon" href="favicon.ico" />
67
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
78
<meta name="twitter:card" content="summary_large_image">
89
<meta name="twitter:site" content="@bandinopla">
910
<meta name="twitter:title" content="Three.js - TSL Visual Node Editor">
10-
<meta property="og:image" content="https://github.com/bandinopla/three.js-visual-node-editor/raw/main/public/cover.png">
11+
<meta property="og:image"
12+
content="https://github.com/bandinopla/three.js-visual-node-editor/raw/main/public/cover.png">
1113
<title>Three.js - TSL Visual Node Editor </title>
1214
<style>
13-
html, body {
14-
padding: 0px;
15-
margin: 0px;
16-
overflow: hidden;
15+
html,
16+
body {
17+
padding: 0px;
18+
margin: 0px;
19+
overflow: hidden;
1720
}
18-
canvas {
21+
22+
canvas {
1923
border: 0px;
2024
position: absolute;
21-
top:0px;
25+
top: 0px;
2226
left: 0px;
2327
}
28+
2429
.controls {
2530
position: fixed;
2631
bottom: 10px;
@@ -30,10 +35,18 @@
3035
z-index: 99;
3136
}
3237
</style>
33-
</head>
34-
<body>
35-
<div class="controls"><strong>ALPHA RELEASE v%APP_VERSION%</strong> | MMB: Click and drag to pan | DOUBLE CLICK: add new node | SHIFT+A : open | SHIFT+S : save | <a href="https://github.com/bandinopla/three.js-visual-node-editor" target="_blank">Github Page</a></div>
38+
</head>
39+
40+
<body>
41+
<div style="position: fixed; top:0px; left:0px; right:0px; z-index: 999; background-color: darkblue; color:white">
42+
Work in progress (check console for errors, some might require reload...). <a
43+
href="https://github.com/bandinopla/three.js-visual-node-editor/issues" target="_blank">Report errors
44+
here</a></div>
45+
<div class="controls"><strong>ALPHA RELEASE v%APP_VERSION%</strong> | MMB: Click and drag to pan | DOUBLE CLICK: add
46+
new node | SHIFT+A : open | SHIFT+S : save | <a href="https://github.com/bandinopla/three.js-visual-node-editor"
47+
target="_blank">Github Page</a></div>
3648
<canvas id="app" width="1024" height="1024"></canvas>
3749
<script type="module" src="/src/main.ts"></script>
38-
</body>
39-
</html>
50+
</body>
51+
52+
</html>

package.json

Lines changed: 52 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,54 @@
11
{
2-
"name": "tsl-nodes",
3-
"private": true,
4-
"version": "0.0.5",
5-
"type": "module",
6-
"repository": {
7-
"type": "git",
8-
"url": "hhttps://github.com/bandinopla/three.js-visual-node-editor"
9-
},
10-
"bugs": {
11-
"url": "https://github.com/bandinopla/three.js-visual-node-editor/issues"
12-
},
13-
"author": "bandinopla",
14-
"license": "MIT",
15-
16-
"scripts": {
17-
"dev": "vite",
18-
"build": "tsc && vite build",
19-
"preview": "vite preview"
20-
},
21-
"keywords": [
22-
"three",
23-
"three.js",
24-
"javascript",
25-
"typescript",
26-
"3d",
27-
"nodes",
28-
"shader",
29-
"shader-editor",
30-
"webgl",
31-
"webgl2",
32-
"webgpu",
33-
"webxr",
34-
"canvas",
35-
"svg",
36-
"html5"
37-
],
38-
"devDependencies": {
39-
"typescript": "~5.7.2",
40-
"vite": "^6.2.0"
41-
},
42-
"dependencies": {
43-
"@types/three": "^0.174.0",
44-
"three": "^0.174.0"
45-
}
2+
"name": "tsl-visual-nodes-editor",
3+
"private": true,
4+
"version": "0.0.6",
5+
"type": "module",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/bandinopla/three.js-visual-node-editor"
9+
},
10+
"bugs": {
11+
"url": "https://github.com/bandinopla/three.js-visual-node-editor/issues"
12+
},
13+
"author": "bandinopla",
14+
"license": "MIT",
15+
"scripts": {
16+
"dev": "vite",
17+
"build": "tsc && vite build",
18+
"preview": "vite preview",
19+
"lint": "eslint src --ext .ts,.tsx",
20+
"format": "prettier --write src"
21+
},
22+
"keywords": [
23+
"three",
24+
"three.js",
25+
"javascript",
26+
"typescript",
27+
"3d",
28+
"nodes",
29+
"shader",
30+
"shader-editor",
31+
"webgl",
32+
"webgl2",
33+
"webgpu",
34+
"webxr",
35+
"canvas",
36+
"svg",
37+
"html5"
38+
],
39+
"devDependencies": {
40+
"@eslint/js": "^9.24.0",
41+
"@typescript-eslint/eslint-plugin": "^8.29.1",
42+
"@typescript-eslint/parser": "^8.29.1",
43+
"eslint": "^9.24.0",
44+
"eslint-config-prettier": "^10.1.2",
45+
"prettier": "^3.5.3",
46+
"typescript": "~5.7.2",
47+
"typescript-eslint": "^8.29.1",
48+
"vite": "^6.2.0"
49+
},
50+
"dependencies": {
51+
"@types/three": "^0.174.0",
52+
"three": "^0.174.0"
53+
}
4654
}

0 commit comments

Comments
 (0)