Search Unity

I Think I Found a Bug In Metallic Rendering

Discussion in 'Editor & General Support' started by King-Hayve, Feb 7, 2016.

  1. King-Hayve

    King-Hayve

    Joined:
    Aug 28, 2015
    Posts:
    7
    Hi, I believe I've stumbled upon a bug in the shaders while trying to keep my terrain from looking shiny. I'm going to try to explain this as best as possible since I do not know much about shaders.

    I was editing the terrain shader trying to see if I could make any small changes in the code to keep my terrain from looking shiny, and one of the changes I made was to take manual control of the metallic value like this:


    When experimenting with this value I found something that doesn't seem right about the way Unity renders the metallic value.

    From looking at the effects this value has on my terrain I think the metallic effect is supposed to be comprised of 2 basic effects that I will call "Light effect" and "Dark effect" as seen in these pictures, the Dark effect seems to render correctly based on the value, but the Light effect seems to be reversed from what it is supposed to be.

    This is with o.Metallic set to 0.0, The light effect generally brightens the whole terrain in this picture but I highlighted the more prominent parts.:


    This is with o.Metallic set to 1.0:



    These next pictures I hope will explain the problem sufficiantly:





    It seems to me that inside the rendering code the value for "Light effect" needs to be multiplied by -1 to fix this problem, so that it is at full strength when o.Metallic = 1.0 and not when it is at 0.0

    Hopefully someone will understand this? If I am right I would very much like this bug to be fixed so that my terrain will not look shiny even when it's metallic value is 0.0

    Thank you for reading.