pub static ambientMaterial: AmbientMaterialInternalTypeExpand description
Ambient material for geometry with a given color. Ambient material defines the color the object reflects under any lighting. For example, if the ambient material of an object is pure red, but the ambient lighting only contains green, the object will not reflect any light. Here's an example containing all possible materials.
Examples
function setup() {
createCanvas(100, 100, WEBGL);
}
function draw() {
background(0);
noStroke();
ambientLight(200);
ambientMaterial(70, 130, 230);
sphere(40);
}// ambientLight is both red and blue (magenta),
// so object only reflects it's red and blue components
function setup() {
createCanvas(100, 100, WEBGL);
}
function draw() {
background(70);
ambientLight(100); // white light
ambientMaterial(255, 0, 255); // pink material
box(30);
}// ambientLight is green. Since object does not contain
// green, it does not reflect any light
function setup() {
createCanvas(100, 100, WEBGL);
}
function draw() {
background(70);
ambientLight(0, 255, 0); // green light
ambientMaterial(255, 0, 255); // pink material
box(30);
}Overloads
v1 gray value, red or hue value
(depending on the current color mode),
v2? green or saturation value
v3? blue or brightness value
color color, color Array, or CSS color string