Normalmaps, How to Make Good Ones: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
Copied from http://homepage.ntlworld.com/gerald.hunt1/website/nfhwta.htm, by Greg Hunt
Original text copied from http://homepage.ntlworld.com/gerald.hunt1/website/nfhwta.htm, by Greg Hunt


First off, to explain what normalmaps are in terms of an artist's perspective. Normalmaps alter the perception of a lit object via Per-pixel lighting rather than the bog standard vector lighting used on a low-polygon model without a normalmap. This technique requires an RGB texture which contains the information needed to create surface normals in a texture map. This texture containing surface normal data is called a normal map. The red, green and blue channels of the normal map dictate how lighting effects the X, Y, and Z axis' of the normal vector orientation.
Modifications made by Springheel


The pink pixels represent normals that are facing to the right. Green pixels represent normals that are facing down. Purple pixels represent normals that are facing upwards, and dark blue/green pixel are normals facing to the left.
"The pink pixels represent normals that are facing to the right. Green pixels represent normals that are facing down. Purple pixels represent normals that are facing upwards, and dark blue/green pixel are normals facing to the left."


The essential goal of this tutorial is to show how I go about achieving making organic (possibly rounded/curved/smooth) normalmaps that appear to be 3d-modelled.
"The essential goal of this tutorial is to show how I go about achieving making organic (possibly rounded/curved/smooth) normalmaps that appear to be 3d-modelled."


So here is where the process begins.  With a black and white heightmap. Duplicate this so we have 3 layers of the same image.
First of all you need to create a heightmap.  A heightmap is basically a black and white version of your texture, where the higher areas are light and the lower areas are dark.  On something like bricks, the bricks would be pretty bright and the cracks between the bricks would be dark.
 
"So here is where the process begins.  With a black and white heightmap. Duplicate this so we have 3 layers of the same image."


http://www.mindplaces.com/save/offset.jpg
http://www.mindplaces.com/save/offset.jpg


- Use a Gaussian Blur filter with a pixel radius of 6 on the bottom layer image, use the Filter->Other->Offset tool and offset it by half the texture's resolution, making sure that "Wrap Around" is checked. Repeat this step and Gaussian Blur it once more. You should have offset the image twice and blurred this image 3 times now.
"- Use a Gaussian Blur filter with a pixel radius of 6 on the bottom layer image, use the Filter->Other->Offset tool and offset it by half the texture's resolution, making sure that "Wrap Around" is checked. Repeat this step and Gaussian Blur it once more. You should have offset the image twice and blurred this image 3 times now.


- On the 2nd layer image Repeat the previous step but using a Gaussian Blur filter with a pixel radius of 3, you can leave the top layer alone for now.
- On the 2nd layer image Repeat the previous step but using a Gaussian Blur filter with a pixel radius of 3, you can leave the top layer alone for now.
Line 19: Line 21:
- Set the top and the 2nd layer's Blending mode to "Overlay" then tweak the opacity to how you see fit, then flatten the image.
- Set the top and the 2nd layer's Blending mode to "Overlay" then tweak the opacity to how you see fit, then flatten the image.


You should have a normalmap like above and as you can see, it puts more emphasis on the geometry even though edge/line details are still present, they don't overthrow the overall shape. From this point onwards I can simply create additional heightmap layers for fine details, filter them through with a "Du/Dv" Filter Type and a scale between 5-10, Overlay and Merge.
You should have a normalmap like above and as you can see, it puts more emphasis on the geometry even though edge/line details are still present, they don't overthrow the overall shape. From this point onwards I can simply create additional heightmap layers for fine details, filter them through with a "Du/Dv" Filter Type and a scale between 5-10, Overlay and Merge."


The result will be something like this smooth version:
The result will be something like this smooth version:

Revision as of 01:32, 28 July 2007

Original text copied from http://homepage.ntlworld.com/gerald.hunt1/website/nfhwta.htm, by Greg Hunt

Modifications made by Springheel

"The pink pixels represent normals that are facing to the right. Green pixels represent normals that are facing down. Purple pixels represent normals that are facing upwards, and dark blue/green pixel are normals facing to the left."

"The essential goal of this tutorial is to show how I go about achieving making organic (possibly rounded/curved/smooth) normalmaps that appear to be 3d-modelled."

First of all you need to create a heightmap. A heightmap is basically a black and white version of your texture, where the higher areas are light and the lower areas are dark. On something like bricks, the bricks would be pretty bright and the cracks between the bricks would be dark.

"So here is where the process begins. With a black and white heightmap. Duplicate this so we have 3 layers of the same image."

offset.jpg

"- Use a Gaussian Blur filter with a pixel radius of 6 on the bottom layer image, use the Filter->Other->Offset tool and offset it by half the texture's resolution, making sure that "Wrap Around" is checked. Repeat this step and Gaussian Blur it once more. You should have offset the image twice and blurred this image 3 times now.

- On the 2nd layer image Repeat the previous step but using a Gaussian Blur filter with a pixel radius of 3, you can leave the top layer alone for now.

- Run the bottom layer through the nvidia plug-in with a scale value of 15-30 (depending on the texture), run the 2nd layer through with a scale value of 9-12 and also check "Du/Dv" in the filter type options, do the same again with the top layer but with a scale value of 5.

- Set the top and the 2nd layer's Blending mode to "Overlay" then tweak the opacity to how you see fit, then flatten the image.

You should have a normalmap like above and as you can see, it puts more emphasis on the geometry even though edge/line details are still present, they don't overthrow the overall shape. From this point onwards I can simply create additional heightmap layers for fine details, filter them through with a "Du/Dv" Filter Type and a scale between 5-10, Overlay and Merge."

The result will be something like this smooth version:

brickwall_result3.jpg

As opposed to this prickly result from just running it through the nvidia plugin normally.

brickwall_result1.jpg