Baking The Perfect Displacement Map (Blender + Cycles)

have fun :slight_smile:

Hi, Thanks for the tutorial ! I struggled so much with baking, and it seems I got it to work now.
I made a few quick notes for those who want to recap things after the video. (You have to watch first, otherwise doesn’t make sense).

A) Pre-work:

  1. Silhouette must be almost the same.
  2. 1 seam if prefferable on low res mesh, (not to much)
  3. Fill up UV space as much as possible
  4. No overlapping in UV
  5. Subsurf for rendering must be on same level as the HiRes model (matching polygon approx)

B) Baking

  1. Switch to Blender render
  2. In baking panel (render tab) switch to Selected to Active
  3. Margin: 4 a 5 pixels.
  4. Distance: 0 (That didn’t work for me for some reasons, and had to switch it to 0.1 ? )
  5. Bias: 0
  6. Change Bake Mode to Displacement
  7. Check Normalized for now ( so you can see better artifacts)
  8. Select HiRes then LowRes
  9. Make new image to back on. Use square root of the amount of polygons of the Hiress. E.g. : 2.1 million polygons use 3.072 pixels
  10. Check 32-bit float
  11. Linear space: sRGB (for now? Oops i have filmic , but it worked anyway)
  12. Bake to check for artifacts.
  13. To bake proper one: Uncheck normalized, and switch sRGB to Linear, and float Buffer.

Again, thanks for the nice explanation.

Any chance this exists with cycles render ?

If not this just sounds useless ^^

Short answer:Yes.

Longer answer: Just do a search on google or youtube like blender baking displacement 2.8 and you will get tutorials like Blender 2.8 Baking Displacement Map w/Multires . and you have a bunch of tutorials that is not three years old.

oh 2.8 ?
I use 2.79.6 for the moment. And yes i found some tutos but they appear not to be for 2.79 :confused:

it can be done in 2.79 (the video is that old!)

All you need to have is a common UVmap between hires and lowres. Then bake Position from hires, and then bake the subtraction of the first bake and the Position from lowres.

nudelZ shared a blend with his nodegroup in this post, and I’ve turn it into a python node.

Thanks a lot @Secrop !

:smiley: this look very interresting !

Could you please tell me what i should do with your python bunch of files ? :slight_smile:
i got no idea where to put then :wink:

Thanks again and happy blending !

For 2.7x, download the main script, unzip it to your 2.7x/scripts/addons folder, and remove ‘-master’ from the folder’s name ("-" cannot be used as module name in python).

Then just enable it in the preferences>addons.

i take a look at this right away :slight_smile:
thanks !

Sorry @Secrop :confused: it appears i cannot find your addon in the addon list…

What’s its name please ?

isn’t there a 2.8 version lock ? in the

Did you download the file I linked in my last post, or from the github link from my first post?
The latter is for 2.8… so if you’re using 2.7+, you should dl it from here.

i downloaded the entire github wich is named ***2.8 :wink:

thx for the 2.7x link i get it straight away !

EDIT: Ok ! thx @Secrop ! i got it and enabled it in prefs. now i have to try playing with it :wink:

It appears i’m dumb as i don’t know what to do with your bake nodes @Secrop

please let me explain what i’d like to achieve :slight_smile:

Here’s my scene:

the orange object is the one in hires. it’s textured and has a ‘grainy’ bumpmap.

The black object is the lowres object on wich i want to bake the diffuse and the height of the highres object.
The diffuse is pretty simple to bake, but as i’m unable to bake the height, i baked the normal.
Here’s the result:

You can see the effective normal calculated from highres obj towards lowres obj, and also the 'grainy ’ surface.

What i need is the same kind of texture but in ‘gray’ color, giving the height of HR obj regarding LR obj.

With you nodes, i only seem to get some multicolored results.

My question is: what should i do with your nodes ? what is the proper setup ?

Thanks again for your help !

Basic setup goes like this:

displ_bake.blend (3.8 MB)

How to use it:

  • Select the hires object and hit Bake. This will store the final coordinates into a texture
  • Select the lores object and hit Bake. This will calculate the difference between original and final vectors.
  • Save the last bake with exr format, or any other that accept negative floating ranges.

For Scalar displacement (grayscale), you just need to select “Scalar Displacement” in the lores node.

1 Like

This is just exactly what i need @Secrop !!! :smiley:

And your file works like a charm !

But i appear unable to reproduce it with the same nodes setup :frowning:

here’s my blend:
encorbellements_simple.blend (1.3 MB)

please have you an idea of what’s wrong ?

hey @Secrop :smiley:

Finally i did some thingies :slight_smile:

I noticed that baking with your nodes works when i delete them and recreate them in node editor !
Of course am not sure but this looks like some bug… :confused:

Anyway, a bug with a workaround is not an annoying bug x)) i played around and got some thingies like this:

I noticed that the low-res surface MUST be a plane and MUST be horizontal ( the X-Y global plane ) and all things appear to work fine.
I’m kinda disappointed that lowres bake cannot be done according to the lowres polygons normals but i don’t have math knowledge engough ( eg: no time enough :wink: ) for digging in this.
Blender disp bake did its bake according to low-res surface…

Well anyway your addon is just caviar 8-D
I love it and will play with it a lot !
Thanks a bunch for all this !
I i can help you in any way finding the bug reason:
why bake gives a black texture when vector colors are expected ? and why deleting the displacement node and recreating the same one make things work… ?
please tell me :wink: i’d be happy to help !

Finally here’s the result in unity3D:

Thanks again for you help and for your amazing work !!!

regards !

Happy blending !