diff --git a/src/webgl/material.js b/src/webgl/material.js index 713b292d3b..a8eb6546b4 100644 --- a/src/webgl/material.js +++ b/src/webgl/material.js @@ -712,36 +712,45 @@ p5.prototype.emissiveMaterial = function(v1, v2, v3, a) { * @param {Number} [alpha] alpha value relative to current color range * (default is 0-255) * @chainable - */ - -/** - * @method specularMaterial - * @param {Number} v1 red or hue value relative to - * the current color range - * @param {Number} v2 green or saturation value - * relative to the current color range - * @param {Number} v3 blue or brightness value - * relative to the current color range - * @param {Number} [alpha] - * @chainable * * @example *
* * function setup() { * createCanvas(100, 100, WEBGL); + * noStroke(); * } + * * function draw() { * background(0); - * ambientLight(50); - * pointLight(250, 250, 250, 100, 100, 30); + * + * ambientLight(60); + * + * // add point light to showcase specular material + * let locX = mouseX - width / 2; + * let locY = mouseY - height / 2; + * pointLight(255, 255, 255, locX, locY, 50); + * * specularMaterial(250); - * sphere(40); + * shininess(50); + * torus(30, 10, 64, 64); * } * *
* @alt - * diffused radiating light source from top right of canvas + * torus with specular material + */ + +/** + * @method specularMaterial + * @param {Number} v1 red or hue value relative to + * the current color range + * @param {Number} v2 green or saturation value + * relative to the current color range + * @param {Number} v3 blue or brightness value + * relative to the current color range + * @param {Number} [alpha] + * @chainable */ /**