Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Shadows-Only Light in HDRP?

Discussion in 'Graphics Experimental Previews' started by Jick87, Dec 30, 2018.

  1. Jick87


    Oct 21, 2015
    Would it be possible to have a light that only adds shadows to the objects it projects on? Like, the shadows would be visible but it wouldn't add any extra lighting/brightness to the object?

    I don't see any options in the light component that would allow this, but maybe with some shader trickery? I've been using Shader Graph so a solution that works there would be most ideal, but I'd settle for anything really.

    I tried messing with the "Affect Diffuse"/"Affect Specular" checkboxes on the light component but that just seems to disable all effect the light has. Or maybe that just makes it impossible to see visually since the shadows tend to be the same color as unlit parts of the object?

    And yes, it does need to be using lights, not tricky texture jobs or decals or similar. I need realtime shadows in this case that react to obstructions and such correctly. It has to be on a point light so it works in every direction.

    I understand that shadows are generally thought of as "lack of light", but I have actually achieved this effect in the old pre-SRP renderer before with hand-written shaders.

    I'm posting this here because it involves HDRP and Shader Graph and the like, which is all still experimental stuff.

    Last edited: Dec 31, 2018
  2. LT23Live


    Jul 8, 2014
    Did you ever find the answer to this?
  3. hugokostic


    Sep 23, 2017
    the lighting model is not crafted this way, however it's possible using a custom lighting model to produce this result