Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Help Wanted No emission with shader graph in LWRP

Discussion in 'Shader Graph' started by winnubstj, Jul 2, 2019.

  1. winnubstj

    winnubstj

    Joined:
    Feb 4, 2019
    Posts:
    5
    If I create a material and associate a new PBR shader graph I can set the emission, and the object will be brighter, but it will not actually emit any light on nearby objects. If I switch to a material with a standerd shader and set the emission then everything works as expected. In this example all objects are set to static.

    Interestingly, the "bloom" post processing effect does react correctly to the emission of the PBR shader.

    Am I missing something about how these shaders should work? or am I missing a setting somewhere?
     
    foxnne likes this.
  2. tonOnWu

    tonOnWu

    Joined:
    Jun 23, 2017
    Posts:
    79
    I'm having exactly the same problem. I used Fresnel and I played with different levels of Power, but nothing. I think that what you're trying to achieve is the Glowing Effect. I have researched a lot without any answer. I'm using Unity 2019.1.4.f1.

    BTW, I follow this tutorial of Unity step by step.


    Any help will be great.
     
  3. edgarwu1007

    edgarwu1007

    Joined:
    Aug 10, 2018
    Posts:
    1
    I have same issue too which the custom emission won't show in lightmap except I change to the default Lit one.
    In previous unity version, you can switch emission between Realtime and Baked, but in new 2019 version, this option has gone, I don't how to re-enable it or I suppose it default set as Baked?
     

    Attached Files:

  4. Steroy

    Steroy

    Joined:
    May 10, 2015
    Posts:
    1
    Not sure if this will help you guys but I couldn't get emission to work at all, you need to have a post processing volume set up for them to work it uses the bloom in the PP feature. Also had to toggle "Is Global" on.
     
  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,024
    you will have to write a custom editor or script that tweaks the material and its MaterialGlobalIlluminationFlags.
    something like this (custom editor code):


    MaterialProperty _Emission = ShaderGUI.FindProperty("_Emission", properties);
    if (_Emission.floatValue == 1.0f) {
    material.globalIlluminationFlags = MaterialGlobalIlluminationFlags.BakedEmissive;
    }
    else {
    material.globalIlluminationFlags = MaterialGlobalIlluminationFlags.BakedEmissive;
    material.globalIlluminationFlags |= MaterialGlobalIlluminationFlags.EmissiveIsBlack;
    }
     
  6. deram_scholzara

    deram_scholzara

    Joined:
    Aug 26, 2005
    Posts:
    1,029
    Alternatively, if you select the material you want to contribute to lightmaps, then change your Inspector panel to Debug mode, you can set the Shader Kewords to "_EMISSION" and the Lightmap Flags to "2"
    upload_2019-10-16_10-39-30.png

    Technically you don't need the Shader Keywords part, but it's good practice. Just setting the Lightmap Flags to 2 should be enough.
     
  7. Reid_Taylor

    Reid_Taylor

    Joined:
    Oct 9, 2019
    Posts:
    12
    Maybe late.... but in order to have a glow effect you need to have Post-Processing Bloom on.
     
  8. deram_scholzara

    deram_scholzara

    Joined:
    Aug 26, 2005
    Posts:
    1,029
    This isn't about the bloom effect - this is about light being emitted from Renderer surfaces, into the scene's lightmaps (global illumination).
     
  9. necro1895_unity

    necro1895_unity

    Joined:
    Sep 9, 2020
    Posts:
    1
    I struggled one week with that issue and last night i knew why my emission didnt worked. The PBR Master material uses HDR colors to control the emission intensity, so just add a color node with HDR mode enabled and increase its Intensity.
    upload_2020-9-9_8-0-20.png
    Result without multiplied HDR color
    upload_2020-9-9_8-2-41.png

    Result with multiplied HDR color
    upload_2020-9-9_8-1-49.png
     
unityunity