Plugging a "Color Output Socket" into a "Factor Input Socket" using the color's "Value" (HSV)?

posted to: Shading the Body

So, did I understand it right that plugging a "Color Output Socket" into a "Factor Input Socket" uses the color's "Value" from the "HSV Color Model" as input for the "Factor" and not the average (Red + Green + Blue) / 3 ?

  • spikeyxxx replied

    Wrong, it uses the Luminance  (would be the same as using a RGB to BW Node), not the Value!

    But almost nobody knows this ;) 

    Honestly: I'd avoid doing this.

  • Kent Trammell replied

    Ahh interesting! I do this all the time 😅

    What alternative do you recommend, Spikey?

  • Ingmar Franz(duerer) replied

    Thanks, spikeyxxx! How would you change the node setup in this lesson?  Understanding the handling of colors in Blender isn't easy because it's difficult to find correct in-depth descriptions of that. The "Blender Manual" unfortunately is often too short or "explains" terms by using the term itself. 

    PS: It's the same with the "Color Management" and the different "Color Models": What happens, when I for example select "sRGB" for "Display Device" conversion. Does it only apply a "Gamma Correction" or are there more calculations.

  • spikeyxxx replied

    @theluthier I didn't watch the timestamp where you did this yet, but it totally depends on what you want to do ;) It's just so unpredictable to plug a Color socket into a grey one, because you usually don't know what the Luminance of a Color is....

    duerer, I will get back to you when I've watched this lesson...As for the PS: watch those two links I send you, the article from Troy Sobotka and the "Color managment for humans" by Bartek Skorupa..I can't answer this from the top of my head ;) I have to re-read and re-watch those again and again...at some point I will know these things, but for now I am to afraid of saying something wrong ;)

  • Kent Trammell replied

    I wonder why the devs opted to use luminance as the conversion instead of HSV. The latter would have been way more intuitive, no?

  • spikeyxxx replied

    @ theluthier, I'm sure there is a good reason for that ;) Maybe it's standard practice?

    Anyway; duerer and @theluthier : in the video it doesn't make a difference, while there are no colors used in the Colorramp :)

    Here's an example with two colors that both have a Value of 1:

    Here's what OSL uses for Luminance:

    As you can see, if R, G and B are all the same, it doesn't do anything, but returning the value of R, G and B, or one of them, as they are all the same:)

  • Kent Trammell replied

    I'm so glad we have you around spikeyxxx to share (and understand) technical stuff like this. Thanks for digging into it!

  • Ingmar Franz(duerer) replied

    As you can see, if R, G and B are all the same, it doesn't do anything, but returning the value of R, G and B, or one of them, as they are all the same 

    I'm always happy when something can be simplified 😉!

  • spikeyxxx replied

    @theluthier 

    I wonder why the devs opted to use luminance as the conversion instead of HSV. The latter would have been way more intuitive, no?

    Actually it wouldn't, because the Value in HSV is only based on the highest value in RGB, so, if one of the RGB channels is 1, then the Value is always 1, no matter what the other two channels are...this means that you'd loose too much information from the color (that is also why RGB to BW  uses Luminance and not Value). Actually the Value in HSV is pretty useless for most cases, just like Lightness in HSL, which is the average between the highest and the lowest RGB channel...

    "Fun" fact: in the Compositor we have access to two more (different!) Luminances: the Y in both  YCbCrA and in YUVA.

    There are different calculations for Luminance, because it is 'perceived brightness" and therefore different for different people.

  • Kent Trammell replied

    spikeyxxx consider my mind blown 🤯😵

  • Ingmar Franz(duerer) replied

    @theluthier I think, spikeyxxx should write the "Cycles Color Management Encyclopedia" 📔📕📗📘📙📚😉!

  • spikeyxxx replied

    duerer I couldn't...ask Bartek (or Troy) ...

  • Ingmar Franz(duerer) replied

    spikeyxxx Then maybe as co-author together with Bartek and Troy 😉? In every case, thank you very much for your helpfull explanations 👍!