Search Unity

Resolved Comparison acting up (or down)

Discussion in 'Shader Graph' started by harm-zesbaans, Nov 25, 2020.

  1. harm-zesbaans

    harm-zesbaans

    Joined:
    Mar 21, 2013
    Posts:
    3
    I was wondering if anybody has seen this before. I've added a simple gradient in a texture and tested the gradient curve in multiple software packages, it's linear. When I compare it to a simple float slider (0.5f) the Branch result is not in the center (but actually it is somewhere at the center at 0.2f).

    Am I missing something, or is this a bug?

    Screenshot 2020-11-25 at 21.15.33.png
     
  2. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    This happens because of the color space settings of your project or the sRGB color space mode of your texture. sRGB mode is intended to be used when your textures are in linear color space.

    So, check your project settings and your texture import settings.

    See manual:
    https://docs.unity3d.com/Manual/LinearRendering-LinearTextures.html

    Project is in Linear mode in the examples below.

    Same texture with sRGB off:
    Shader_Graph_image_sRGB_off.png

    And on:
    Shader_Graph_image_sRGB_on.png
     
  3. harm-zesbaans

    harm-zesbaans

    Joined:
    Mar 21, 2013
    Posts:
    3
    Thanks @Olmi, you are spot on. It was not a bug at all, just lack of knowledge on my side. Thanks again.