Reference shininessTexture()

shininessTexture()

Sets an image that controls how tight a shape's highlights are.

A shininess map varies the value set by shininess() across a surface. Only the map's red channel is read, and it scales the base shininess, so bright areas get a small, sharp highlight and dark areas get a broad, soft one. This lets a single shape look polished in some places and dull in others.

The parameter, tex, is the image to use as the shininess map. Passing null clears it, as in shininessTexture(null). The map can also be scoped between push() and pop().

A light source and specularMaterial() are needed to see the effect. Models loaded with loadModel() apply their own shininess map from the .mtl file's map_Ns.

Note: shininessTexture() can only be used in WebGL mode.

Examples

Syntax

shininessTexture(tex)

Parameters

tex
p5.Image|p5.MediaElement|p5.Graphics|p5.Texture|p5.Framebuffer|p5.FramebufferTexture: image to use as the shininess map, or null to clear it.

Related References