How to use Realtime Emissive light from Material on Unity 2021.3.10

Hi Folks,

We are working on a game with a lot of neon lights. And we achieved the effect by baking emissive materials and adding points of lights around these.

However, in the emission material property, there is a drop list where you can select the type of GI contribution. Baked, Realtime or none. And in the documentation, it is said that if we set it to Realtime, we should be able to illuminate game objects in realtime.

https://docs.unity3d.com/Manual/StandardShaderMaterialParameterEmission.html
• Realtime: Unity adds the emissive light from this Material to the Realtime Global Illumination calculations for the Scene. This means that this emissive light affects the illumination of nearby GameObjects, including ones that are moving.

As you can see in the attached picture, there is no light contribution in the scene from that emissive material.

Hope there is a work around to make it work, that will help us a lot.

Thanks

8546411--1142315--Realtime Emissive Light.PNG
8546411--1142321--emissive.PNG

Hi, this "Realtime" mode is for Enlighten (Precomputed) Realtime GI.

Enlighten Realtime GI supports:

  • Static geometry contribute & receive GI (emissive surfaces illuminate the scene)
  • Dynamic geometry receive GI from Light Probes
  • Dynamic lights (move/change lights, change emission color)

Thank you wwWwwwW1 for your answer.

But still, didn't get how to make it work even by following the documentation. I tried to using Realtime Lightmaps and with use of Light Probes and Reflection probes. Emissive material doesn't seem to be generating light on dynamic objects in realtime.

I will keep searching...

[quote=“IdeaLump”, post:3, topic: 898533]
Emissive material doesn’t seem to be generating light on dynamic objects
[/quote]

Hi, you can try (might not need to do all):

  • Increase the lighmap size of emissive objects.
  • Check Prioritize Illumination under Mesh Renderer.
  • Increase the indirect resolution in the lighting pannel.

Note:

  1. Only lightmapped objects will contribute to GI. Emissive objects should receive GI from lightmap and have a higher lightmap resolution.

  2. If you need to change the emission color, you should call this:

// Mesh Renderer.
public Renderer renderer;

// An example to update the emission color & intensity (and albedo) every frame.
void Update()
    {
        RendererExtensions.UpdateGIMaterials(renderer);
    }

Done the above and still not able to see the effects on Dynamic objects. But your note intrigued me. When you say "Only lightmapped objects will contribute to GI", you mean also dynamic objects should have real-time lightmap to be able to interact with emissive light?

If so, should we bake the object and assign a lightmap to it via a shader for example ?

thank you for your time

Btw, Realtime lightmap color from emissive material indeed changes during runtime. It's just that I'm unable to see reflection on a dynamic object from that specific material

[quote=“IdeaLump”, post:5, topic: 898533]
you mean also dynamic objects should have real-time lightmap to be able to interact with emissive light?
[/quote]
Hi, dynamic objects don’t need to be lightmapped.

They should receive indirect lighting from light probes. 8571578--1147655--DynamicObjects.gif

[quote=“IdeaLump”, post:5, topic: 898533]
Done the above and still not able to see the effects on Dynamic objects.
[/quote]
Maybe you can check the lightmap (texel) density on emissive (static) objects.

Set scene shading mode to indirect GI:

8571578--1147658--LightmapDebug.png

8571578--1147652--IndirectPreview.png

If the texel density is too low, you may not able to see the emissive lighting on static objects.

If there are only few sparsely placed light probes in the scene, emissive lighting may not able to illuminate dynamic objects.

Example (No need to place light probes uniformly):
8571578--1147673--LightProbes.jpg

Note:
Increasing the texel density may increase the precomputing (baking) time.

Never placing light probes inside something like walls. (they will contain “black” indirect lighting, and then provide wrong interpolated results)

I suggest placing more light probes to areas with strong indirect lighting changes, such as the surrounding of (strongly) emissive objects.

1 Like

[quote=“IdeaLump”, post:6, topic: 898533]
Btw, Realtime lightmap color from emissive material indeed changes during runtime. It’s just that I’m unable to see reflection on a dynamic object from that specific material
[/quote]
Sorry that I did not explain clearly about when should we call “UpdateGIMaterials()”.

Enlighten (Real-time GI) supports textures (images/videos) as emission source, but will not update them unless we call “UpdateGIMaterials()”.

An example of using textures (images/videos) as emission source:

Disclaimer: No need to buy this asset store content (and it’s not mine), I’m just sharing an example of “UpdateGIMaterials()”.

https://www.youtube.com/watch?v=MQMXt7eJyMc

Hoping this information can be helpful for your project! (Perhaps billboards)

2 Likes

Thank you so much wwWwwwW1 for your detailed answer.

The solution was that I didn't have enough light probes in the scene. So when I duplicated them as you set them in the picture you sent, IT WORKED!

However, It also worked with Baked Emissive. Dynamic objects are also lit by the baked emissive, which means that Realtime emissive is only to be able to change the color when call "UpdateGIMaterials()", right ?

In all cases, the problem is solved, thank you so much for your help and patience

1 Like