Search Unity

Question Add Fog to a shader

Discussion in 'Shader Graph' started by AlbertoVP, Nov 25, 2022.

  1. AlbertoVP

    AlbertoVP

    Joined:
    Dec 6, 2016
    Posts:
    42
    How can I add a "fog" (a plain color not affected by speculars, polygon orientation, lights,...) inside a surface metallic shader that I can control with a 0 to 1 value? It is possible inside shader graph? or a I need to create a custom shader (That I don't know actually) or a frament output? impossible?

    Thanks
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,063
    I don't see this as an option in 2021.3, while it definitely should be.
    You can calc the distance from view/camera postion to the position of the object and lerp to fog color that way