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 __init.py

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 !

You can use pc2 format! is amazing.