Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Make the graph capabilities text and the mask doc match what exists (Part of #860)

Nguyen Xuan An7e03d224532c
diff --git a/changes/860-capabilities-text.md b/changes/860-capabilities-text.md
new file mode 100644
index 00000000..a32b21de
--- /dev/null
+++ b/changes/860-capabilities-text.md
@@ -0,0 +1 @@
+- Make the `scene_capabilities` graph text say fresnel works as an emission factor and name what is still missing, and drop the `pass` argument `scene_look` does not take from the post mask docs.
diff --git a/docs/agent-look.md b/docs/agent-look.md
index 8ab5168a..94df0985 100644
--- a/docs/agent-look.md
+++ b/docs/agent-look.md
@@ -281,7 +281,7 @@ Ambient occlusion reads the depth texture, so it needs the HDR depth target that
| `lensDistortion.distortion` | `0` | `-1` to `1`. Above `0` is barrel, below is pincushion |
| `lensDistortion.dispersion` | `0` | `0` to `1`. Red and blue split apart toward the edges, up to 3 percent of the distance from the center |
-A step with a `mask` applies only where the mask is on; with no `mask` it applies to the whole frame, as before. `mask` takes `objects` (one to 16 part names, as `scene_look` with `pass: "objectId"` lists them), `depth` (`near`, `far` metres along the view direction, and `feather`, the metres over which each end fades; defaults `0`, `100000`, `0`), or both, which multiply, and `invert: true` to flip the result. A grade for the hero part only: `{ "colorBalance": { "gain": [1.3, 1, 0.8], "mask": { "objects": ["hero"] } } }`. A mask by parts reads the object ID pass, so the frame is drawn twice, and its edges are hard because an object ID cannot be antialiased; a mask by depth costs nothing extra. A name that is not a part of the frame fails with the names it knows. A mask cannot be combined with an active `lensDistortion` (distortion other than 0, or dispersion above 0): the mask is built in undistorted screen space, so it would not line up with the warped image, and the recipe fails with an error that says so. `composite` runs last, after `stylize`: it keys the finished frame, grade and filters included, and draws it over the background, so key a green screen with the colour it has after those steps. A key needs a background, and a mask needs a key. Only keys are in so far: alpha over an image, Z combine and cryptomatte are not. A mask on `composite` limits where the key applies, so pixels outside it stay as drawn. `stylize` runs after color balance: pixelate first (the other filters read the blocks), then kuwahara, sharpen, posterize. Every filter is off until named, and a filter set to `0` is off.
+A step with a `mask` applies only where the mask is on; with no `mask` it applies to the whole frame, as before. `mask` takes `objects` (one to 16 part names, the node ids of the parts in the scene; `scene_look` takes no `pass` argument), `depth` (`near`, `far` metres along the view direction, and `feather`, the metres over which each end fades; defaults `0`, `100000`, `0`), or both, which multiply, and `invert: true` to flip the result. A grade for the hero part only: `{ "colorBalance": { "gain": [1.3, 1, 0.8], "mask": { "objects": ["hero"] } } }`. A mask by parts reads the object ID pass, so the frame is drawn twice, and its edges are hard because an object ID cannot be antialiased; a mask by depth costs nothing extra. A name that is not a part of the frame fails with the names it knows. A mask cannot be combined with an active `lensDistortion` (distortion other than 0, or dispersion above 0): the mask is built in undistorted screen space, so it would not line up with the warped image, and the recipe fails with an error that says so. `composite` runs last, after `stylize`: it keys the finished frame, grade and filters included, and draws it over the background, so key a green screen with the colour it has after those steps. A key needs a background, and a mask needs a key. Only keys are in so far: alpha over an image, Z combine and cryptomatte are not. A mask on `composite` limits where the key applies, so pixels outside it stay as drawn. `stylize` runs after color balance: pixelate first (the other filters read the blocks), then kuwahara, sharpen, posterize. Every filter is off until named, and a filter set to `0` is off.
Depth of field and motion blur are deterministic: they read the frame, its depth and the camera, with fixed sample patterns, so a seek to a time gives the same pixels as playing to it.
Depth of field applies to every render, including `scene_look`.
diff --git a/src/agent-scene-capabilities.js b/src/agent-scene-capabilities.js
index 0fdfd7c9..85948657 100644
--- a/src/agent-scene-capabilities.js
+++ b/src/agent-scene-capabilities.js
@@ -84,7 +84,7 @@ export const MATERIAL_GRAPH_NODES = Object.freeze({
note: 'Each takes "at", a vector such as {"uv":"both"}. Scales are whole numbers 1-64.',
}),
uv: '{"uv":"u"|"v"|"both"} coordinates.',
- coordinates: '{"coord":"generated"|"object"|"world"} vector of where the texel sits: generated is the unit tile, object and world are metres across the tile (u * size); the third axis is 0 because a baked texture is projected. {"mapping":{"vector":node,"scale":n|[x,y,z],"offset":[x,y,z],"rotate":radians}} scales, turns around Z and moves a vector (default: generated). Feed either to "at". Meshes without UVs use box mapping; vertex_color already multiplies the baked colour. Not in graphs yet: AO, bevel, curvature, fresnel, vertexGroup (per-pixel or per-vertex data a bake does not have).',
+ coordinates: '{"coord":"generated"|"object"|"world"} vector of where the texel sits: generated is the unit tile, object and world are metres across the tile (u * size); the third axis is 0 because a baked texture is projected. {"mapping":{"vector":node,"scale":n|[x,y,z],"offset":[x,y,z],"rotate":radians}} scales, turns around Z and moves a vector (default: generated). Feed either to "at". Meshes without UVs use box mapping; vertex_color already multiplies the baked colour. In graphs: fresnel, only as an emission factor. Not in graphs: vertexGroup, AO, bevel, curvature (per-pixel or per-vertex data a bake does not have).',
ramp: '{"ramp":{"value":node,"stops":[[0,[r,g,b]],[1,[r,g,b]]]}} 2-8 stops rising from 0 to 1.',
fresnel: '{"fresnel":{"ior":1.5}} ior 1.01-3. View dependent, so only as a factor of emission, alone or {"mul":[node,{"fresnel":{...}}]}: emission rises toward grazing angles, rendered per pixel by the rasterizer and the CPU path tracer.',
mixing: '{"layer":{"base","top","mask","edge","softness"}}; {"hue":{"color","shift","saturation","value"}}; {"curve":{"value","points":[[x,y]]}}.',
diff --git a/tests/material-graph.test.js b/tests/material-graph.test.js
index b6d38944..7221af91 100644
--- a/tests/material-graph.test.js
+++ b/tests/material-graph.test.js
@@ -297,3 +297,10 @@ test('graph errors name the valid options, and scene_capabilities lists the node
assert.ok(documented.includes(operator), `${operator} is documented in scene_capabilities`);
}
});
+
+test('scene_capabilities says fresnel exists only as an emission factor and lists what is missing', () => {
+ const coordinates = AGENT_SCENE_CAPABILITIES.materialGraph.nodes.coordinates;
+ assert.match(coordinates, /In graphs: fresnel, only as an emission factor/);
+ assert.match(coordinates, /Not in graphs: vertexGroup, AO, bevel, curvature/);
+ assert.doesNotMatch(coordinates, /Not in graphs yet: AO, bevel, curvature, fresnel/);
+});