Skip to content

3D engine that AI agents drive

Give each toon step its own colour with toonColors (#2039)

Nguyen Xuan An2bce720a8490
diff --git a/changes/2039.md b/changes/2039.md
new file mode 100644
index 00000000..fbe2a026
--- /dev/null
+++ b/changes/2039.md
@@ -0,0 +1 @@
+- A material can set `toonColors`, one linear colour per `toon` step, so each light step carries its own tint (warm light, cool shadow); materials without it render as before (#2039).
diff --git a/docs/line-art.md b/docs/line-art.md
index 31d7439f..8a42f1bf 100644
--- a/docs/line-art.md
+++ b/docs/line-art.md
@@ -27,6 +27,8 @@ The width is in pixels of the output, so a 480 pixel preview and a 1920 pixel re
`toon` on a material (also a layer field, 0 to 8, 0 off) steps the cosine of each light that reaches it. The sun, a point light and a spot light each make their own bands, and the edge between two bands is 0.02 of the light range wide. Shadows keep their own softness, and the sky light that fills the dark side is not banded. A material with `toon` set wins over `lines.toon`.
+`toonColors` on a material gives each step its own colour: one linear `[red, green, blue]` (0 to 4) per step, darkest first, and as many as `toon`, such as `"toon": 3, "toonColors": [[0.2, 0.5, 0.55], [0.6, 0.8, 0.75], [1, 0.92, 0.95]]`. Each colour replaces the grey level of its step, so the darkest step can be a tint instead of black. The side facing away from a light gets no direct light and shows the ambient light, so set the ambient colour to the shadow tone. Without `toonColors` the render is unchanged.
+
## Lines on some nodes
`nodes` keys are node IDs (a placed asset is one node, however many parts it has). A node it does not name draws as usual.
diff --git a/scripts/mcp-server.mjs b/scripts/mcp-server.mjs
index 753e222a..745514d6 100644
--- a/scripts/mcp-server.mjs
+++ b/scripts/mcp-server.mjs
@@ -17,7 +17,7 @@ import { MODIFIER_OPERATIONS } from '../src/mesh-operations.js';
import { VIEW_TRANSFORM_NAMES, LOOK_NAMES } from '../src/view-transform-names.js';
import { BUNDLED_ENVIRONMENT_NAMES, BUNDLED_CUBE_LOOK_NAMES, CATALOG_FILE_ID } from '../src/look-catalog.js';
import { MATERIAL_PATTERN_TYPES, MATERIAL_MAPPINGS, LIGHTING_SETUP_NAMES, RENDER_PASS_NAMES, RENDER_OUTPUT_FORMATS, MAXIMUM_JOB_FPS, VIDEO_ENCODERS, MAXIMUM_JOB_SIDE, maximumMemoryMiB, memoryRangeError, MAXIMUM_STILLS_FRAMES } from '../src/agent-scene-capabilities.js';
-import { MATERIAL_LAYER_SCALAR_RANGES, MATERIAL_LAYER_COLOR_RANGES } from '../src/material-layers.js';
+import { MATERIAL_LAYER_SCALAR_RANGES, MATERIAL_LAYER_COLOR_RANGES, TOON_COLOR_MAXIMUM } from '../src/material-layers.js';
import { SUBSURFACE_RANGES } from '../src/subsurface-limits.js';
import { responseFormatField, chosenFormat, conciseReview, conciseJobStatus, conciseJobResult, conciseCapabilities } from './mcp-response-format.mjs';
import { resolveAddons } from './mcp-addons.mjs';
@@ -152,6 +152,7 @@ const materialLayerFields = {
iridescenceIor: layerNumber('iridescenceIor'),
iridescenceThickness: layerNumber('iridescenceThickness'),
toon: layerNumber('toon'),
+ toonColors: z.array(z.array(z.number().min(0).max(TOON_COLOR_MAXIMUM)).length(3)).min(1).max(8).optional().describe('One linear [r,g,b] per toon step, darkest first; the count must equal toon.'),
};
@@ -193,7 +194,7 @@ const materialFields = {
};
const materialTag = z.enum(['surface', 'unlit', 'liquid', 'foam', 'foliage', 'grass', 'water']).optional().describe('Surface kind; liquid, foam, foliage, grass and water change how it renders: see scene_capabilities materialTags and water.');
const materialCore = coreOf(materialFields, ['color', 'metallic', 'roughness', 'emission', 'opacity']);
-const materialMore = 'More fields: tag, alphaMode, doubleSided, emissiveColor, map, pattern, subsurface, snippet, wear, retro, waterPreset, absorption, turbidity and the layers clearcoat, clearcoatRoughness, transmission, thickness, ior, attenuationColor, attenuationDistance, sheenColor, sheenRoughness, specular, specularColor, anisotropy, anisotropyRotation, iridescence, iridescenceIor, iridescenceThickness, toon; see scene_capabilities materialFields.';
+const materialMore = 'More fields: tag, alphaMode, doubleSided, emissiveColor, map, pattern, subsurface, snippet, wear, retro, waterPreset, absorption, turbidity and the layers clearcoat, clearcoatRoughness, transmission, thickness, ior, attenuationColor, attenuationDistance, sheenColor, sheenRoughness, specular, specularColor, anisotropy, anisotropyRotation, iridescence, iridescenceIor, iridescenceThickness, toon, toonColors; see scene_capabilities materialFields.';
const materialListed = (strictSchema, description, extraCore) => listed('materialFields', strictSchema, `${description} ${materialMore}`, { ...extraCore, ...materialCore });
const liquidOptics = z.strictObject({
thickness: z.number().min(0).max(100).optional().describe('Metres of liquid where it faces the camera.'),
diff --git a/src/agent-scene-capabilities.js b/src/agent-scene-capabilities.js
index 3835587d..3d447a1c 100644
--- a/src/agent-scene-capabilities.js
+++ b/src/agent-scene-capabilities.js
@@ -44,7 +44,7 @@ const MATERIAL_LAYER_NOTES = Object.freeze({
iridescence: 'Thin-film colour shift on reflections.',
iridescenceIor: 'Film index of refraction.',
iridescenceThickness: 'Film nanometres; colours cycle as it grows.',
- toon: 'Light steps (toon); 0 off.',
+ toon: 'Light steps (toon); 0 off. Add toonColors, one linear [r,g,b] (0-4) per step from darkest to lightest and as many as toon, to give each step its own colour; the side facing away from the light shows ambient.',
});
export const MATERIAL_PATTERN_TYPES =Object.freeze(['noise', 'wood', 'planks', 'bricks', 'tiles', 'marble', 'stone', 'concrete', 'metal', 'rust', 'fabric']);
diff --git a/src/agent-scene.js b/src/agent-scene.js
index 70258db9..cca7b856 100644
--- a/src/agent-scene.js
+++ b/src/agent-scene.js
@@ -61,7 +61,7 @@ const CAMERA_DEFAULTS = Object.freeze({ eye: [4, 3, 5], target: [0, 0, 0], up: [
const RENDER_FLAG_FIELDS = ['visible', 'castShadow', 'receiveShadow', 'holdout', 'shadowCatcher', 'shadowOnly'];
const PART_FLAG_FIELDS = RENDER_FLAG_FIELDS.slice(1);
const NODE_FIELDS = ['translation', 'rotation', 'scale', 'parent', 'label', 'geometry', 'material', 'skin', 'relations', 'asset', 'vegetation', 'decal', 'depthLayer', 'blend', 'rayVisibility', ...RENDER_FLAG_FIELDS];
-const MATERIAL_FIELDS = ['color', 'metallic', 'roughness', 'emission', 'emissiveColor', 'opacity', 'alphaMode', 'doubleSided', 'pattern', 'map', 'subsurface', 'snippet', 'waterPreset', 'absorption', 'turbidity', 'aov', 'wear', 'retro', 'emissionMask', ...MATERIAL_LAYER_FIELDS];
+const MATERIAL_FIELDS = ['color', 'metallic', 'roughness', 'emission', 'emissiveColor', 'opacity', 'alphaMode', 'doubleSided', 'pattern', 'map', 'subsurface', 'snippet', 'waterPreset', 'absorption', 'turbidity', 'aov', 'wear', 'retro', 'emissionMask', 'toonColors', ...MATERIAL_LAYER_FIELDS];
const PATTERN_TEXTURE_FIELDS = ['map', 'normalMap', 'metallicRoughnessMap', 'emissiveMap', 'layerMaps', 'transmissionMap', 'aovMap', 'emissionFresnel', 'boxMapScale', 'boxMapAxis'];
const CAMERA_FIELDS = [...Object.keys(CAMERA_DEFAULTS), ...CAMERA_LENS_FIELDS];
const LOOK_OPERATION_FIELDS = Object.freeze({
@@ -265,6 +265,11 @@ function copyMaterialLayers(value, result) {
if (value[field] === undefined) continue;
result[field] = Array.isArray(value[field]) ? vector(value[field], 3, field) : value[field];
}
+ if (value.toonColors !== undefined) {
+ result.toonColors = Array.isArray(value.toonColors)
+ ? Object.freeze(value.toonColors.map((color, index) => Object.freeze(vector(color, 3, `toonColors[${index}]`))))
+ : value.toonColors;
+ }
validateMaterialLayers(result);
if (value.emissionMask !== undefined) {
result.emissionMask = Object.freeze(agentSceneModule('emissionMask').normalizeEmissionMask(value.emissionMask));
diff --git a/src/material-layers.js b/src/material-layers.js
index e1480053..af404380 100644
--- a/src/material-layers.js
+++ b/src/material-layers.js
@@ -74,6 +74,28 @@ function checkColor(field, value) {
}
}
+/** Each toon step colour is a linear RGB weight on that step's light; above 1 brightens it. */
+export const TOON_COLOR_MAXIMUM = 4;
+
+function checkToonColors(material) {
+ const colors = material.toonColors;
+ if (colors === undefined) return;
+ const steps = material.toon ?? 0;
+ if (!(steps > 0)) {
+ throw new RangeError(`toonColors needs toon above 0 (the step count), got toon ${steps}. Set toon to ${Array.isArray(colors) ? colors.length : 3} or remove toonColors.`);
+ }
+ if (!Array.isArray(colors) || colors.length !== steps) {
+ throw new RangeError(`toonColors must be an array of ${steps} colours, one per toon step from darkest to lightest, got ${Array.isArray(colors) ? colors.length : colors}. Pass ${steps} [red, green, blue] triples, or change toon to ${Array.isArray(colors) ? colors.length : 3}.`);
+ }
+ colors.forEach((color, index) => {
+ const isLinearColor = Array.isArray(color) && color.length === 3 &&
+ color.every(component => typeof component === 'number' && Number.isFinite(component) && component >= 0 && component <= TOON_COLOR_MAXIMUM);
+ if (!isLinearColor) {
+ throw new RangeError(`toonColors[${index}] must be three linear RGB numbers between 0 and ${TOON_COLOR_MAXIMUM}. Pass [red, green, blue].`);
+ }
+ });
+}
+
function checkAttenuationDistance(value) {
const isPositive = typeof value === 'number' && value > 0 && Number.isFinite(value);
if (!isPositive) {
@@ -89,6 +111,7 @@ export function validateMaterialLayers(material) {
for (const field of Object.keys(MATERIAL_LAYER_COLOR_RANGES)) {
if (material[field] !== undefined) checkColor(field, material[field]);
}
+ checkToonColors(material);
if (material.attenuationDistance !== undefined && material.attenuationDistance !== Infinity) {
checkAttenuationDistance(material.attenuationDistance);
}
@@ -128,7 +151,7 @@ export function dielectricReflectance(material) {
/**
* Plain values the renderer batches by: dielectric F0 (3), coat (2), sheen (4), transmission (4), attenuation colour (3),
- * anisotropy strength and rotation (2), iridescence factor, film IOR and film thickness in nanometres (3), light mask (1), toon bands (1), and the subsurface block as JSON, or '' (1; subsurface-limits.js and the addon read it), emission fresnel (1) and the emission mask: axis index or -1, from, to (3).
+ * anisotropy strength and rotation (2), iridescence factor, film IOR and film thickness in nanometres (3), light mask (1), toon bands (1), and the subsurface block as JSON, or '' (1; subsurface-limits.js and the addon read it), emission fresnel (1), the emission mask: axis index or -1, from, to (3) and the toon step colours as JSON, or '' (1; toon-shader.js reads it).
*/
export function materialLayerState(material) {
validateMaterialLayers(material);
@@ -155,7 +178,8 @@ export function materialLayerState(material) {
'xyz'.indexOf(material.emissionMask?.axis),
material.emissionMask?.from ?? 0,
material.emissionMask?.to ?? 1,
+ material.toonColors ? JSON.stringify(material.toonColors) : '',
];
}
-export const MATERIAL_LAYER_STATE_LENGTH = 28;
+export const MATERIAL_LAYER_STATE_LENGTH = 29;
diff --git a/src/material-snapshot.js b/src/material-snapshot.js
index 688e6159..bfbc1f88 100644
--- a/src/material-snapshot.js
+++ b/src/material-snapshot.js
@@ -3,7 +3,7 @@
// more than the checks it saves. tests/material-snapshot.test.js keeps the lists in step with the renderer's material fields.
/** Material fields that the renderer compares with the batch a part was committed to. */
-export const SNAPSHOT_VALUE_FIELDS = Object.freeze(['map', 'normalMap', 'metallicRoughnessMap', 'occlusionMap', 'emissiveMap', 'tag', 'alphaMode', 'alphaCutoff', 'opacity', 'doubleSided', 'occlusionStrength', 'moss', 'boxMapScale', 'boxMapAxis', 'lightMapScale', 'layerMaps', 'lightMask', 'clearcoat', 'clearcoatRoughness', 'transmission', 'thickness', 'ior', 'dispersion', 'sheenRoughness', 'specular', 'anisotropy', 'anisotropyRotation', 'iridescence', 'iridescenceIor', 'iridescenceThickness', 'attenuationDistance', 'toon', 'emissionFresnel']);
+export const SNAPSHOT_VALUE_FIELDS = Object.freeze(['map', 'normalMap', 'metallicRoughnessMap', 'occlusionMap', 'emissiveMap', 'tag', 'alphaMode', 'alphaCutoff', 'opacity', 'doubleSided', 'occlusionStrength', 'moss', 'boxMapScale', 'boxMapAxis', 'lightMapScale', 'layerMaps', 'lightMask', 'clearcoat', 'clearcoatRoughness', 'transmission', 'thickness', 'ior', 'dispersion', 'sheenRoughness', 'specular', 'anisotropy', 'anisotropyRotation', 'iridescence', 'iridescenceIor', 'iridescenceThickness', 'attenuationDistance', 'toon', 'toonColors', 'emissionFresnel']);
/** Fields holding an array or descriptor, which can change in place. A material that sets one is never snapshotted. */
export const SNAPSHOT_REFERENCE_FIELDS = Object.freeze(['normalScale', 'mossColor', 'lightMap', 'attenuationColor', 'sheenColor', 'specularColor', 'subsurface', 'wear', 'emissionMask', 'retro']);
@@ -60,6 +60,7 @@ export class MaterialSnapshot {
this.iridescenceThickness = material.iridescenceThickness;
this.attenuationDistance = material.attenuationDistance;
this.toon = material.toon;
+ this.toonColors = material.toonColors;
this.emissionFresnel = material.emissionFresnel;
}
@@ -97,6 +98,7 @@ export class MaterialSnapshot {
this.iridescenceThickness === material.iridescenceThickness &&
this.attenuationDistance === material.attenuationDistance &&
this.toon === material.toon &&
+ this.toonColors === material.toonColors &&
this.emissionFresnel === material.emissionFresnel;
}
}
diff --git a/src/toon-shader.js b/src/toon-shader.js
index d80915a0..a54b672d 100644
--- a/src/toon-shader.js
+++ b/src/toon-shader.js
@@ -1,4 +1,5 @@
-import { registerShaderFeatureCode } from './shaders.js';
+import { registerShaderFeatureCode, layerTextureSupport } from './shader-registry.js';
+import { MATERIAL_LAYER_STATE_LENGTH } from './material-layers.js';
// Shader code for the toon material option. It lives outside shaders.js so a scene without banded light never carries it:
// the renderer asks for the `toon` feature only when a part has `toon` above 0, or when the line art addon turns on a
@@ -8,11 +9,20 @@ import { registerShaderFeatureCode } from './shaders.js';
// scene with a sun and a lamp shows two sets of bands. `materialToon` is the step count of the material and
// `toonDefault` the count for a material that sets none; 0 in both leaves the smooth light. The edge between steps is
// 0.02 of the light range wide, which antialiases without derivatives (those are undefined in the light loops).
+//
+// A material with `toonColors` has one colour per step, darkest first. toonStepColor picks the colour of the step the
+// light falls in, blending with the step below across the same narrow edge, and illuminate multiplies the light by it in
+// place of the grey step level, so the darkest step can be a tint rather than black. The side facing away from a light
+// gets no direct light at all, so it shows the ambient light.
const TOON_SOFTNESS = '0.02';
+export const MAX_TOON_STEPS = 8;
+
const TOON_DECLARATIONS = `uniform float materialToon;
uniform float toonDefault;
+uniform float materialToonColored;
+uniform vec3 materialToonColors[${MAX_TOON_STEPS}];
float toonLight(float light) {
float bands = materialToon > 0.0 ? materialToon : toonDefault;
if (bands <= 0.0) return light;
@@ -20,9 +30,50 @@ float toonLight(float light) {
float band = floor(scaled);
return (band + smoothstep(0.0, ${TOON_SOFTNESS} * bands, scaled - band)) / bands;
}
+vec3 toonStepColor(float light) {
+ float scaled = clamp(light, 0.0, 1.0) * materialToon;
+ float band = floor(scaled);
+ int top = int(min(band, materialToon - 1.0));
+ if (top == 0) return materialToonColors[0];
+ float blend = band >= materialToon ? 1.0 : smoothstep(0.0, ${TOON_SOFTNESS} * materialToon, scaled - band);
+ return mix(materialToonColors[top - 1], materialToonColors[top], blend);
+}
`;
registerShaderFeatureCode('toon', Object.freeze({
declarations: TOON_DECLARATIONS,
- illuminateReflectance: ' normalLight = toonLight(normalLight);\n',
+ illuminateReflectance: ` if (materialToonColored > 0.5) {
+ radiance *= toonStepColor(normalLight);
+ normalLight = 1.0;
+ } else {
+ normalLight = toonLight(normalLight);
+ }
+`,
}));
+
+const TOON_COLORS_STATE_INDEX = MATERIAL_LAYER_STATE_LENGTH - 1;
+const parsedColorsByState = new Map();
+
+function toonColorValues(colorsState) {
+ if (!parsedColorsByState.has(colorsState)) {
+ const values = new Float32Array(MAX_TOON_STEPS * 3);
+ values.set(JSON.parse(colorsState).flat());
+ parsedColorsByState.set(colorsState, values);
+ }
+ return parsedColorsByState.get(colorsState);
+}
+
+function uniformOf(renderer, name) {
+ renderer.uniforms[name] ??= renderer.context.getUniformLocation(renderer.program, name);
+ return renderer.uniforms[name];
+}
+
+// Other optional features also bind per batch, so this keeps whatever was registered first.
+const previousBind = layerTextureSupport.bind;
+layerTextureSupport.bind = (renderer, mapState, layerState, batch) => {
+ previousBind?.(renderer, mapState, layerState, batch);
+ if (!renderer.shaderFeatures?.has('toon')) return;
+ const colorsState = layerState[TOON_COLORS_STATE_INDEX];
+ renderer.context.uniform1f(uniformOf(renderer, 'materialToonColored'), colorsState ? 1 : 0);
+ if (colorsState) renderer.context.uniform3fv(uniformOf(renderer, 'materialToonColors'), toonColorValues(colorsState));
+};
diff --git a/tests/emission-mask.test.js b/tests/emission-mask.test.js
index 5ec18b41..da4dd0ab 100644
--- a/tests/emission-mask.test.js
+++ b/tests/emission-mask.test.js
@@ -40,7 +40,7 @@ async function stoolMaterial(override) {
test('an asset override carries the mask to the material the renderer draws', async () => {
const material = await stoolMaterial({ emissionMask: MASK });
assert.deepEqual({ ...material.emissionMask }, MASK);
- assert.deepEqual(materialLayerState(material).slice(-3), [1, 0.2, 0.5]);
+ assert.deepEqual(materialLayerState(material).slice(-4, -1), [1, 0.2, 0.5]);
});
test('the same recipe builds the same mask every time', async () => {
@@ -54,7 +54,7 @@ test('without a mask the material and its layer state are unchanged', async () =
assert.equal(material.emissionMask, undefined);
const state = materialLayerState(material);
assert.equal(state.length, MATERIAL_LAYER_STATE_LENGTH);
- assert.deepEqual(state.slice(-3), [-1, 0, 1]);
+ assert.deepEqual(state.slice(-4, -1), [-1, 0, 1]);
assert.notDeepEqual(state, materialLayerState(await stoolMaterial({ emissionMask: MASK })));
});
diff --git a/tests/line-art.test.js b/tests/line-art.test.js
index 325daee8..42600ce6 100644
--- a/tests/line-art.test.js
+++ b/tests/line-art.test.js
@@ -138,3 +138,52 @@ test('the addon finds the toon uniforms after the main program is rebuilt', () =
assert.equal(renderer.uniforms.materialToon, 'materialToon');
assert.ok(located.includes('rebuilt:toonDefault'));
});
+
+const THREE_STEP_COLORS = [[0.2, 0.5, 0.55], [0.6, 0.8, 0.75], [1, 0.92, 0.95]];
+
+test('toonColors needs one colour per toon step, and says what to pass', () => {
+ const recipe = { ...BASE_RECIPE, materials: [{ id: 'gray', toon: 3, toonColors: THREE_STEP_COLORS }] };
+ assert.deepEqual(createAgentScene(recipe).parts[0].material.toonColors, THREE_STEP_COLORS);
+ const withColors = overrides => ({ ...BASE_RECIPE, materials: [{ id: 'gray', ...overrides }] });
+ assert.throws(() => createAgentScene(withColors({ toon: 2, toonColors: THREE_STEP_COLORS })), /toonColors must be an array of 2 colours.*change toon to 3/);
+ assert.throws(() => createAgentScene(withColors({ toonColors: THREE_STEP_COLORS })), /toonColors needs toon above 0.*Set toon to 3/);
+ assert.throws(() => createAgentScene(withColors({ toon: 1, toonColors: [[0, 0, 9]] })), /toonColors\[0\] must be three linear RGB numbers between 0 and 4/);
+ assert.throws(() => createAgentScene(withColors({ toon: 1, toonColors: [[0, 0]] })), /toonColors\[0\].*expected an array of 3 numbers/);
+});
+
+test('toon step colours show in the batching state and only when set', () => {
+ const plain = materialLayerState({ tag: 'surface', toon: 3 });
+ const coloured = materialLayerState({ tag: 'surface', toon: 3, toonColors: THREE_STEP_COLORS });
+ assert.equal(plain[MATERIAL_LAYER_STATE_LENGTH - 1], '');
+ assert.deepEqual(JSON.parse(coloured[MATERIAL_LAYER_STATE_LENGTH - 1]), THREE_STEP_COLORS);
+ assert.deepEqual(plain.slice(0, -1), coloured.slice(0, -1));
+});
+
+test('the toon shader tints by step only behind the colour uniform, and keeps the grey path', () => {
+ const toonShader = createFragmentShader(['toon']);
+ assert.match(toonShader, /uniform vec3 materialToonColors\[8\];/);
+ assert.match(toonShader, /radiance \*= toonStepColor\(normalLight\);/);
+ assert.match(toonShader, /normalLight = toonLight\(normalLight\);/);
+ assert.doesNotMatch(createFragmentShader([]), /toonStepColor/);
+});
+
+test('the batch bind uploads the step colours padded to eight, and switches them off when absent', async () => {
+ const { layerTextureSupport } = await import('../src/shader-registry.js');
+ const calls = [];
+ const renderer = {
+ program: 'main', uniforms: {}, shaderFeatures: new Set(['toon']),
+ context: {
+ getUniformLocation: (program, name) => name,
+ uniform1f: (name, value) => calls.push([name, value]),
+ uniform3fv: (name, values) => calls.push([name, Array.from(values)]),
+ },
+ };
+ const coloured = materialLayerState({ tag: 'surface', toon: 3, toonColors: THREE_STEP_COLORS });
+ layerTextureSupport.bind(renderer, [], coloured, {});
+ assert.deepEqual(calls[0], ['materialToonColored', 1]);
+ assert.equal(calls[1][1].length, 24);
+ assert.deepEqual(calls[1][1].slice(0, 3).map(value => Math.fround(value)), THREE_STEP_COLORS[0].map(value => Math.fround(value)));
+ calls.length = 0;
+ layerTextureSupport.bind(renderer, [], materialLayerState({ tag: 'surface', toon: 3 }), {});
+ assert.deepEqual(calls, [['materialToonColored', 0]]);
+});