Sets an image that controls where a shape looks glossy.
A specular map lets one shape mix polished and worn surfaces. It works like texture(), but instead of setting the base color, the map's color at each point scales the highlight set by specularMaterial(). Bright parts of the map stay shiny and dark parts look matte.
The parameter, tex, is the image to use as the specular map. Passing null clears it, as in specularTexture(null). The map can also be scoped between push() and pop().
A light source is needed to see the effect. Models loaded with loadModel() apply their own specular map from the .mtl file's map_Ks.
Note: specularTexture() can only be used in WebGL mode.
Examples
Syntax
specularTexture(tex)
Parameters
null to clear it.Related References
copyToContext
Copies the shader from one drawing context to another.
inspectHooks
Logs the hooks available in this shader, and their current implementation.
modify
Returns a new shader, based on the original, but with custom snippets of shader code replacing default behaviour.
setUniform
Sets the shader’s uniform (global) variables.