Reference imageLight()

imageLight()

Creates an ambient light from an image.

imageLight() simulates a light shining from all directions. The effect is like placing the sketch at the center of a giant sphere that uses the image as its texture. The image's diffuse light will be affected by fill() and the specular reflections will be affected by specularMaterial() and shininess().

The parameter, img, is the p5.Image object to use as the light source.

Examples

Syntax

imageLight(img)

Parameters

img
p5.image:

image to use as the light source.

This page is generated from the comments in src/webgl/light.js . Please feel free to edit it and submit a pull request!

Related References