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

Anyway to disable environment light inside my shader??

Discussion in 'Shaders' started by JohnSonLi, Mar 20, 2018.

  1. JohnSonLi

    JohnSonLi

    Joined:
    Apr 15, 2012
    Posts:
    586
    I think the environment light (windows - > light settting) is built-in. So even when I don,t write any shader code to apply it, it is automatically applied.
    I want to disable it in my shader. Anyone helps me?
    thx.
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    Go to the mesh renderer and switch light probes and reflection probes to Off. Not sure if that's what you want, if it isn't, please clarify :)
     
  3. Zee_pso

    Zee_pso

    Joined:
    Nov 12, 2016
    Posts:
    31
    Two ways I can think of.

    One, roll your own lighting model, either by making a custom one inside the surface shader, or edit Unity's lighting model by downloading the built in Shaders from unity and modifying them.

    Two, the much easier way, which I just found out about (because I figured this had to be built in somewhere), use the "noambient" parameter in the lighting model settings.
    Example:
    Code (csharp):
    1. #pragma surface surf Standard noambient fullforwardshadows
     
    FamishedMammal likes this.