1
$\begingroup$

I'm creating a script that produces height map from a mesh.

Testing it, I remarked strange rounded tiling... so I thought it was a bug in my code (again...), but comparing the result with another map taken from the web, it is similar:

my texture on the left, the web texture on the right:

enter image description here

And the corresponding images:

Mine:

enter image description here

From the web:

enter image description here

These tiles appear only at a given subdivision of the grids and above, not if too low.

What is it due to?

$\endgroup$
1
$\begingroup$

What you are seeing is stepping from using a limited colour space.

A 24 or 32 bit colour image uses 8bits for each channel (RGB/A) which gives you 255 possible values for each channel. If you open your gradient in the uv editor and right click on it you will see the x,y and RGB value of the pixel under the cursor. Make sure your zoom is at least 100% and see how many pixels next to each other have the same RGB value. You can find some spots that have more pixels with the same value, which is where you see the flat spots on your model.

image info

By opening your gradient image in krita you can convert the image to use a 32bit float bit depth (gimp only supports 8bit channels), if you then blur the image and save it as an exr, then using that image you will see a smoother surface deform. Bluring the image will change the curve so you want to start by creating the gradient with a higher bit depth.

sample with 32bit image for displace

PNG, TIFF and JPEG2000 support 16 bit channels while OpenEXR supports 16 and 32 bit float channels. That is assuming blender's procedural gradient texture doesn't match the shape you are after.

$\endgroup$
  • $\begingroup$ Thank for these explanations. I did not guess that conversion as I created the image from ray casts using float/distance values (bpy.types.Image)... so I was not imagining it was somehow converted back to integers RGB. Is there a way to keep the float format for the displacement? $\endgroup$ – lemon Mar 30 '17 at 5:43
  • $\begingroup$ If you are creating it in blender, just save it as openexr or try a 16bit png. $\endgroup$ – sambler Mar 30 '17 at 5:58
  • $\begingroup$ Do you know if creating the image with float_buffer = True here docs.blender.org/api/2.78b/… is equivalent to openexr ? $\endgroup$ – lemon Mar 30 '17 at 7:39
  • $\begingroup$ OK... float_buffer works. Last point to do: better sampling, anti aliasing or blurring... but this is another story! Thanks $\endgroup$ – lemon Mar 30 '17 at 7:47
  • $\begingroup$ Only relevant as you create the image. If you save out to disk or pack the image, the image format causes the conversion. You will find this question relevant. $\endgroup$ – sambler Mar 30 '17 at 10:15
1
$\begingroup$

Not sure what is really the underlying cause, but I figured out how to reduce the artifacts.

It seems to be related to the image filtering interpolation method. Turning on Interpolation and increasing the Filter Size property seems to reduce the effect noticeably.

Image Interpolation

$\endgroup$
  • 1
    $\begingroup$ Thanks... well for now I don't know which answer to validate: yours provides a solution, @sambler's one provides explanation... $\endgroup$ – lemon Mar 30 '17 at 5:44
  • 1
    $\begingroup$ Well since the original question was "Height map tiling: what is it due to?" I guess he deserves the medal, my answer doesn't really explain what it is due to. :) $\endgroup$ – Duarte Farrajota Ramos Mar 30 '17 at 12:52

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.