6

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.

Ascalon
  • 6,579
  • 8
  • 55
  • 121
  • 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. – IPv6 Aug 09 '17 at 09:54
  • @IPv6 please ask your question on a new post. You may include a link to this question as refference. –  Aug 10 '17 at 02:52
  • 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. – Matt Aug 10 '17 at 16:21

1 Answers1

7

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.

Rich Sedman
  • 44,721
  • 2
  • 105
  • 222