@aura3d/cli 5.0.2 → 5.0.3
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aura3d/cli",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"aura3d": "dist/cli.js",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"main": "./dist/index.js",
|
|
28
28
|
"types": "./dist/index.d.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@aura3d/asset-index": "5.0.
|
|
31
|
-
"@aura3d/assets": "5.0.
|
|
32
|
-
"@aura3d/audio": "5.0.
|
|
33
|
-
"@aura3d/rendering": "5.0.
|
|
34
|
-
"create-aura3d": "5.0.
|
|
30
|
+
"@aura3d/asset-index": "5.0.3",
|
|
31
|
+
"@aura3d/assets": "5.0.3",
|
|
32
|
+
"@aura3d/audio": "5.0.3",
|
|
33
|
+
"@aura3d/rendering": "5.0.3",
|
|
34
|
+
"create-aura3d": "5.0.3",
|
|
35
35
|
"typescript": "^5.8.3"
|
|
36
36
|
},
|
|
37
37
|
"description": "Bring real GLB/glTF assets into Aura3D browser apps with typed references, provenance, catalog search, validation, screenshots, and deploy checks.",
|
|
@@ -151,7 +151,7 @@ const water = material.custom({
|
|
|
151
151
|
vertex: /* glsl */ `
|
|
152
152
|
out vec3 vPos;
|
|
153
153
|
void main() {
|
|
154
|
-
vec3 p = position; // prelude names: position, normal, uv, modelViewProjectionMatrix, modelMatrix, cameraPosition, uTime
|
|
154
|
+
vec3 p = position; // prelude names: position, normal, uv, modelViewProjectionMatrix, modelMatrix, cameraPosition, uTime (static scenes do not advance uTime; see below)
|
|
155
155
|
p.y += 0.25 * sin(p.x * 0.8 + waveClock) + 0.15 * sin(p.z * 1.3 - waveClock * 1.4);
|
|
156
156
|
vPos = p;
|
|
157
157
|
gl_Position = modelViewProjectionMatrix * vec4(p, 1.0);
|
|
@@ -176,7 +176,7 @@ app.onFrame(() => app.nodes.require("water").setUniform?.("waveClock", (performa
|
|
|
176
176
|
await app.ready();
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
-
`material.custom` auto-declares the uniforms you list. Prelude names: `position`, `normal` and `uv` (vertex attributes), `modelViewProjectionMatrix`, `modelMatrix`, `cameraPosition` (a uniform in both stages) and `uTime
|
|
179
|
+
`material.custom` auto-declares the uniforms you list. Prelude names: `position`, `normal` and `uv` (vertex attributes), `modelViewProjectionMatrix`, `modelMatrix`, `cameraPosition` (a uniform in both stages) and `uTime`. `uTime` is wall-clock seconds, but the engine redraws every frame only when the scene declares motion (a `.runtime({ id, mutable: true })` node, an `app.onFrame` callback, an animated model, particles or rain, an auto-rotating orbit camera, a looping timeline). A static scene whose only motion is `uTime` renders one frame and the shader looks frozen (measured on a real GPU). This recipe uses its own `waveClock` uniform written in `onFrame`, which also keeps the loop running; `uTime` works too when the node is `.runtime({ id, mutable: true })`. The fragment stage writes `outColor` (GLSL 3 `in`/`out`). There is no `eyePos`: it fails to compile with `undeclared identifier`. If the shader fails to compile the engine logs `CUSTOM_SHADER_COMPILE_FAILED` with the GLSL log (see [`troubleshooting.md`](troubleshooting.md)).
|
|
180
180
|
|
|
181
181
|
## 6. A ball dribbled by hand (hand and floor contact, handoffs, proof)
|
|
182
182
|
|
|
@@ -496,7 +496,7 @@ await app.ready();
|
|
|
496
496
|
import { camera, createAuraApp, effects, geometry, lights, material, primitives, scene } from "@aura3d/engine";
|
|
497
497
|
|
|
498
498
|
// Water with a custom GLSL material: vertex waves, analytic normal, fresnel mix between deep colour and sky, sun glint.
|
|
499
|
-
// Uniforms listed in `uniforms` are auto-declared in GLSL. Prelude names: position/normal/uv (vertex attributes), modelViewProjectionMatrix, modelMatrix, cameraPosition, uTime.
|
|
499
|
+
// Uniforms listed in `uniforms` are auto-declared in GLSL. Prelude names: position/normal/uv (vertex attributes), modelViewProjectionMatrix, modelMatrix, cameraPosition, uTime (uTime advances only while the scene redraws every frame; this recipe drives its own `waveClock` from onFrame).
|
|
500
500
|
const N = 200, SIZE = 80;
|
|
501
501
|
const positions = new Float32Array((N + 1) ** 2 * 3);
|
|
502
502
|
const normals = new Float32Array(positions.length);
|
|
@@ -10,7 +10,7 @@ Read this first. Aura3D is a standalone engine with its own renderer: you descri
|
|
|
10
10
|
| `Group` / `Object3D` hierarchy, bones as groups | `group("arm", [children], { position }).runtime({ id, mutable: true })` | Children use local transforms; a group's origin is its pivot. |
|
|
11
11
|
| `BufferGeometry` + `setAttribute` + `setIndex` | `geometry.custom(geometry.define({ positions, normals, uvs, colors, indices, bounds }), { name, material })` | Typed arrays in; `bounds` required; `colors` are per-vertex RGBA. `geometry.dynamic` for geometry you rewrite. |
|
|
12
12
|
| `MeshStandardMaterial` | `material.pbr({ color, roughness, metallic, emissive, opacity })` | Also `physical` (clearcoat), `emissive`, `toon`, `matcap`. Colour is a CSS string. |
|
|
13
|
-
| `ShaderMaterial` | `material.custom({ glsl: { vertex, fragment }, uniforms: { t: { type: "f32", value: 0 } } })`; `handle.setUniform("t", v)` | GLSL 3.00 (`in`/`out`, write `outColor`). Prelude names: `position`, `normal`, `uv`, `modelViewProjectionMatrix`, `modelMatrix`, `cameraPosition`, `uTime`. Node/TSL: `material.node`. |
|
|
13
|
+
| `ShaderMaterial` | `material.custom({ glsl: { vertex, fragment }, uniforms: { t: { type: "f32", value: 0 } } })`; `handle.setUniform("t", v)` | GLSL 3.00 (`in`/`out`, write `outColor`). Prelude names: `position`, `normal`, `uv`, `modelViewProjectionMatrix`, `modelMatrix`, `cameraPosition`, `uTime` (wall-clock seconds; advances only while the app redraws every frame: give the node `.runtime({ id, mutable: true })` or register `app.onFrame(...)`, else a static scene draws once and `uTime` looks frozen). Node/TSL: `material.node`. |
|
|
14
14
|
| `DirectionalLight` + `castShadow` | `lights.directional({ position, target, intensity, shadow: true })` | `shadow: true` on the light; meshes take `castShadow` / `receiveShadow`. Also `point`, `spot`, `hemisphere`, `ambient`, `rect`. |
|
|
15
15
|
| `scene.environment = pmrem` | `environments.neutral({ intensity, background: false })` (also `studio`, `outdoor`, `hdri`, `preset`) | Metals render dark without an environment. `looks.preset(id)` bundles environment, key light, fog and grade. |
|
|
16
16
|
| `scene.background = sky shader`, `Sky` | `sky.preetham({ sun: { elevationDeg, azimuthDeg } })`, `sky.gradient`, `sky.dayNight` | Move the sun live with `app.atmosphere.setSky({ sun })`. |
|
package/skills/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Aura3D
|
|
2
2
|
|
|
3
|
-
> Aura3D 5.0.
|
|
3
|
+
> Aura3D 5.0.3: a TypeScript SDK for browser 3D apps and games. You write a typed, declarative scene with `@aura3d/engine`; the `@aura3d/cli` toolchain handles typed GLB/glTF assets, checks and deploy gates. Built to be driven by AI coding agents. Site: https://aura3d.auraone.ai
|
|
4
4
|
|
|
5
5
|
## Read first
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
- Moving a node: give it `.runtime({ id, mutable: true })` at build time, then `app.nodes.require(id).setPosition(...)`. Without the runtime id `require` throws.
|
|
16
16
|
- Do not invent asset paths or ids: `npx @aura3d/cli@latest assets resolve "<object>" --name <name>`, then `model(assets.<name>)`.
|
|
17
17
|
- Black frame with an admitted model: a route-local URL built with `new URL(..., import.meta.url)` is absolute and blocked as unsafe-url. Use `/aura-assets/<file>`, the file under the app's `public/aura-assets/`, and list it in `aura.assets.json`.
|
|
18
|
-
- Custom shader: the prelude names are `position`, `normal`, `uv`, `modelViewProjectionMatrix`, `modelMatrix`, `cameraPosition`, `uTime`. A compile error logs `CUSTOM_SHADER_COMPILE_FAILED` and that draw is skipped silently.
|
|
18
|
+
- Custom shader: the prelude names are `position`, `normal`, `uv`, `modelViewProjectionMatrix`, `modelMatrix`, `cameraPosition`, `uTime` (wall-clock seconds; it only advances while the app redraws every frame, so give the shader node `.runtime({ id, mutable: true })` or register an `app.onFrame(...)`, otherwise a static scene draws one frame and the shader looks frozen). A compile error logs `CUSTOM_SHADER_COMPILE_FAILED` and that draw is skipped silently.
|
|
19
19
|
- One skinned body per character: never animate primitives beside a skinned mesh (double-framed skeleton, a ghosted limb).
|
|
20
20
|
- Pools (bullets, traffic, particles) must be sized from the simulation's measured peak, or objects pop in and out.
|
|
21
21
|
- Judge steady state: the first frame is lit differently from the baked probe seconds later. Capture at 3, 25 and 60 s; animated scenes flip between captures, so compare static bands before reverting anything.
|