Lightmaps/Animated lightmaps and dynamic shadows - how to mix ?

First question - can UE4 do animated lightmaps ? (a la Quake) Is there any info on how to achieve that?

Second question - how do I have to set up a scene, where lighting is baked, but animated/dynamic objects (characters mostly) cast simple dynamic shadows (blob shadow would do, but a better shadow mobile VR friendly would be desirable), probably from a single light source (direct light maybe, that doesn’t affect level geometry).

Thanks.

No, UE4 does not support animated lightmaps. For your second question, use a Directional light that is set to Stationary

Hmm… I thought I read somewhere Gunjack devs used animated lightmaps. I figured it they added such implementation, they might have submitted it to Epic.

I don’t see the need for animated lightmaps for Gunjack, it’s just a space shooter. Depending on the situation, animated lightmaps won’t necessarily be a very efficient, and you would also have the problem of storage space since that would potentially mean a lot of lightmaps.

They used it for cockpit lights.

I am pretty sure storage isn’t an issue nowadays. Processing power on Gear VR is, although I don’t know if animated lightmap will create massive influx of draw calls or not.

How about having an extra surface (over lightmapped surface, slightly offset) with RGBA texture that represents “light”. Is it possible to animate RGB curve? For example, in Doom 3, I can have one of the material stages having gl_src_alpha / gl_one_minus_src_alpha blending, RGBA texture with “light” (for example, red circle fading from center to the edges) and affect RBG value of that material stage via curve (let’s say from 0 to 1 back to 0 and loop it) over time. That will make it looks animated lightmap.

Using it for cockpit lights isn’t an option because there’s the main directional light that’s affecting the cockpit as well as any gunfire lights. It’s unpredictable which means you would have great difficulty figuring out how you could represent it with animated lightmaps. Also, the lighting in there isn’t terribly complex so it’s not really necessary.

Having more than one set of lightmaps could easily get out of control, even if they’re compressed.

And no, that wouldn’t blend correctly, there’s directional lightmaps that are still needed and the engine needs to know how to integrate baked lighting with the dynamic lighting.

I think you are thinking in terms of PBR and realistic lighting :slight_smile:

I don’t really care if it looks life-like correct. All I need is animated “lights” (fake lights) a la Quake-2-Christmas-tree without exceeding drawcalls limit on Gear VR (Galaxy S6 smartphone) and not bogging performance down with real-time lighting.

You can animate emissive lighting, like if you have a button you want to glow or blink that’s just fine, but the actual shadows are a different matter.

It won’t affect draw calls, draw calls would be affected by the number of materials and objects.

I think that’s what I need. Are there any tutorials / docs about this method ?

If you want a blinking light you can take your emissive map (a texture showing which areas should light up) and then multiply that by a Sine node in your material: Math Expressions | Unreal Engine Documentation

Otherwise just plug it into your Emissive slot in your material, or multiply it by a constant to adjust the intensity

Recently I have implemented multi-lightmap dynamic blending in UE4.

Hope it help you.

Is 4.11 plugin coming soon?

Also, could you please make a video showing how to work with your plugin, starting from setting up scene to bake various lighting conditions, saving them and then working with them through BP ?

Thanks, that would work for blinking lights.

Can someone take this https://github.com/AlanIWBFT/UnrealEngine and turn it into a plugin ?

That’s actually very cool

This is very cool! Are cubemaps and probes also changed? Or are you stuck with one set of cubemaps and probes?

Not sure and the author is MIA :confused:

Blending between different skylight cubemaps is implemented in official UE4, using bp function SetCubemapBlend.
MLDB has considered about probes, they are called indirect lighting cache in UE4.

MLDB needs modification in UE4’s base pass renderer, which makes it impossible to turn MLDB into a renderer plugin, since UE4’s plugin APIs are not open enough to do so now.

That’s sad :frowning: Have you tried submitting pull request? Maybe they can make it a standard features of the engine.