Linear Gradients

Question Materials and Textures

Why do linear gradients never seem to work as expected in the shader editor? For instance if you create a gradient node then use a color ramp node afterwards and add an extra color point to the middle of the color ramp it is never a perfect mid gray (e.g. value 0.2) and shouldn't 0.5 be a perfect mid grey since 0 is black and 1 is white? 


I understand that if I change to RAW it will work as expected but then the colours for everything else in my scene are wrong? Is there some sort of conversion node to help with this? Currently I find myself creating a "true" gradient in photoshop then importing it as a shaderless image. Any advice / tips for this would be very helpful.

1 love
Reply
  • Martin Bergwerf replied
    Solution

    Hi sswitch23723 ,

    The problem is not the Linear Gradient Texture, that is perfectly linear.

    The problem is the colors (or the way human eyes work); an RGB of (0.5, 0.5, 0.5) is half grey, but it  is not visually half grey, but Adding two half greys (ie: RGB (0.5, 0.5, 0.5) in Blender gives a perfect white. Adding two visual half greys does not give a perfect white. Raising everything to the power of (about) 2.2 (or using a Gamma Node) will give give colors you'd expect, but you'd have to 'gamma correct' before and after each math operation done on colors (think Blend Modes, for instance).

    Gradient.png

    This is a rabbit hole, tread carefully 😉


    2 loves
  • Dwayne Savage(dillenbata3) replied

    This is a complex topic. Note: you would get better results using standard instead of raw. Now when using filmic around 0.69782 is 50% grey on Linux mint cinnamon DE. I'm not sure if it's the same on other OSes. So some things to consider.

    1. You have the gradient texture. Linear(I think ease gives better results). Then It's processed by a color ramp. Are you using fac or color output of gradient node? They produce different results when passed through the color ramp. Then there's the processing of the color ramp. Ease gives better results than linear.

    2. This then gets processed by the shader node which takes into account global lighting and light objects. 

    3. Then you have color management which then adjust the colors.

    4. Then there's the display/monitor processing. I mention this because you brought up Photoshop and "true" gradient. Photoshop's color management uses a color profile bases on your video card and display. On top of that it has a gamma correction that is set when you install Photoshop. So it's not a true gradient. it's a gradient that has been calibrated to your specific GPU and display/monitor. Blender on the other hand uses a straight display/monitor color profile.(by default it's sRGB)

    1 love