Search Unity

unity_FogColor not working in Unity 5?

Discussion in 'Shaders' started by reduktion, Mar 23, 2015.

  1. reduktion

    reduktion

    Joined:
    Sep 27, 2012
    Posts:
    25
    Hi

    In Unity 5, I cannot access the fog color using uniform fixed4 unity_FogColor; anymore. Compiling the shader gives the following error:

    Shader error in 'CS/Only Color Overlay FogColorBlend': 'unity_FogColor' : redefinition at line 24 (on opengl)
    Compiling Vertex program


    Is this a bug?
     
  2. reduktion

    reduktion

    Joined:
    Sep 27, 2012
    Posts:
    25
    The solution is really simple: uniform fixed4 unity_FogColor is already defined by Unity and works just fine. Obviously you cannot define it again.
     
    angelonit likes this.