3
$\begingroup$

I am using a renderlayer with some vertex colors to render some masks. I have an object with a vertex color layer. The entire object is set to RGB values of .25 each (using set vertex colors command.)

The vertex colors are used in a material via an Attribute node. The Fac socket of the attribute node is connected to an emission shader. This is rendered on it's own layer using a material override. In the compositor, the Emission output of the renderlayer node is connected to a viewer node.

The problem is that after rendering, when I look at the image in the Image/UV editor and click to view the individual pixel values, it says my R, G, and B are .05098 each, not .25! The CM R, G, and B are .2503, and the HSV value is .25

What's going on? I need to use this mask into a math node and get a proper .25 for the math to work correctly.

$\endgroup$
  • $\begingroup$ Stuck on the same problem... For now, i manually reajdust values with pow(channel, 0.45188), which maps 0.5 in vertex color editor to 0.5 in Attribute node, but... that`s weird. $\endgroup$ – IPv6 Aug 9 '17 at 9:54
  • $\begingroup$ @IPv6 please ask your question on a new post. You may include a link to this question as refference. $\endgroup$ – cegaton Aug 10 '17 at 2:52
  • $\begingroup$ I wouldn't be surprised if this is related to or directly caused by reference frame translation. In short, the "real" color calculated by Blender has to be mapped to a 0-1 (0-255) range for display on a monitor. This requires some assumptions, one of which is "what value is grey?" that may lead to middle values (like 0.25) being scaled in order to "fit" on a screen. EXRs are (mostly) unconstrained, so they don't have to scale to a 0-255 range. I'd recommend rendering to an EXR, loading it into a compositing setup in Blender, and seeing if the values are correct there. $\endgroup$ – Matt Aug 10 '17 at 16:21
2
+50
$\begingroup$

This is related to https://blender.stackexchange.com/a/87583/29586

The Vertex Colors are held as 8-bit sRGB values. This means that, say, 50% Red is not held as 0.5 - as the sRGB color space is optimised to make best use of the 8-bit values (see https://en.m.wikipedia.org/wiki/SRGB). This is similar to the Color Data/Non-color Data setting on an Image Texture node - but the Attribute node used to retrieve the 'raw' Vertex Color data (which will be held as 8-bit sRGB values) does not provide such a color space translation. You will need to manually convert those values as you have already discovered.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.