Is there a way to create directional light in 2D?

Viewed 218

In processing there is a function that creates directional light in 3D. But i wanna create the same effect in 2D. I think i need a vector and color info so i can create a shadow effect on a image.

Like this: https://imgur.com/a/wDEJWkT

The mouse becomes a point of light and when it moves around it changes the image creating a shadow effect on it.

I can't use function that are 3D like pointLight or directionalLight so any ideas where should i start?

0 Answers
Related