Fake dynamic lighting material for mobile devices

This is the first try of that kind of material. Given that you can’t use Light Vector anymore and there is no dynamic lighting for mobile devices (at least not the ‘low end’ ones) I’ve decided to give it a try to create a fake lighting material.

For the time being it just calculates direction from a ‘light actor’ which is not a light at all, and then adjust the normal from that actor. Quite simple stuff really, great for basic character lighting and prop lighting.

Here’s how it goes:

The material takes into account the vertex normal and a normal map… Normal. You can disable normal map to save some instruction for performance. Then it takes a normalized vector (which will be set inside the blueprint or class) and calculates the direction vector. I’ve also added a simple TOP → BOTTOM lighting to imitate sky light. Later one can add colors and attentuation. Adding more lights can be achieved by simply copying and adding the code. Later I’ll make it to 1 simple function.

Then there’s the blueprint:

Inside of a TICK function it takes the normalized position of the light source relatively to it’s own position and sends it to the material. Simple. For pawns for example you can trace 3 closests lights + directional light from the sun (with a simple trace to get the ‘shadowing’ effect).

Later I’ll upload the whole thing when it’s ready.

Whaddya think, is that useful for ya at all?

PS: Yea, one notice though. I did not check that on any mobile device as I do not posses a device capable of running UE4. Was tested only in the mobile preview. So, anyone willing to test that out, give me a shout!

1 simple material function and 2 less simple tick functions can add a bit of a definition for the mobile renderer’s lighting. It calculates lighting for vertex channel inside an actor which can later be filtered by any normal map to add some per pixel look. For the time being it traces only the level point lights (all of em, stationary, static and movable) no component lights yet. These have to be added manually, same as directional light. But, for example, for dynamic light when a pawn casts a spell, or fires something it is quite easy to add these as well.

First part shows the standard lighting model, pretty nice, but still dull as it only takes the color from the global illumination. Second part shows what happens when this material has it’s lights traced (3 lights in total, one directional light and 2 closest lights, you can add as many as you want). Third part, well, I don’t expect you to understand what’s happening there, no idea why it’s there anyway. But, I can provide the project.

I’m only wondering if I should give it for free or try to put it into marketplace :stuck_out_tongue:
Anyone interested?

walking thorugh the purple light looked ALOT better. Good work.

Nice, but how to change the light color (fake light) that get’s emitted?

**EDIT 1: **
got the color working dynamically now as well (thanks for this great tutorial)
My other question, can you elaborate on the Direction parameter? I don’t seem to understand on how the direction of the fake cast light is working.

EDIT 2:
I know this is a old topic but it has the most easy and nice looking fake dynamic lighting imho. I would like to know how a sphere could emit light in all directions (like the sun)

**EDIT3:
**Multiple light sources don’t work with the above setup, I’m trying to get it to work atm but just can’t wrap my head around it :frowning:

Can’t really help you out right now, I’ve figured much better and cheaper way of doing this but I’m on vacation away from my PC. Be back in two weeks or so, hit me with a pm then mate.

Thanks, i love this system and It works well (with 1 light source at the moment) Ill send you a PM in two weeks to remind you.

Again thanks for this great setup hope to hear from you in about 2 weeks.

Will this new method be posted here in this thread, or do I have to send a PM as well?

Hello i see your video with Warrior, and i see on your BP light sources.You use Point Light,Directional Light in game?But why your system named “Fake Lighting”, if you use Lighting in game?