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

Baked Emissive shaders sometimes don't work

Discussion in 'Global Illumination' started by ArteyS, Nov 8, 2015.

  1. ArteyS

    ArteyS

    Joined:
    Dec 15, 2014
    Posts:
    16
    Hi,

    I don't know how else to explain this bug, but sometimes baked emissive shaders don't cast light correctly. I am attaching an image to show the example.

    This is a scene with about 60 light sources. 1 set of 30 downstairs and 1 set of 30 upstairs. My light sources are made up of geometric balls with the standard emissive shader applied to them. I am baking them into the lightmap, and I am using 1 directional light outside to adjust the overall brightness of the scene. From this default dark, to fully lit daylight. I've set the 2 geo lightcasting objects to important GI and set a custom setting for them both and raised the cluster resolution on them to 1. (Doesn't seem to make a difference.)

    I have the following problems.

    1. The geometry can't be any smaller than this, otherwise the global illumination doesn't even pick up these objects and therefore doesn't use them as light casters. So I've experimented for a week and these sizes are the minnimum at which they get picked up. why is that?

    2. Why does the ceiling above the lights look like they are receiving light in a certain surrounding grid block? It doesn't fall off naturally? It's like the surrounding block is counted for GI but nothing else?

    3. Why don't the light objects always cast the same amount of predictable light. As you can see by the examples. in some cases, no light is cast onto the ceiling, in other cases, there is.
     

    Attached Files:

  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,630
    Upping cluster resolution to 1 should make a difference.

    Do you have each lightsource as its own mesh?

    In general, if your clusters are way too big and your lightsource is much smaller than one cluster texel, then enlighten might miss it completely.
     
  3. ArteyS

    ArteyS

    Joined:
    Dec 15, 2014
    Posts:
    16
    Wow ok, I dont understand what a cluster texel is. I have my cluster res at 1. it doesnt make a difference, but makes the light contribution more intense. but it still misses sections of the surface area. No they are not seperate geo. I made them 1 combined big geo that has multiple mesh segments within it. When I say mesh segments, all i mean is, all the individual polygon balls have been combined into 1 geo mesh within the art package
     
  4. ArteyS

    ArteyS

    Joined:
    Dec 15, 2014
    Posts:
    16
    Here is an update, I have seperated the geo into their seperate individual objects. Centered their pivots so it can't be doing something funky under the hood based on the pivot point. But it still doesn't work. As you can see by this additional screenshot, the upstairs section has the biggest issue for some reason. it doesn't appear to cast light on sorrounding objects at all during this last bake. Downstairs are lit correctly.
     

    Attached Files:

  5. ArteyS

    ArteyS

    Joined:
    Dec 15, 2014
    Posts:
    16
    *bump* anyone?
     
  6. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    And the white spheres are set to Important GI? Can you show the scene in the clustering scene view if you have access to 5.3 beta?
     
  7. rocket5tim

    rocket5tim

    Joined:
    May 19, 2009
    Posts:
    242
    I'm seeing pretty much the same problems that @ArteyS is reporting. Except that I'm trying to use Emissive materials in a realtime setting - not unlike The Courtyard lighting project that Unity posted recently.

    In an empty scene with standard Unity prefabs, I can get Emissive objects to cast light on surrounding primitive objects. But as soon as I put a .fbx object into the scene, all of the emission light cuts out. I hide the mesh object and the lighting returns (continuous baking is on).

    Further, in that basic scene with just Unity prefabs (static), if I move the emissive object (a static sphere with Standard shader, emission set to 3) around and wait for the light calculation to complete, the emissive light will sometimes go away entirely - move the object a little bit, wait for light calc to finish and the light may return.
     
  8. sonnolo

    sonnolo

    Joined:
    Feb 22, 2015
    Posts:
    26
    I ave similar problem,ave 30 waylight with emissive material and use realtime GI all objects are same model,texture,static mesh and material settings but just 7 work done and get emissive illumination.......no solution?
     
  9. ChayChay

    ChayChay

    Joined:
    Sep 10, 2014
    Posts:
    12
    I am currently working on a large project and am trying to do a night time lighting effect for a whole city. It seems that every time I baked (even if I change absolutely nothing) I get different results with my emissive lights too. This can be frustrating seeing as when I do get it right, if I move or change something somewhere else it shows different lighting the next time I bake. Now, I am only using emissive materials on basic unity objects with no 2D texture to control emission (every time in the past we tried to have a texture map for the emission channel it gives almost no effect unless you blow out the texture, but I digress..) I understand if the realtime lighting or precompute emission differed, but why are we all experiencing such (seemingly) strange results. I also have times like Artey S where only half my emissive objects even light up at all.

    Anyone have some clarity on why emission doesn't bake well or ways to get more consistent results?
     
  10. Ziplock9000

    Ziplock9000

    Joined:
    Jan 26, 2016
    Posts:
    360
    I'm having a similar issue with Precomputed Realtime GI. I have 3 emissive objects with only 2 of them emitting light correctly. The one that isn't working is a thin (ish) rod that is only 1/16th of a unit in size, so I thought it might be my Realtime resolution. I upped it to 6 and it still isn't working.
    I'm not using any baked GI
     
  11. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    I may be experiencing something similar to this. My entire scene is lit with emissive geometry. I didn't have issues with it before today, but after doing a clean Light Bake with Dynamic GI, I started getting weird results. I ended up purging all my geometry and reimporting it and setting up my materials again, and things are almost back to working order with a few weird exceptions.

    Light probes don't seem to be consistent under similar circumstances. In the attached screenshot, the light probe on the left should be fully lit as it's just beneath a bright light. Instead, it's reading as fully dark.
    Screen Shot 2016-04-21 at 2.56.54 PM.png

    Screen Shot 2016-04-21 at 3.00.07 PM.png

    It's almost as if this one particular ceiling light is being ignored by GI, despite the fact that it's actually the same mesh as every other ceiling light in the scene.
     
    ChayChay likes this.
  12. Epseni

    Epseni

    Joined:
    Jun 1, 2016
    Posts:
    5
    I still have this same problem with 5.6.0f3. I am using emissive objects to light the scene and results vary on each lighting generation. Sometimes rooms go pitch black, I move the light source just a little bit and it might work again. I started to look for help now because it seems to get worse. I really struggle with building with 10 rooms, atleast 1 is not lighted properly after new lighting calculations.
     
  13. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,630
    Can you show how the clustering view looks? It's probably that there aren't enough clusters to cover the lights.

    In which case you could separate those meshes and use custom lightmap parameters to raise the clustering a bit on those meshes.
     
    Schneider21 and Epseni like this.
  14. Epseni

    Epseni

    Joined:
    Jun 1, 2016
    Posts:
    5
    Thank you so much AcidArrow, this was exactly the issue. I created a new custom lightmap parameter scheme for the emissive objects and raised the resolution to 5. This way the emissive meshes consistently get a cluster on them, instead of being hit and miss on each lighting generation run.

    You can also fix the issue by raising the indirect resolution for overall GI, but I really dislike the results on 1 texels per unit and higher. Walls gets "stained" lightmaps instead of being reasonable clean looking at 0.6. Also calculations are starting to take way too much time higher you go.

    I hope that some day there will be better baking option for imported geometries for VR use. So far emissive lighting is my only option from FPS and quality point of view. Baked lighting looks horrible with meshes that has automatically generated UV maps.