Jump to content
Hash, Inc. Forums

Generating proper normal maps from any surface


R Reynolds

Recommended Posts

Ever since the MakeNormalMap.atx material was replaced by the Surface Normal buffer in the render engine I've always had unpredictable results. I couldn't seem to get a flat plane that was orthogonal to the camera to return a consistent color of 128, 128, 255. Sometimes it did but many times a flat plane would come up short on the red & green channel. So in the course of generating wrinkle maps for the seats in the street car, I ran more than a few tests and have found the answer; to get the correct colours the algorithm needs a full range of surface normals in the image. The following images are my proof.

 

The top image shows the chor layout; a camera orthogonal to a flat plane. Behind the flat plane is a mildly deformed plane and behind that is a hemisphere.

normal_test.jpg
The first image is the normal buffer output looking at just the flat plane. The normal buffer assigns a colour of 5,5,255
Moving the flat plane to the left to expose part of the deformed plane produces the second image. The normal buffer assigns a colour of 19,19,255
The third image has half the deformed plate showing and the normal buffer assigns a colour of 56,56,255
With 75% of the deformation showing in the fourth image the flat plane registers as 57, 57, 255 as it does when the entire dented surface is showing in the fifth image.
In the sixth image the hemisphere is moved out from behind the plane to expose about one quarter of it and the flat planes now register as 118, 118, 255
With half the hemisphere exposed to the camera (seventh image) flat surfaces now have the correct value of 128, 128, 255. As is the case when the entire hemisphere is exposed.

So my suggestion for generating correct normal maps from any surface is to have a "calibration" hemisphere within the field of view. But keep it fairly large, if it's too small (like about half the size shown) the red/green channels start to fade.

  • ____ 1
Link to comment
Share on other sites

  • Hash Fellow

Thank you for your detective work on this!

 

This may be a correctable bug. I recommend you submit your findings to hash.com/reports when when v19 becomes available (presuming the behavior continues in that version.)

Link to comment
Share on other sites

  • Admin

Simon,

There are a lot of resources but here's one that covers normal maps while comparing to other mapping techniques (bump, displacement) although primarily for gaming:

 

https://www.youtube.com/watch?v=SQrHkKnSBcA

 

Normals indicate the direction of a surface.

Normal maps that capture this directional information adjusting the surface characteristics of an object at render time.

This data can then generate surface and lighting effects.

In this way a flat 2D plane can appear to have shape/depth in 3D space because of how normal maps adjust color and shading.

 

Normal Maps can be rendered directly in A:M by using the Normal Buffer.

While not required, using a image format like .EXR can be beneficial because it can store data that other image formats cannot.

 

Technical aside: Normal maps can be used with A:M particle hair to orient entire areas and even individual strands in desired directions. In Rodger's case he mostly uses Normal Maps to gain additional definition and detail that would take a considerable amount of splines to display. A metal panel with thousands of rivets might be a very dense mesh if every rivet was modeled but if each of the rivets is created via a Normal Map then all thousand rivets can be displayed on a single patch.

Link to comment
Share on other sites

I'm with Simon--- coming to age on Normals- thanks for the link, Rodney... now I have to play to get my bearings...

 

So- better than bump maps which create illusion using 2 channels (greyscale) Normals use 3 colors...R,G,B.... and R=X, G=Y, and B=Z or depth... what is the base purple generated from and represent?

Link to comment
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...