Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Dynamic GI color

Discussion in 'Unity 5 Pre-order Beta' started by Cec, Nov 5, 2014.

  1. Cec

    Cec

    Joined:
    Apr 7, 2014
    Posts:
    92
    Hello,

    I tried the new dynamic GI system, and it seems to work flawlessly, but I was a bit disapointed to see that when I change material color (via script or manually) in game, the GI is not updated. If I do it in the editor, it works perfectly.
    The lighting is realtime, not baked.

    Am I doing something wrong, or is this a misunderstanding on my part ?

     
  2. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    i think there's a Dynamic GI API to tell the GI that a material has changed.
     
  3. Cec

    Cec

    Joined:
    Apr 7, 2014
    Posts:
    92
    Yes. I also thought about it, but didn"t find any.
    Is the official API documentation reference is already updated with Unity 5 API special features ?
     
  4. nintari

    nintari

    Joined:
    Jul 7, 2009
    Posts:
    100
    I'm interested in this information as well. Ran into the same problem. If you find an answer please update. :)
     
  5. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    I checked, you can use:
    DynamicGI.UpdateMaterials
     
  6. nintari

    nintari

    Joined:
    Jul 7, 2009
    Posts:
    100
    Awesome. Thanks!
     
  7. Cec

    Cec

    Joined:
    Apr 7, 2014
    Posts:
    92
    Thank you very much. That did the trick.

    Where did you get those API infos ?
     
    Last edited: Nov 5, 2014
  8. nintari

    nintari

    Joined:
    Jul 7, 2009
    Posts:
    100
    Hm, actually it didn't fix it for me. I must be doing something else wrong.

    EDIT: Ah, I see what it fixed now. My issue is slightly different in that I have to select the shader in the inspector while the game is running before my script will kick in and change the shader values. Once I select it, the shader values update without issue. But it won't update upon initially hitting play--only after selecting it in the inspector.
     
    Last edited: Nov 5, 2014
  9. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    no problem, I did a quick search in the documentations, I was sure there was such API as aras talked about it somewhere,
     
  10. Cec

    Cec

    Joined:
    Apr 7, 2014
    Posts:
    92
    Did a research in the doc too, but since the API only covers until v4.5.x (http://docs.unity3d.com/ScriptReference/40_history.html) , I couldn't find any DynamicGI class. (Nor with the search engine).
    Is there a documentation page specific to Unity 5 somewhere or is it me ? :confused:

    Thanks again Shkarface Noori.
     
    shkar-noori likes this.
  11. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,665
    FYI: The Documentation is also bundled with every Unity installation for Offline research.
     
    shkar-noori likes this.
  12. Cec

    Cec

    Joined:
    Apr 7, 2014
    Posts:
    92
    Sorry,
    As I suspected : it's me.
    I will go to sleep tonight a little bit less stupid thanks to you.