Search processing.org:

Reference for Processing (BETA) version 0135+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name

### specular()

Examples

    size(100, 100, P3D);
    background(0);
    noStroke();
    background(0);
    fill(0, 51, 102);
    lightSpecular(255, 255, 255);
    directionalLight(204, 204, 204, 0, 0, -1);
    translate(20, 50, 0);
    specular(255, 255, 255);
    sphere(30);
    translate(60, 0, 0);
    specular(204, 102, 0);
    sphere(30);

Description | Sets the specular color of the materials used for shapes drawn to the screen, which sets the color of hightlights. Specular refers to light which bounces off a surface in a perferred direction (rather than bouncing in all directions like a diffuse light). Used in combination with emissive, ambient(), and shininess() in setting the materal properties of shapes.

Syntax

    specular(gray)
    specular(gray, alpha)
    specular(color)
    specular(v1, v2, v3)
    specular(v1, v2, v3, alpha)

Parameters

gray | int or float: number specifying value between white and black
alpha | int or float: opacity
color | color: any value of the color datatype
v1 | int or float: red or hue value
v2 | int or float: green or saturation value
v3 | int or float: blue or brightness value

Usage | Web & Application
Related | emissive() ambient() shininess()

Updated on February 09, 2008 04:38:52pm PST