0
$\begingroup$

I would like to create a certain material in order to use it in Unity. It is foam and it looks like this:

enter image description here

To create such a material, I have constructed a pyramid:

enter image description here

How could I now bake a normal map from the pyramid?

The pyramid would be the "high poly model", and then I would need a low poly model, right?

If yes, what should I choose for a low poly model? A cube?

Thank you very much for the help!

$\endgroup$

4 Answers 4

2
$\begingroup$

You have two options-- bake interim as bump, or bake straight to normals. The first is better but more work.

Either way, first you want a camera. Set your camera to orthographic instead of perspective in properties/object data/lens. In the same area, set the orthographic scale to the world-space width of your pyramid. Clear rotation and location on the camera, then move it up a bit in the world Z so that it's looking down on your pyramid. In properties/render, set an appropriate resolution, such as 1024x1024. In properties/render/color management, set display device to "none" to render unprocessed numbers. Adopt a camera view to make sure you have what you want.

To render a straight normal map, create a new material where you remap your world space normals from -1,1 to 0,1 and output as emission:

enter image description here

To render a bump (depth) map, create a new material where you remap position.z to pure emission:

enter image description here

The remapping of position.z depends on the scale of your pyramid. You're remapping the lowest altitude to black and the highest altitude to white, in order to get the most precision out of your bump map. vklidu's answer, using generated texture coordinates rather than remapping, is a great way to do this (in the absence of a complicated modifier stack at least); I just wanted to make sure you were thinking about what was going on here, for cases where it might not do what you expected.

Render. It's fine to use Eevee for this, you don't need any raytracing, and Eevee is faster.

If you chose to make a bump map, set it up: scale it with a mapping node, run it through a displacement node on your object and then bake normals on that object (in Cycles, and well described elsewhere.) The reason that's better is because probably, you're using tangent space normal maps, which depend on the specific orientation of your model's UV map-- rendering normals for this object gets you normals appropriate for a default plane, not for a complicated object with a bunch of rotated UV islands.

An alternative method to bake the normals is to simply do a selected-to-active bake from the pyramid to a plane on top of the pyramid (also, documented elsewhere with a bit of research.) This doesn't require any material setup, but you have to use Cycles, which is slower.

$\endgroup$
2
$\begingroup$

I think you need Bump Map (Heightmap) ...

  • Unwrap from top view
  • Create this material with disconnected, but selected Texture node (and newly created image texture)
  • Bake Emit pass

enter image description here

Save as OpenEXR or some 32bit format.

enter image description here

Use the baked texture for Plane object material as Displacement ...

enter image description here

... wait a minute ... you said for Unity ... do you want to bake pyramid shape or foam structure for pyramid?

The thing is I used it as a Heightmap that is possible in Unity, but require dense geometry ussually optimised by tesselation - nice quick explanation - Displacement in Unity.

On other hand using Bump or Normal map affects only shading - light behaviour on a surface, that will never gives you believable result for such object.

enter image description here Source


Again I didn't notice the date ... that is terrible system ...

$\endgroup$
6
  • $\begingroup$ Thank you! I I wanted to bake both foam and pyramid. :-) I mean pyramid with a foam-like structure to it. $\endgroup$
    – tmighty
    Apr 25, 2021 at 19:42
  • $\begingroup$ ... two years later :) I guess you already solved that ... so go a head ... you can create also your own answer here :) $\endgroup$
    – vklidu
    Apr 25, 2021 at 20:24
  • $\begingroup$ I guess procedural distance-from-grid-edge (min(abs(XY)))would mean no model / baking required.. $\endgroup$
    – Robin Betts
    Apr 25, 2021 at 20:59
  • $\begingroup$ @RobinBetts I love you :) ... what the hell is that :) Don't use incantatio at me and show your magic :) $\endgroup$
    – vklidu
    Apr 25, 2021 at 21:07
  • 1
    $\begingroup$ @vklidu at least it's not just me :D $\endgroup$ Apr 25, 2021 at 21:09
1
$\begingroup$

I don't think you need to make a Normal map to do this.

  1. Add a plane. Extrude it along the z axis a little..
  2. Select the top face and subdivide it as you need. Extrude them to match the height of the foam pyramids.
  3. Select the pivot point to 'Individual Origins' and scale them to 0
  4. Remove doubles from the W key menu.
$\endgroup$
3
  • $\begingroup$ Thanks, but I don't understand what your approach is. I really need the normal map, I can't do this with geometry unfortunately. $\endgroup$
    – tmighty
    Jul 20, 2019 at 1:44
  • $\begingroup$ I will post gif after some time. I don't have access to my pc at the moment. $\endgroup$
    – AshKB
    Jul 20, 2019 at 2:01
  • $\begingroup$ Sorry for the late reply. I tried baking a normal map from it but it doesn't seem to work when applied to a plane. Maybe I am missing something. $\endgroup$
    – AshKB
    Jul 21, 2019 at 13:36
1
$\begingroup$

This doesn't exactly answer the question.. it's more to explain a (sorry) cryptic comment on @vklidu's answer.

You don't need to build a pyramid-object to bake heights.. those can be derived from tiled Object-space coordinates without too much trouble:

enter image description here

resulting in a distance-from-grid-edge pattern:

enter image description here

That can be used to displace a surface.. as others have mentioned, that scale of detail can't be faked with a bump-map close up. The rest of the nodes in the tree are a not-so-great attempt at the foam....

enter image description here

With this sort of result, which, to say the least, needs tweaking. I would love to get that fringe from backlighting.

enter image description here

$\endgroup$

You must log in to answer this question.

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