question

Michail Isaakidis avatar image
Michail Isaakidis asked ·

how to bake a normal map from a mesh that has rounded edges?

New to Arnold so please bare with me.

Trying out some new workflows, to see if I can quickly get a normal map from an asset (in Maya).

So what I've done so far was:

1. Apply a roundcorners node on a aiutilty node (set the shade more to flat and color mode to Normal)

Result in render

2. Use render to texture an AOV (diffuse) to get the World Space normals.( i assume they are World Space?)

3. Open the exr file convert to 16bit in photoshop and save as a png.(cant save as another file format)

4. Use Handplane to convert the png file from Object space to tangent space (Handplane does not convert World space to tangent space).

5. Take the new converted file and apply it back in Maya as a normal map.

Result (normals are wrong)

I assume there is no way of getting a normal map directly baked on a texture from an AOV?

Is there a way to get the object space normals instead?

If you can render out a normal map, how should I have my smoothing groups?

How do I control padding?

How do I fix the graininess on the render to texture settings? (Camera settings (AA) were set to 4

Any help would be greatly appreciated.

Cheers

-Mike

arnoldnormal map
arnold-bake-2.jpg (73.1 KiB)
arnold-bake-3.jpg (92.3 KiB)
arnold-bake-1.jpg (52.7 KiB)
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Mads Drøschler avatar image
Mads Drøschler answered ·

You can convert world space normals to tangent space with the Space Transform node. You also need to move it from -1 to 1 into 0-1 by adding up 1 and multiply with 0.5 afterwards.
Solution fabricated by Arnold devs, I just forward info, its also what happens under the hood.


eee.png (24.8 KiB)
Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Michail Isaakidis avatar image
Michail Isaakidis answered ·

Does the round corners work for angles that are not 90 degrees?

(like 60 or 105, 125)

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Mads Drøschler avatar image
Mads Drøschler answered ·

I know this ain't a maya screenshot.
However.

Source the bumped Normal from AOV's back into a shade chain with READ AOV, the most left top.
Then source the unbumped normal with a state vector N, bottom, and source them to the space transform. See settings on space transform node.
Then move the entire thing into the correct space 0-1 with the constantbias scale +1 *0.5 Then exit to a WRITE AOV, I call mine test. then flip to it, and this is what I see.

Also, you need to setup the material, its the 2 nodes seperate from the transformation kit, its basically just an Arnold Material with the rounded corner plugined to Normal ( and we read this back into chain which is the first thing I described, top left node )



This is basically also what you do if you toy with volumetric displacements using OSL shaders or whatever if they sit in tangent space from the get go, then we can move it into the right space so for example a cloud wont start to shift in a 45 degree angle when displaced, but instead take middle as starting point so volume gets displaced properly in all directions.

I also do this on the OSL flowmap, we paint in 0-1 space and move the data to -1 to 1 so that a paint strokes has 4 directions, eg, we can make circular strokes and the uv offsetting is following the brush, spotless perfection around in a circle.


www.png (345.5 KiB)
ddd.png (179.5 KiB)
Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Aten Skinner avatar image
Aten Skinner answered ·

Oh hang on have I got the wrong end of the stick here? You mean +1 and *0.5 as a post process, i.e. in Substance I was thinking you could somehow bake it out like that

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Aten Skinner avatar image
Aten Skinner answered ·

I'm already doing that in the shader though, see pic01 ^^

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Bhuwan Sharma avatar image
Bhuwan Sharma answered ·

@Aten Skinner add 1 and multiply by .5 now to remap it into 0-1 space

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Aten Skinner avatar image
Aten Skinner answered ·

Here's the viewport and the texture bake in substance, see how there's still black areas that are negative.

02.png03.png


02.png (46.5 KiB)
03.png (42.1 KiB)
Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Aten Skinner avatar image
Aten Skinner answered ·

@Mads Drøschler Sorry I can't get this to work at all :( Could you elaborate on the steps you took to make this work? I have the shader set up like this - then I do render to texture and still get -ve values in the texture, also I can't get render to texture to render anything other than an exr. I'd like to automate this eventually so it would be good to get this working!

01.png


01.png (26.3 KiB)
Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Aten Skinner avatar image
Aten Skinner answered ·

That's interesting to know. It might actually be less hassle than the method i tried. I will give this a shot. Cheers !

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Aten Skinner avatar image
Aten Skinner answered ·

I've done this. Add an aov for normals - n. Render that to texture. You will get a world space normal map. You can convert that to tangent space in substance designer in a few steps.

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.