I'm trying to recreate color ramp node in ue5, so I need to understand what's happening when I'm passing values from texture output pin to color ramp's factor pin. It's just can't be a color because factor is scalar value, so what is it?
Asked
Active
Viewed 24 times
0
-
This is the mean of the color component (RGB) values. – lemon Jan 08 '24 at 18:50
-
@lemon it's luminance, not average: $v = 0.2126r + 0.7152g + 0.0722b$ – Markus von Broady Jan 08 '24 at 18:54
-
@MarkusvonBroady, thank you, I did not know that (of course...). and pff.. I had upvoted this answer in the past... – lemon Jan 08 '24 at 18:55
-
@MarkusvonBroady yes, but I want to clarify, is the formula v=0.2126r+0.7152g+0.0722b working for all cases with colors? – Сергей Jan 08 '24 at 19:02
-
@Сергей not sure what kind of cases you have in mind, to my knowledge, yes, it always works and in the linked question you can see a test case proving that. – Markus von Broady Jan 08 '24 at 19:12
-
@MarkusvonBroady ok, thank you very much for your help. – Сергей Jan 08 '24 at 19:18