Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 25 additions & 16 deletions src/webgl/material.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
* <div>
* <code>
* 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);
* }
* </code>
* </div>
* @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
*/

/**
Expand Down