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.
उदाहरण
सिंटैक्स
ambientTexture(tex)
पैरामीटर्स
null to clear it.संबंधित संदर्भ
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.
version
Shaders are written in GLSL, but there are different versions of GLSL that it might be written in.
ambientTexture
Sets an image that controls the color a shape reflects from ambient light.