@poolzin/pool-bot 2026.1.37 → 2026.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -98
- package/dist/agents/tools/memory-tool.js +1 -2
- package/dist/agents/workspace.js +1 -5
- package/dist/build-info.json +3 -3
- package/dist/channels/plugins/agent-tools/whatsapp-login.js +1 -17
- package/dist/commands/doctor-state-integrity.js +2 -14
- package/dist/config/types.js +0 -1
- package/dist/config/zod-schema.js +0 -6
- package/dist/discord/monitor/message-handler.process.js +6 -4
- package/dist/gateway/client.js +0 -14
- package/dist/gateway/server.impl.js +0 -4
- package/dist/memory/index.js +0 -5
- package/dist/memory/manager.js +2 -25
- package/dist/slack/monitor/message-handler/prepare.js +10 -4
- package/dist/slack/monitor/slash.js +10 -4
- package/extensions/memory-core/package.json +0 -3
- package/package.json +3 -2
- package/skills/webgpu-threejs-tsl/REFERENCE.md +0 -283
- package/skills/webgpu-threejs-tsl/SKILL.md +0 -91
- package/skills/webgpu-threejs-tsl/docs/compute-shaders.md +0 -404
- package/skills/webgpu-threejs-tsl/docs/core-concepts.md +0 -453
- package/skills/webgpu-threejs-tsl/docs/materials.md +0 -353
- package/skills/webgpu-threejs-tsl/docs/post-processing.md +0 -434
- package/skills/webgpu-threejs-tsl/docs/wgsl-integration.md +0 -324
- package/skills/webgpu-threejs-tsl/examples/basic-setup.js +0 -87
- package/skills/webgpu-threejs-tsl/examples/custom-material.js +0 -170
- package/skills/webgpu-threejs-tsl/examples/earth-shader.js +0 -292
- package/skills/webgpu-threejs-tsl/examples/particle-system.js +0 -259
- package/skills/webgpu-threejs-tsl/examples/post-processing.js +0 -199
- package/skills/webgpu-threejs-tsl/templates/compute-shader.js +0 -305
- package/skills/webgpu-threejs-tsl/templates/webgpu-project.js +0 -276
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
# TSL Quick Reference
|
|
2
|
-
|
|
3
|
-
## Imports
|
|
4
|
-
|
|
5
|
-
```javascript
|
|
6
|
-
// WebGPU Three.js
|
|
7
|
-
import * as THREE from 'three/webgpu';
|
|
8
|
-
|
|
9
|
-
// Core TSL
|
|
10
|
-
import {
|
|
11
|
-
float, int, uint, bool,
|
|
12
|
-
vec2, vec3, vec4, color,
|
|
13
|
-
mat2, mat3, mat4,
|
|
14
|
-
uniform, texture, uv,
|
|
15
|
-
Fn, If, Loop, Break, Continue,
|
|
16
|
-
time, deltaTime
|
|
17
|
-
} from 'three/tsl';
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Types
|
|
21
|
-
|
|
22
|
-
| TSL | WGSL | Example |
|
|
23
|
-
|-----|------|---------|
|
|
24
|
-
| `float(1.0)` | `f32` | Scalar float |
|
|
25
|
-
| `int(1)` | `i32` | Signed integer |
|
|
26
|
-
| `uint(1)` | `u32` | Unsigned integer |
|
|
27
|
-
| `bool(true)` | `bool` | Boolean |
|
|
28
|
-
| `vec2(x, y)` | `vec2<f32>` | 2D vector |
|
|
29
|
-
| `vec3(x, y, z)` | `vec3<f32>` | 3D vector |
|
|
30
|
-
| `vec4(x, y, z, w)` | `vec4<f32>` | 4D vector |
|
|
31
|
-
| `color(0xff0000)` | `vec3<f32>` | RGB color |
|
|
32
|
-
| `uniform(value)` | uniform | Dynamic value |
|
|
33
|
-
|
|
34
|
-
## Operators
|
|
35
|
-
|
|
36
|
-
| Operation | TSL | GLSL Equivalent |
|
|
37
|
-
|-----------|-----|-----------------|
|
|
38
|
-
| Add | `a.add(b)` | `a + b` |
|
|
39
|
-
| Subtract | `a.sub(b)` | `a - b` |
|
|
40
|
-
| Multiply | `a.mul(b)` | `a * b` |
|
|
41
|
-
| Divide | `a.div(b)` | `a / b` |
|
|
42
|
-
| Modulo | `a.mod(b)` | `mod(a, b)` |
|
|
43
|
-
| Negate | `a.negate()` | `-a` |
|
|
44
|
-
| Less Than | `a.lessThan(b)` | `a < b` |
|
|
45
|
-
| Greater Than | `a.greaterThan(b)` | `a > b` |
|
|
46
|
-
| Equal | `a.equal(b)` | `a == b` |
|
|
47
|
-
| And | `a.and(b)` | `a && b` |
|
|
48
|
-
| Or | `a.or(b)` | `a \|\| b` |
|
|
49
|
-
| Assign | `a.assign(b)` | `a = b` |
|
|
50
|
-
| Add Assign | `a.addAssign(b)` | `a += b` |
|
|
51
|
-
|
|
52
|
-
## Swizzling
|
|
53
|
-
|
|
54
|
-
```javascript
|
|
55
|
-
const v = vec3(1, 2, 3);
|
|
56
|
-
v.x // 1
|
|
57
|
-
v.xy // vec2(1, 2)
|
|
58
|
-
v.zyx // vec3(3, 2, 1)
|
|
59
|
-
v.rgb // same as xyz
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Math Functions
|
|
63
|
-
|
|
64
|
-
| Function | Description |
|
|
65
|
-
|----------|-------------|
|
|
66
|
-
| `abs(x)` | Absolute value |
|
|
67
|
-
| `sign(x)` | Sign (-1, 0, 1) |
|
|
68
|
-
| `floor(x)` | Round down |
|
|
69
|
-
| `ceil(x)` | Round up |
|
|
70
|
-
| `fract(x)` | Fractional part |
|
|
71
|
-
| `min(a, b)` | Minimum |
|
|
72
|
-
| `max(a, b)` | Maximum |
|
|
73
|
-
| `clamp(x, lo, hi)` | Clamp to range |
|
|
74
|
-
| `mix(a, b, t)` | Linear interpolation |
|
|
75
|
-
| `step(edge, x)` | Step function |
|
|
76
|
-
| `smoothstep(a, b, x)` | Smooth step |
|
|
77
|
-
| `sin(x)`, `cos(x)` | Trigonometry |
|
|
78
|
-
| `pow(x, y)` | Power |
|
|
79
|
-
| `sqrt(x)` | Square root |
|
|
80
|
-
| `length(v)` | Vector length |
|
|
81
|
-
| `distance(a, b)` | Distance |
|
|
82
|
-
| `dot(a, b)` | Dot product |
|
|
83
|
-
| `cross(a, b)` | Cross product |
|
|
84
|
-
| `normalize(v)` | Unit vector |
|
|
85
|
-
| `reflect(i, n)` | Reflection |
|
|
86
|
-
|
|
87
|
-
## Geometry Nodes
|
|
88
|
-
|
|
89
|
-
| Node | Description |
|
|
90
|
-
|------|-------------|
|
|
91
|
-
| `positionLocal` | Model space position |
|
|
92
|
-
| `positionWorld` | World space position |
|
|
93
|
-
| `positionView` | Camera space position |
|
|
94
|
-
| `normalLocal` | Model space normal |
|
|
95
|
-
| `normalWorld` | World space normal |
|
|
96
|
-
| `normalView` | Camera space normal |
|
|
97
|
-
| `uv()` | UV coordinates |
|
|
98
|
-
| `uv(1)` | Secondary UVs |
|
|
99
|
-
| `tangentLocal` | Tangent vector |
|
|
100
|
-
| `vertexColor()` | Vertex colors |
|
|
101
|
-
|
|
102
|
-
## Camera Nodes
|
|
103
|
-
|
|
104
|
-
| Node | Description |
|
|
105
|
-
|------|-------------|
|
|
106
|
-
| `cameraPosition` | Camera world position |
|
|
107
|
-
| `cameraNear` | Near plane |
|
|
108
|
-
| `cameraFar` | Far plane |
|
|
109
|
-
| `cameraViewMatrix` | View matrix |
|
|
110
|
-
| `cameraProjectionMatrix` | Projection matrix |
|
|
111
|
-
| `screenUV` | Screen UV (0-1) |
|
|
112
|
-
| `screenSize` | Screen dimensions |
|
|
113
|
-
|
|
114
|
-
## Time
|
|
115
|
-
|
|
116
|
-
| Node | Description |
|
|
117
|
-
|------|-------------|
|
|
118
|
-
| `time` | Seconds since start |
|
|
119
|
-
| `deltaTime` | Frame delta |
|
|
120
|
-
| `oscSine(t)` | Sine wave (0-1) |
|
|
121
|
-
| `oscSquare(t)` | Square wave |
|
|
122
|
-
| `oscTriangle(t)` | Triangle wave |
|
|
123
|
-
| `oscSawtooth(t)` | Sawtooth wave |
|
|
124
|
-
|
|
125
|
-
## Material Properties
|
|
126
|
-
|
|
127
|
-
```javascript
|
|
128
|
-
const mat = new THREE.MeshStandardNodeMaterial();
|
|
129
|
-
|
|
130
|
-
// Basic
|
|
131
|
-
mat.colorNode = color(0xff0000);
|
|
132
|
-
mat.opacityNode = float(0.8);
|
|
133
|
-
mat.alphaTestNode = float(0.5);
|
|
134
|
-
|
|
135
|
-
// PBR
|
|
136
|
-
mat.roughnessNode = float(0.5);
|
|
137
|
-
mat.metalnessNode = float(0.0);
|
|
138
|
-
mat.emissiveNode = color(0x000000);
|
|
139
|
-
mat.normalNode = normalMap(tex);
|
|
140
|
-
|
|
141
|
-
// Physical (MeshPhysicalNodeMaterial)
|
|
142
|
-
mat.clearcoatNode = float(1.0);
|
|
143
|
-
mat.transmissionNode = float(0.9);
|
|
144
|
-
mat.iridescenceNode = float(1.0);
|
|
145
|
-
mat.sheenNode = float(1.0);
|
|
146
|
-
|
|
147
|
-
// Vertex
|
|
148
|
-
mat.positionNode = displaced;
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## Control Flow
|
|
152
|
-
|
|
153
|
-
```javascript
|
|
154
|
-
// If-Else
|
|
155
|
-
If(condition, () => {
|
|
156
|
-
// true
|
|
157
|
-
}).ElseIf(other, () => {
|
|
158
|
-
// other true
|
|
159
|
-
}).Else(() => {
|
|
160
|
-
// false
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
// Select (ternary)
|
|
164
|
-
const result = select(condition, trueVal, falseVal);
|
|
165
|
-
|
|
166
|
-
// Loop
|
|
167
|
-
Loop(10, ({ i }) => {
|
|
168
|
-
// i = 0 to 9
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
// Loop control
|
|
172
|
-
Break();
|
|
173
|
-
Continue();
|
|
174
|
-
Discard(); // Fragment only
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
## Custom Functions
|
|
178
|
-
|
|
179
|
-
```javascript
|
|
180
|
-
// Basic function
|
|
181
|
-
const myFn = Fn(([a, b]) => {
|
|
182
|
-
return a.add(b);
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
// With defaults
|
|
186
|
-
const myFn = Fn(([a = 1.0, b = 2.0]) => {
|
|
187
|
-
return a.add(b);
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
// Usage
|
|
191
|
-
myFn(x, y);
|
|
192
|
-
myFn(); // uses defaults
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
## Compute Shaders
|
|
196
|
-
|
|
197
|
-
```javascript
|
|
198
|
-
// Storage buffers
|
|
199
|
-
const positions = instancedArray(count, 'vec3');
|
|
200
|
-
const values = instancedArray(count, 'float');
|
|
201
|
-
|
|
202
|
-
// Compute shader
|
|
203
|
-
const compute = Fn(() => {
|
|
204
|
-
const pos = positions.element(instanceIndex);
|
|
205
|
-
pos.addAssign(vec3(0.01, 0, 0));
|
|
206
|
-
})().compute(count);
|
|
207
|
-
|
|
208
|
-
// Execute
|
|
209
|
-
await renderer.computeAsync(compute); // Once
|
|
210
|
-
renderer.compute(compute); // Each frame
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
## Post-Processing
|
|
214
|
-
|
|
215
|
-
```javascript
|
|
216
|
-
import { pass } from 'three/tsl';
|
|
217
|
-
import { bloom } from 'three/addons/tsl/display/BloomNode.js';
|
|
218
|
-
|
|
219
|
-
// Setup
|
|
220
|
-
const postProcessing = new THREE.PostProcessing(renderer);
|
|
221
|
-
const scenePass = pass(scene, camera);
|
|
222
|
-
const color = scenePass.getTextureNode('output');
|
|
223
|
-
|
|
224
|
-
// Apply effects
|
|
225
|
-
const bloomPass = bloom(color);
|
|
226
|
-
postProcessing.outputNode = color.add(bloomPass);
|
|
227
|
-
|
|
228
|
-
// Render
|
|
229
|
-
postProcessing.render();
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
## Common Patterns
|
|
233
|
-
|
|
234
|
-
### Fresnel
|
|
235
|
-
|
|
236
|
-
```javascript
|
|
237
|
-
const viewDir = cameraPosition.sub(positionWorld).normalize();
|
|
238
|
-
const fresnel = float(1).sub(normalWorld.dot(viewDir).saturate()).pow(3);
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
### Animated UV
|
|
242
|
-
|
|
243
|
-
```javascript
|
|
244
|
-
const animUV = uv().add(vec2(time.mul(0.1), 0));
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
### Noise Hash
|
|
248
|
-
|
|
249
|
-
```javascript
|
|
250
|
-
const noise = fract(position.dot(vec3(12.9898, 78.233, 45.543)).sin().mul(43758.5453));
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
### Dissolve
|
|
254
|
-
|
|
255
|
-
```javascript
|
|
256
|
-
const noise = hash(positionLocal.mul(50));
|
|
257
|
-
If(noise.lessThan(threshold), () => Discard());
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
### Color Gradient
|
|
261
|
-
|
|
262
|
-
```javascript
|
|
263
|
-
const gradient = mix(colorA, colorB, positionLocal.y.mul(0.5).add(0.5));
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
## Node Materials
|
|
267
|
-
|
|
268
|
-
| Material | Use Case |
|
|
269
|
-
|----------|----------|
|
|
270
|
-
| `MeshBasicNodeMaterial` | Unlit |
|
|
271
|
-
| `MeshStandardNodeMaterial` | PBR |
|
|
272
|
-
| `MeshPhysicalNodeMaterial` | Advanced PBR |
|
|
273
|
-
| `MeshPhongNodeMaterial` | Phong shading |
|
|
274
|
-
| `MeshToonNodeMaterial` | Cel shading |
|
|
275
|
-
| `PointsNodeMaterial` | Point clouds |
|
|
276
|
-
| `LineBasicNodeMaterial` | Lines |
|
|
277
|
-
| `SpriteNodeMaterial` | Sprites |
|
|
278
|
-
|
|
279
|
-
## Resources
|
|
280
|
-
|
|
281
|
-
- [TSL Wiki](https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language)
|
|
282
|
-
- [WebGPU Examples](https://github.com/mrdoob/three.js/tree/master/examples)
|
|
283
|
-
- [Three.js Docs](https://threejs.org/docs/)
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: webgpu-threejs-tsl
|
|
3
|
-
description: Comprehensive guide for developing WebGPU-enabled Three.js applications using TSL (Three.js Shading Language). Covers WebGPU renderer setup, TSL syntax and node materials, compute shaders, post-processing effects, and WGSL integration. Use this skill when working with Three.js WebGPU, TSL shaders, node materials, or GPU compute in Three.js.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# WebGPU Three.js with TSL
|
|
7
|
-
|
|
8
|
-
TSL (Three.js Shading Language) is a node-based shader abstraction that lets you write GPU shaders in JavaScript instead of GLSL/WGSL strings.
|
|
9
|
-
|
|
10
|
-
## Quick Start
|
|
11
|
-
|
|
12
|
-
```javascript
|
|
13
|
-
import * as THREE from 'three/webgpu';
|
|
14
|
-
import { color, time, oscSine } from 'three/tsl';
|
|
15
|
-
|
|
16
|
-
const renderer = new THREE.WebGPURenderer();
|
|
17
|
-
await renderer.init();
|
|
18
|
-
|
|
19
|
-
const material = new THREE.MeshStandardNodeMaterial();
|
|
20
|
-
material.colorNode = color(0xff0000).mul(oscSine(time));
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Skill Contents
|
|
24
|
-
|
|
25
|
-
### Documentation
|
|
26
|
-
- `docs/core-concepts.md` - Types, operators, uniforms, control flow
|
|
27
|
-
- `docs/materials.md` - Node materials and all properties
|
|
28
|
-
- `docs/compute-shaders.md` - GPU compute with instanced arrays
|
|
29
|
-
- `docs/post-processing.md` - Built-in and custom effects
|
|
30
|
-
- `docs/wgsl-integration.md` - Custom WGSL functions
|
|
31
|
-
|
|
32
|
-
### Examples
|
|
33
|
-
- `examples/basic-setup.js` - Minimal WebGPU project
|
|
34
|
-
- `examples/custom-material.js` - Custom shader material
|
|
35
|
-
- `examples/particle-system.js` - GPU compute particles
|
|
36
|
-
- `examples/post-processing.js` - Effect pipeline
|
|
37
|
-
- `examples/earth-shader.js` - Complete Earth with atmosphere
|
|
38
|
-
|
|
39
|
-
### Templates
|
|
40
|
-
- `templates/webgpu-project.js` - Starter project template
|
|
41
|
-
- `templates/compute-shader.js` - Compute shader template
|
|
42
|
-
|
|
43
|
-
### Reference
|
|
44
|
-
- `REFERENCE.md` - Quick reference cheatsheet
|
|
45
|
-
|
|
46
|
-
## Key Concepts
|
|
47
|
-
|
|
48
|
-
### Import Pattern
|
|
49
|
-
```javascript
|
|
50
|
-
// Always use the WebGPU entry point
|
|
51
|
-
import * as THREE from 'three/webgpu';
|
|
52
|
-
import { /* TSL functions */ } from 'three/tsl';
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Node Materials
|
|
56
|
-
Replace standard material properties with TSL nodes:
|
|
57
|
-
```javascript
|
|
58
|
-
material.colorNode = texture(map); // instead of material.map
|
|
59
|
-
material.roughnessNode = float(0.5); // instead of material.roughness
|
|
60
|
-
material.positionNode = displaced; // vertex displacement
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### Method Chaining
|
|
64
|
-
TSL uses method chaining for operations:
|
|
65
|
-
```javascript
|
|
66
|
-
// Instead of: sin(time * 2.0 + offset) * 0.5 + 0.5
|
|
67
|
-
time.mul(2.0).add(offset).sin().mul(0.5).add(0.5)
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Custom Functions
|
|
71
|
-
Use `Fn()` for reusable shader logic:
|
|
72
|
-
```javascript
|
|
73
|
-
const fresnel = Fn(([power = 2.0]) => {
|
|
74
|
-
const nDotV = normalWorld.dot(viewDir).saturate();
|
|
75
|
-
return float(1.0).sub(nDotV).pow(power);
|
|
76
|
-
});
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## When to Use This Skill
|
|
80
|
-
|
|
81
|
-
- Setting up Three.js with WebGPU renderer
|
|
82
|
-
- Creating custom shader materials with TSL
|
|
83
|
-
- Writing GPU compute shaders
|
|
84
|
-
- Building post-processing pipelines
|
|
85
|
-
- Migrating from GLSL to TSL
|
|
86
|
-
- Implementing visual effects (particles, water, terrain, etc.)
|
|
87
|
-
|
|
88
|
-
## Resources
|
|
89
|
-
|
|
90
|
-
- [Three.js TSL Wiki](https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language)
|
|
91
|
-
- [WebGPU Examples](https://github.com/mrdoob/three.js/tree/master/examples) (files prefixed with `webgpu_`)
|