light_specular()
Contents
light_specular()¶
Sets the specular color for lights.
Examples¶

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | def setup():
py5.size(100, 100, py5.P3D)
py5.background(0)
py5.no_stroke()
py5.directional_light(102, 102, 102, 0, 0, -1)
py5.light_specular(204, 204, 204)
py5.directional_light(102, 102, 102, 0, 1, -1)
py5.light_specular(102, 102, 102)
py5.translate(20, 50, 0)
py5.specular(51, 51, 51)
py5.sphere(30)
py5.translate(60, 0, 0)
py5.specular(102, 102, 102)
py5.sphere(30)
|
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.
Underlying Processing method: lightSpecular
Syntax¶
light_specular(v1: float, v2: float, v3: float, /) -> None
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)
Updated on November 12, 2021 11:30:58am UTC