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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Dynamic GI and Point Lights

Discussion in 'Unity 5 Pre-order Beta' started by Seith, Dec 1, 2014.

  1. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Hello, I have a simple question: Does dynamic GI in Unity 5 work with point lights? I hear a lot of things about using a dirrectional light for outdoor environments lit by a sun-like source, but I'm also interested in interiors. Which in my case means torch-lights (using point lights) and other fire-based sources...
     
  2. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    225
    I asked this question some time ago, it won't be in 5.0 but they want to implement it, so it's in the plans. Im looking forward for this, too.
     
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    It does work. Some GI coming from it though goes through objects and depending on the situtation it might look weird.
     
  4. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    225
    They not implemented it, but hey, F*** it, it works for ya <lol>
     
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    What are you talking about?

    What doesn't work is "Indirect bounce light shadowing" which is very different from "GI doesn't work".
     
  6. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    225
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    And it DOES.

    The only thing that doesn't is "Indirect bounce light shadowing" which means some GI might go through an object.
     
  8. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Thank for your replies, guys... :)

    So point lights do produce indirect lighting (bounce light) but it leaks through the meshes. Which is of course an undesirable effect.

    Does this mean that dynamic GI is only currently fully supported for directional lights? In other words is it possible to have GI with light sources other than the sun (an no bounce-light-going-through-meshes artifacts)?
     
  9. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    To be perfectly clear. What happens is this:

    confused2.jpg

    You can clearly see on the left side that there is bounced light, hence GI is working, but you also see light on the right side, when there should be (almost) darkness.

    Subsequent bounces of light are fine. So if for example, you have a spotlight hitting a wall at an angle, there might be leaks to the other room (assuming there is another room behind that wall), but otherwise it will look just fine.

    So, with knowing what happens, you can work around it. In most cases it really isn't that noticeable (if you are not making a scene specifically to showcase the problem, chances are, there should be light bouncing everywhere, so in reality there will just be more light in some areas than what there should be).

    And Kuba said that they will fix it, just not for 5.0.

    Directional lights and emmissive meshes don't have this problem.
     
    hippocoder likes this.
  10. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Thank you @AcidArrow for taking the time to explain with a picture. That's very clear indeed. Would you mind quickly adding let's say an emissive cube instead of the spotlight, just to see the difference, please?
     
  11. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    Sorry, I originally made that image a while ago for a different thread so I don't have that scene handy. And I'm doing something else right now.
     
  12. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    For an emissive cube all occlusion will work 100% accurately.

    I would expect occlusion in the center of the plane on the right. So the plane on the right should be dark / darker in the center.

    Generally, when you use realtimeGI and you have lots of small light sources, using emissive surfaces is a good idea because it also comes effectively for free on the GPU.

    Additionally, when you disable shadows on the point light / spot light it will work perfectly with 100% accurate bounce already. Having tons of small point lights with shadow casting is generally a bad idea for performance anyway... Because we effectively have to render a shadow map for each of the 6 faces.

    That said, there are definately use cases for shadow casting point light / spot light and bounce light not leaking, so that is something we want to support later in the 5.x series.
     
    p87 likes this.
  13. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Thanks for weighting in Joachim. I am interested in GI for the game's torches (within dark dungeons).



    Their point light flickers and trembles, inducing nice dancing shadows on the stony walls and cobwebs. In the case of this picture a dark cell lies on the other side of this wall. So I guess it would get lit by the bounce light from this torch. That's obviously an issue.

    It seems that what you describe as not being supported (point lights with non-leaking bounce light and shadows) is exactly what I need... :(

    And if I understand correctly using the emissive property of a mesh's material would indeed work as a source of light but it wouldn't cast any shadows. So I'm not sure how to bypass that limitation.

    Or could there be a way to somehow dissociate light source and shadows (different methods/objects), while still keeping them in sync?

    I'm sorry if my questions seem very naive but to port Ghost of a Tale to Unity 5.0 is going to probably require some work and I would like to understand as much as possible before I attempt to do this. Thanks...
     
  14. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Hi @Seith,
    Until shadowing for point lights is available, I recommend that you try disabling the offending light source outside, when the player is located in the adjacent cell.
     
  15. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Thank you @KEngelstoft. Yes, that's what I'll have to do for now. I hope you guys can get to this fairly soon as proper shadowing for point lights really is important (I believe directional lights are already working in that regard)... :)
     
  16. cosmogonies.net

    cosmogonies.net

    Joined:
    May 8, 2013
    Posts:
    7
    Hi,
    What could be great, is to replace our pointLight with lowpoly spheres, with high emissive, but hiding the mesh off the renderer.
    Did anyone know a method to do that ?
    Right now, if I disable the mesh renderer component, the material also is ignored and then the emissive light disapear...
    Thanks for any help !
     
  17. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    @cosmogonies.net At a guess I think you could do that by putting your spheres on a special layer, and having your main camera ignore that layer in it's rendering mask. Personally I would rather use a real point light with GI turned off plus one of these invisible GI spheres. I think that combination should look pretty good.
     
  18. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    225
    Pardon for me saying there is no support for point lights GI, for me lights other than directional always means dynamic lights, not static baked. I was thinking dynamic point lights for GI.