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.
Ejemplos
Sintaxis
specularTexture(tex)
Parámetros
null to clear it.Referencias Relacionadas
copyToContext
Copia el shader de un contexto de dibujo a otro.
setUniform
Establece los valores de las variables uniformes (globales) del shader.
ambientMaterial
Establece el color ambiental del material de la superficie de las formas.
createFilterShader
Crea un objeto p5.Shader para ser utilizado con la función filter().