9
$\begingroup$

I've been trying to render a heightmap using cycles.

To that effect, i've set up:

1) A sculpted plane squeezed between -0.25 and 1.0 altitude (z-axis) in Blender.

2) An orthographic camera scaled to perfectly match the plane.

3) A cycles emission material set up in such a way that its final emission value is geometry.blue (z-axis position) -> math.add 0.25 -> math.multiply 0.8.

my setup in blender

I render this to a 16-bit grayscale png image.

the resulting heightmap

The issue is: The resulting heightmap's pixel values are slightly (or not so slightly) wrong - i.e, different from what the math should say.

For example, while math says that vertices at position ~0 in Blender should produce heightmap values around (0.0+0.25)*0.8 = 0.2 , in the resulting image, those areas are ~0.5; while math says that 0.94 should translate to 0.95, in Gimp when sampling those pixels i see their HSV Value as 0.89.

Upon some asking around in #blender, i've eliminated the following possible sources of trouble:

  • World (and its material)

  • Sky pass in render layers

  • Material color is set to 1,1,1

  • I've eliminated sections of the plane that violated the bottom boundary.

None of these fixed the problem.

If anyone feels like poking around instead of guessing around, i've also put the blend file to here.

$\endgroup$

1 Answer 1

15
$\begingroup$

This is probably due to blenders color management. You're expecting a linear relationship between the height of that part of the object and the colour of the pixel. However whilst the luminosity/emission strength of that pixel should be correct, when you render your image these values will be converted to an sRGB color space, and the values will not be correct.

sRGB value vs emission

What you need to do is set your display device to "None" in your colour management settings. This will leave your rendered values as Linear Values and not convert them to sRGB.

linear value vs emission enter image description here

$\endgroup$
1
  • $\begingroup$ So helpful!! I've been struggling with gamma-correction problems for a while! $\endgroup$
    – Matt
    Commented Feb 20, 2014 at 16:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .