Sets an image that controls the color a shape reflects from ambient light.
An ambient map varies the color set by ambientMaterial() across a surface, so different parts of one shape can pick up ambient light differently. It works like texture(), but the map's color is applied to the ambient term rather than the base color.
The parameter, tex, is the image to use as the ambient map. Passing null clears it, as in ambientTexture(null). The map can also be scoped between push() and pop().
An ambientLight() is needed to see the effect. Models loaded with loadModel() apply their own ambient map from the .mtl file's map_Ka.
Note: ambientTexture() can only be used in WebGL mode.
Ejemplos
Sintaxis
ambientTexture(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().