Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question No changing GI from emissive material on static objects

Discussion in 'Global Illumination' started by Huxii, Dec 29, 2022.

  1. Huxii

    Huxii

    Joined:
    Sep 15, 2018
    Posts:
    36
    Hello,

    I am having some neon lights in my scene. They have only emissive material for Illumination, cause I try to avoid point lights to enhance performance.

    Unfortunately the lights are not changing the illumination on any static objects in the scene in game, when I change the emission color or intensity. Outside of the game it works, but not inside of the game.

    Both picture are made in game. The first has white emission color, the second with black. With the black color, the scene should be pitch black, but the illumination is still the same as with the white color. Same behavior when I change the emission intensity.

    upload_2022-12-29_13-56-25.png

    Is this a correct behavior? How can I make it work?

    Thank you
    Huxi
     
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    I suppose you are using Enlighten Realtime GI to achieve this, right? If what you are trying to achieve works in the editor, but not in a standalone player build, it could be a scripting issue. Make sure that you call DynamicGI.UpdateMaterials if you want your emissives to update the GI.
     
  3. Huxii

    Huxii

    Joined:
    Sep 15, 2018
    Posts:
    36
    Hello @kristijonas_unity . Thank you fot the answer. It works now. I tried it before with the MaterialPropertyBlock but now I am creating a new instance of the material what has an effect on the batching. Is there a way to use MaterialPropertyBlock also with this methods or optimize the batching?

    Thank you
    Huxi