VOOZH about

URL: https://processing.org/reference/lightspecular_

⇱ lightSpecular() / Reference / Processing.org


Reference+
DocumentationReferenceLights CameraLights

Name

lightSpecular()

Description

Sets the specular color for lights. Like fill(), it affects only the elements which are created after it in the code. Specular refers to light which bounces off a surface in a preferred direction (rather than bouncing in all directions like a diffuse light) and is used for creating highlights. The specular quality of a light interacts with the specular material qualities set through the specular() and shininess() functions.

Examples

  • size(400, 400, P3D);
    background(0);
    noStroke();
    directionalLight(102, 102, 102, 0, 0, -1);
    lightSpecular(204, 204, 204);
    directionalLight(102, 102, 102, 0, 1, -1);
    lightSpecular(102, 102, 102);
    translate(80, 200, 0);
    specular(51, 51, 51);
    sphere(120);
    translate(240, 0, 0);
    specular(102, 102, 102);
    sphere(120);

Syntax

  • lightSpecular(v1, v2, v3)

Parameters

  • v1(float)red or hue value (depending on current color mode)
  • v2(float)green or saturation value (depending on current color mode)
  • v3(float)blue or brightness value (depending on current color mode)

Return

  • void