Search Unity

Emission Shader not Emitting Light?

Discussion in 'Unity 5 Pre-order Beta' started by infinitypbr, Oct 30, 2014.

  1. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,850
    Hello,

    This pillar should emit a pink light -- the emission property works fine it seems. However, the wall behind it and the floor around it, doesn't seem to be getting any light. None of the objects are set to Lightmap Static and the pillar Emission is set to Dynamic Lightmaps.

    I've switched the settings around to see if I could elicit a different result, but found no change.

    Am I missing something to activate the emissive light?
     

    Attached Files:

    Ignacii likes this.
  2. willgoldstone

    willgoldstone

    Unity Technologies

    Joined:
    Oct 2, 2006
    Posts:
    714
    The clue is in your question 'none of the objects are set to static' - set your environment stuff to static, crank up the emission it should all be fine.
     
    Fab4 likes this.
  3. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,850
    Thanks -- that's how I had them set at the start, though, and again switching them back doesn't seem to change the emission. I've tried a bunch of combinations -- is there something on the emissive object, static or not, or the settings by the emissive selection in the shader?
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,824
    Crank emission really high up. You might want to up the cluster res a bit too in the lightmap parameters for the pillar.
     
  5. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,850
    I've had it set to 22. Putting it to 3000 doesn't add any light emission. All the other lights are off, so I would probably see something if there was just a little being emitted.

    I'm not sure what the cluster resolution is, however.
     
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,824
    With the pillar mesh selected, go Lightmapping -> Object. Add a new lightmap parameters, click edit, then inspector, then crank up cluster res to 1 see if that helps (it might not)
     
  7. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,850
    Didn't seem to do anything :/ However, that was also baking stuff it looked like? I'm hoping the light will be dynamic, since I'm having it pulse in and out.
     
  8. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,824
    You have things set up as lightmap static, right?

    Try removing the texture you have in emission and just use a color as a test.
     
  9. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,850
    What change should I expect to see? I mean -- it's not emitting light, but without the emission texture, it still won't emit light.

    The texture definitely shows up -- I have it scripting to pulse in and out, and it works visually as expected.
     
  10. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,824
    Remove the emission texture and just put in a color. It should emit light then.
     
  11. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,435
    Set the objects to Static, its at the top of the inspector. Lightmap Static, specifically.

    Er, just noticed you want it to pulse.. Haven't got into Dynamic objects yet.
     
  12. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,824
    It can pulse, even if it is static.

    We have to make it emit light first though.
     
  13. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,850
    OH. OK. So the solid color worked. However, my pulsing code (which included a color) seems to break the light. WIthout the code, the pillar stays lit and emissive.

    However, I've added the texture back in. At 400 the light is *barely* visible (which is why at 25 I thought it just wasn't working). I have to get it up to 50000 (!) in order to get the light I want, but then the texture is kind of silly looking, as the lines that are glowing are just crazy.
     

    Attached Files:

  14. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,824
    About the pulsing, I actually think it might be broken for beta9.

    (it will probably be fixed very soon though)

    *cough*

    About light not being enough, maybe see if the increased clustering helps (it miiiight), also raise the Global Illumination Slider in lightmapping a bit.
     
  15. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,850
    I guess I"ll just have to wait to get this effect then. Raising GI in Lightmapping helps, but not enough to allow a normal look to the object as well as actual light being emitted. Plus, changing that would affect other things in a negative way, so I don't' really want to do that.
     
  16. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,824
    They could have a light multiplier on the actual shader that doesn't effect the actual appearance.

    Maybe it's something that should be feature requested.
     
  17. Dweep

    Dweep

    Joined:
    Oct 8, 2014
    Posts:
    28
    I had a similar problem with weak emission but it got solved when I set everything to be in linear color space. Try to double-check that :)
     
  18. Kuba

    Kuba

    Unity Technologies

    Joined:
    Jan 13, 2009
    Posts:
    403
    What I would generally first check in such cases is the "GI - Emissive" scene view mode. That shows emission (in realtime lightmap space) that we pass to Enlighten for realtime GI. For realtime GI emission is currently rasterized at half the realtime GI resolution, so if you have fine detail in your emissive texture it might get lost.

    If you change the texture to white (or just remove it) do you get the expected result? If so, try to experiment with the resolution on the pillar (by providing another lightmap params asset in Lighting > Object tab) and use the "GI - Emissive" view to debug.

    Increasing the size of the pink lines (their area relative to non-emissive parts) is also an option.
     
  19. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,850
    The shot here on the left is just white in the emissive property, no texture. The one on the right is my texture, with a custom light map parameters with the GI all up to 5.

    I guess I just expected the amount of light to be greater than it's putting out? Even the white -- with that pure white beam, it seems like not much light is being produced.
     

    Attached Files:

    • emit.jpg
      emit.jpg
      File size:
      24.7 KB
      Views:
      2,525
  20. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    2,850
    Is the light value tied directly to the texture, or is it possible to somehow override the amount of light being emitted without changing anything else?
     
  21. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,107
    Is there aleady any docs about the GI baking parameters window?