Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

Lack of Specular reflection after lighting finishes baking

Discussion in 'Global Illumination' started by Iron-Warrior, Mar 14, 2015.

  1. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    836
    Hey,

    Been fooling around with the new lighting system, and I'm having an issue where all the specular reflections disappear on my objects after lighting is finished baking. The specular reflects appear while the scene is baking, but upon completion they all go away. Is this a bug or an intended feature and I'm supposed to add specular reflections to lightmapped objects some other way?

    All of my objects are set to static. I've attached a pic of the scene while baking, after baking, and my lighting settings.



    and then after baking...





    Erik
     
  2. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    In "General GI" select "Directional Specular" unstead of just "Directional". But it's produces some black artifacts :(
     
  3. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    836
    That resolved the issue for the static objects, thanks!

    I can't seem to find a way to get specular reflections on non-static objects with light and reflection probes in a scene, though. When I delete the light probes/reflection probe the Directional and point light I have both give a specular reflection to non-static objects. It was my understanding that light probes were to global illumination information to a non-static mesh (and reflection probes real time reflections) but they'd still receive specular highlights from nearby lights. It's kind of an adventure figuring this all out, though.
     
  4. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    Light probes give you the diffuse light, reflection probes give you the specular light.

    If you want your baked light sources to show up as specular reflections then they need to be represented on the reflection probe cube maps. For example, if you actually have a bright light blub object where you light is coming from, then it will be rendered into the cube map and it will become a specular highlight on your objects.

    If you think about it, it's kinda weird to have light randomly coming from a point in space with no visual representation of why there would be light coming from it.

    Does that make any sense?
     
    srmojuze likes this.
  5. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    836
    Definitely. I guess I was mostly looking for a way to make the dynamic sun on the skybox represented in the light probe.

    Thanks for the reply, was worried it was a bug or something!
     
  6. Bravo_cr

    Bravo_cr

    Joined:
    Jul 19, 2012
    Posts:
    148
    Hi Zomby

    I'm in the same situation as Iron-Warrior, but I don't really understand your answer. If I add a reflection probe to the scene I still don't get specular in the non static objects. The only way I have to get that is having two directional lights lights (in a very simple setup), one bake only and the other realtime only. In this way I get the nice diffuse bounce lights form the probes and the specular from the realtime light. But this is a bit cumbersome, the ideal situation is having both things working when the light is in mixed. As iron-warrior says there is a short moment in the editor where you have specular and probes working in the same non-static object, but as soon as it finished you loose the specular term.

    This had happened since Unity 4, and I have never understood well why the decision to remove the specular when the probes are on. Doesn't have sense being able to use the diffuse lightning of the probes and grabbing the specular from a directional light?
     
  7. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    836
    Hey Bravo, Zomby is basically saying that any light source in your scene should have a corresponding real-world object representing it. So if you have a bright green point light, you should also have a bright green light bulb of some sort (a mesh renderer) at it's position, since in the real world all sources of light emit from an object of some sort.

    It would be nice if you could enable it though since I'm sure someone will have a use case of wanting a light without a mesh renderer, but it might just be a limitation of the technique Unity uses for their lighting. Being able to include the sun's reflection would be good though.
     
    srmojuze likes this.
  8. Bravo_cr

    Bravo_cr

    Joined:
    Jul 19, 2012
    Posts:
    148
    Thanks Iron-Warrior, now I get it.
     
  9. srmojuze

    srmojuze

    Joined:
    Mar 18, 2013
    Posts:
    127
    In my brief testing the past few days (luckily) I haven't encountered this bug. But it was a tiny, tiny scene.
     
  10. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    I get those black artifacts sometimes. It's usually caused by overlapping geometry.
     
  11. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    946
  12. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    10,962
    I guess you'll have to wait for 5.6 and proper mixed mode lights.

    Right now, you could switch the lights to realtime.
     
    tomekkie2 likes this.
  13. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    946
    Specular maps still work in 5.5, so I would rather stick to them or directional ones on static scenes, because of better look and performance.
    And wait for new 5.6 options.
     
  14. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    10,962
    I really wonder if directional specular mode is faster than a realtime light with realtime GI.

    And baked GI doesn't look particularly better than realtime GI.
     
  15. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    946
    You might be right. Realtime GI got much better since start of Unity 5.x. and even Unity tech demos use realtime GI rather than baked. I should be going to check that on some of my scenes.

    I have just made comparison here:

    https://forum.unity3d.com/threads/dynamic-lighting-vs-baked-which-one-is-better.186944/#post-2877226

    An my judgement is that the baked lighting option is - as we should expect - much better for static scenes.
     
    Last edited: Dec 7, 2016