Moving light sources on mobile?

The basic material isn’t too complicated to set up. Here’s a quick example I put together:

You have a light position, light radius, and a light color as parameters. This just adds light based on distance–you could do better if you take into account the light angle as well, but this was just a quick proof of concept. This is being done in a custom UV so it is relatively cheap as the computer does it per-vertex and not per-pixel. You would need to have enough triangles in your geometry to get a good result. You might be able to use a per-pixel lighting calculations (i.e specular or normal mapping), but that would start getting expensive because this is all in addition to the standard UE4 material.

Here’s a screenshot of what it looks like in the mobile preview:

Hopefully it will work the same on actual devices.

1 Like