2d image materials + lights

Hi,

It would be great if there was a class that inherits from image and you had the ability to add, normal maps, specular maps plus a boolean that enables it to cast shadows. It could be called “texture”.

What would also be great is the addition of 2d lights to a scene: spotlights, radial lights, area lights and via a light image. lights would also need coloring.

2 Likes

Have you seen the 2D normal map light example?

CODE: GitHub - defold/sample-normal-maps-2d
DEMO: Normal Maps 2D 1.0

There’s also this lights and shadows example: GitHub - defold/sample-lights-and-shadows: Example of how to achieve pixel perfect shadows in a 2D view