How to make normal map

How to make normal map

NormalMap-Online

This website lets you create normal maps from height maps for free.
All normal map textures you create are your own.
Textures are not saved on the server and all scripts are running on your Browser.

Just drag & drop a heightmap in the specified field and adjust settings.
Afterwards check the preview window and download your own normalmap.
Additionally you can adjust and download displacement and ambient occlusion maps

The preview window shows a 3D-model with several different maps.
Each map can be enabled/disabled and the preview model can be adjusted.

If you have further questions, just give feedback to the mail-adress on the webpage.

Normal Maps

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapNormal Maps are textures that inherit depth information of a surface.
They don’t change the structure of the model and have nearly no impact on performance.
Each pixel represents a normal vector and is composed of three colors.
These colors are representing the direction of the normal vector.

They can enhance the optical illusion of depth significantly and are especially useful on flat surfaces, that have several bumps or cracks.
As shown on the right, the elevation described by the height map can be converted to a normal map, that can be read from your graphics card inside the shader units.
When aiming for a more drastical illusion in depth, where parts could be occluding the model, you should try displacement maps
These maps really alter polygons but could decrease performance significantly!

Batch mode

With this you can create maps for multiple height maps all at once. Try it out and give feedback!

Height map

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapThis texture contains the distance «height» from «floor». The brighter the pixel, the further away (more depth).
In this application it doesn’t matter if the values are inverted because you can change it anytime later on. The most important thing though, is the value difference between the pixels.
Ideal is a texture with pixel dimensions with a power of 2 (2, 4, 8. 256, 512 etc.)

If using a height map as a displacement map, you can easily see the effects on the surface. An example heightmap (left), bumps going in (top-right) and bumps going out (bottom-right) are shown in the image below.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

NormalMaps from photos

To generate normal maps from photos, you need four specific pictures of the same surface. Each picture needs a different lighting position.
The light should shine from the top, left, right and bottom of the image.
For this you need a simple camera, a flashlight and optionally a tripod. If you don’t use a tripod you probably have to align and crop the pictures before using them.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

Drag&drop the pictures on the four positions inside the left viewport. You can also click on each image to select a file.
Keep in mind that the light origin, shown inside the viewport, is in the center!
Also, all of the four pictures must have the same resolution.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

As a result a pretty decent normalmap is generated from the pictures (of my bath rug. ). Readjust the values afterwards for better results.

Attention: Best try capturing the surface with a tripod and don’t forget to capture an additional image for the diffuse map!

NormalMap-Online

Этот веб-сайт позволяет создать normal карты из карт высот бесплатно. Текстуры не сохраняются на сервере, скрипты работают в вашем браузере, на стороне клиента.
Перетащите вашу текстуру с картой высот в поле щагрузки изображений, или просто укажите файл. После проверки окно предварительного просмотра и отобразит карту нормалей. Так же можно переключать тип генерируемой карты. Доступны: displacement, ambient occlusion, specular

В окне предварительного просмотра отображается 3D-модели с различных карт. Каждую карту можно включать/выключать, параметры отображения модели в окне просмотра можно регулировать.

Если у вас есть дополнительные вопросы, пишите на recosh@mail.ru.

Normal Maps

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapNormal Maps are textures that inherit depth information of a surface.
They don’t change the structure of the model and have nearly no impact on performance.
Each pixel represents a normal vector and is composed of three colors.
These colors are representing the direction of the normal vector.

They can enhance the optical illusion of depth significantly and are especially useful on flat surfaces, that have several bumps or cracks.
As shown on the right, the elevation described by the height map can be converted to a normal map, that can be read from your graphics card inside the shader units.
When aiming for a more drastical illusion in depth, where parts could be occluding the model, you should try displacement maps
These maps really alter polygons but could decrease performance significantly!

Height map

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapThis texture contains the distance «height» from «floor». The brighter the pixel, the further away (more depth).
In this application it doesn’t matter if it’s inverted, the most important thing is the difference between the pixels.
Ideal is a texture with pixel dimensions with a power of 2 (2, 4, 8. 256, 512 etc.)

Using a height map for example as displacement, you can easily see the effect on the surface. An example heightmap (left), bumps going in (top-right) and bumps going out (bottom-right).

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

NormalMaps from photos

It is technically not possible to get completely correct normalmaps directly from pictures e.g. taken with a camera.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

But because many of you are interested in this, I considered searching for good methods to still achieve reasonable results from photos. There seem to be some techniques that can create decent normalmaps.
Still it would take me a lot of time to learn about these techniques.

Right now I’m studying a master’s degree, working part-time and giving lessons in programming.
If you would like me to invest more time on finding and implementing a solution for this, please consider donating!

I could work more on this project and include more features you want!

Normal map (Bump mapping)

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

Normal maps are a type of Bump Map. They are a special kind of texture that allow you to add surface detail such as bumps, grooves, and scratches to a model which catch the light as if they are represented by real geometry.

For example, you might want to show a surface which has grooves and screws or rivets across the surface, like an aircraft hull. One way to do this would be to model these details as geometry, as shown below.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapA sheet of aircraft metal with details modeled as real geometry.

Depending on the situation it is not normally a good idea to have such tiny details modelled as “real” geometry. On the right you can see the polygons required to make up the detail of a single screwhead. Over a large model with lots of fine surface detail this would require a very high number of polygons to be drawn. To avoid this, we should use a normal map to represent the fine surface detail, and a lower resolution polygonal surface for the larger shape of the model.

If we instead represent this detail with a bump map, the surface geometry can become much simpler, and the detail is represented as a texture which modulates how light reflects off the surface. This is something modern graphics hardware can do extremely fast. Your metal surface can now be a low-poly flat plane, and the screws, rivets, grooves and scratches will catch the light and appear to have depth because of the texture.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapThe screws, grooves and scratches are defined in a normalmap, which modifies how light reflects off the surface of this low-poly plane, giving the impression of 3D detail. As well as the rivets and screws, a texture allows us to include far more detail like subtle bumps and scratches.

In modern game development art pipelines, artists will use their 3D modelling applications to generate normal maps based on very high resolution source models. The normal maps are then mapped onto a lower-resolution game-ready version of the model, so that the original high-resolution detail is rendered using the normalmap.

How to create and use Bump Maps

Bump mapping is a relatively old graphics technique, but is still one of the core methods required to create detailed realistic realtime graphics. Bump Maps are also commonly referred to as Normal Maps or Height Maps, however these terms have slightly different meanings which will be explained below.

What are Surface Normals?

To really explain how normal mapping works, we will first describe what a “normal” is, and how it is used in realtime lighting. Perhaps the most basic example would be a model where each surface polygon is lit simply according to the surface angles relative to the light. The surface angle can be represented as a line protruding in a perpendicular direction from the surface, and this direction (which is a vector) relative to the surface is called a “surface normal”, or simply, a normal.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapTwo 12-sided cylinders, on the left with flat shading, and on the right with smoothed shading

In the image above, the left cylinder has basic flat shading, and each polygon is shaded according to its relative angle to the light source. The lighting on each polygon is constant across the polygon’s area because the surface is flat. Here are the same two cylinders, with their wireframe mesh visible:

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapTwo 12-sided cylinders, on the left with flat shading, and on the right with smoothed shading

Viewed as a 2D diagram, three of the surface polygons around the outside of the flat-shaded cylinder would look like this:

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapFlat shading on three polygons, viewed as a 2D diagram

The surface normals are represented by the orange arrows. These are the values used to calculate how light reflects off the surface, so you can see that light will respond the same across the length of each polygon, because the surface normals point in the same direction. This gives the “flat shading”, and is the reason the left cylinder’s polygons appear to have hard edges.

For the smooth shaded cylinder however, the surface normals vary across the flat polygons, as represented here:

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapSmooth shading on three polygons, viewed as a 2D diagram

The normal directions gradually change across the flat polygon surface, so that the shading across the surface gives the impression of a smooth curve (as represented by the greeen line). This does not affect the actual polygonal nature of the mesh, only how the lighting is calculated on the flat surfaces. This apparent curved surface is not really present, and viewing the faces at glancing angles will reveal the true nature of the flat polygons, however from most viewing angles the cylinder appears to have a smooth curved surface.

Using this basic smooth shading, the data determining the normal direction is actually only stored per vertex, so the changing values across the surface are interpolated from one vertex to the next. In the diagram above, the red arrows indicate the stored normal direction at each vertex, and the orange arrows indicate examples of the interpolated normal directions across the area of the polygon.

What is Normal mapping?

Normal mapping takes this modification of surface normals one step further, by using a texture to store information about how to modify the surface normals across the model. A normal map is an image texture mapped to the surface of a model, similar to regular colour textures, however each pixel in the texture of the normal map (called a texel) represents a deviation in surface normal direction away from the “true” surface normal of the flat (or smooth interpolated) polygon.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapNormal mapping across three polygons, viewed as a 2D diagram

In this diagram, which is again a 2D representation of three polygons on the surface of a 3D model, each orange arrow corresponds to a pixel in the normalmap texture. Below, is a single-pixel slice of a normalmap texture. In the centre, you can see the normals have been modified, giving the appearance of a couple of bumps on the surface of the polygon. These bumps would only be apparent due to the way lighting appears on the surface, because these modified normals are used in the lighting calculations.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapAn example normal map texture

This is a simple normal map, containing the bump information for some raised rectangles and text. This normal map can be imported into Unity and placed into Normal Map slot of the Standard Shader. When combined in a material with a colour map (the Albedo map) and applied to the surface of of the cylinder mesh above, the result looks like this:

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapThe example normal map applied to the surface of the cylinder mesh used above

Again, this does not affect the actual polygonal nature of the mesh, only how the lighting is calculated on the surfaces. This apparent raised lettering and shapes on the surface are not really present, and viewing the faces at glancing angles will reveal the true nature of the flat surface, however from most viewing angles the cylinder now appears to have embossed detail raised off the surface.

How do I get or make normal maps?

Commonly, Normal Maps are produced by 3D or Texture artists in conjunction with the model or textures they are producing, and they often mirror the layout and contents of the Albedo map. Sometimes they are produced by hand, and sometimes they are rendered out from a 3D application.

Here are two examples, one is a simple repeating stone wall texture with its corresponding normal map, and one is a character’s texture atlas with its corresponding normal map:

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapA stone wall texture and its corresponding normal map texture How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapA character texture atlas, and its corresponding normal map texture atlas

What’s the difference between Bump Maps, Normal Maps and Height Maps?

Normal Maps and Height Maps are both types of Bump Map. They both contain data for representing apparent detail on the surface of simpler polygonal meshes, but they each store that data in a different way.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapOn the left, a height map for bump mapping a stone wall. On the right, a normal map for bump mapping a stone wall.

Above, on the left, you can see a height map used for bump mapping a stone wall. A height map is a simple black and white texture, where each pixel represents the amount that point on the surface should appear to be raised. The whiter the pixel colour, the higher the area appears to be raised.

A normal map is an RGB texture, where each pixel represents the difference in direction the surface should appear to be facing, relative to its un-modified surface normal. These textures tend to have a bluey-purple tinge, because of the way the vector is stored in the RGB values.

Modern realtime 3D graphics hardware rely on Normal Maps, because they contain the vectors required to modify how light should appear to bounce of the surface. Unity can also accept Height Maps for bump mapping, but they must be converted to Normal Maps on import in order to use them.

Why the bluey-purple colours?

A value of (0.43, 0.91, 0.80) gives a vector of (–0.14, 0.82, 0.6), which is quite a steep modification to the surface. Colours like this can be seen in the bright cyan areas of the stone wall normal map at the top of some of the stone edges. The result is that these edges catch the light at a very different angle to the flatter faces of the stones.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapThe bright cyan areas in the normalmap for these stones show a steep modification to the polygon’s surface normals at the top edge of each stone, causing them to catch the light at the correct angle.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapA stone wall with no bumpmap effect. The edges and facets of the rock do not catch the directional sun light in the scene. How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapThe same stone wall with bumpmapping applied. The edges of the stones facing the sun reflect the directional sun light very differently to the faces of the stones, and the edges facing away. How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapThe same bumpmapped stone wall, in a different lighting scenario. A point light torch illuminates the stones. Each pixel of the stone wall is lit according to how the light hits the angle of the base model (the polygon), adjusted by the vectors in the normal maps. Therefore pixels facing the light are bright, and pixels facing away from the light are darker, or in shadow.

How to import and use Normal Maps and Height Maps

A normal map can be imported by placing the texture file in your assets folder, as usual. However, you need to tell Unity that this texture is a normal map. You can do this by changing the “Texture Type” setting to “Normal Map” in the import inspector settings.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

To import a black and white heightmap as a normal map, the process is almost identical, except you need to check the “Create from Greyscale” option.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

With “Create From Greyscale” selected, a Bumpiness slider will appear in the inspector. You can use this to control how steep the angles in the normalmap are, when being converted from the heights in your heightmap. A low bumpiness value will mean that even sharp contrast in the heightmap will be translated to gentle angles and bumps. A high value will create exaggerated bumps and very high contrast lighting responses to the bumps.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapLow and High Bumpiness settings when importing a height map as a normal map, and the resulting effect on the model.

Once you have a normalmap in your assets, you can place it into the Normal Map slot of your Material in the inspector. The Standard Shader has a normal map slot, and many of the older legacy shaders also support normal maps.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapPlacing a normal map texture into the correct slot in a material using the Standard Shader

If you imported a normalmap or heightmap, and did not mark it as a normal map (By selecting Texture Type: Normal Map as described above), the Material inspector will warn you about this and offer to fix it, as so:

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapThe “Fix Now” warning appears when trying to use a normalmap that has not been marked as such in the inspector.

Secondary Normal Maps

You may also notice that there is a second Normal Map slot further down in the Material inspector for the Standard Shader. This allows you to use an additional normal map for creating extra detail. You can add a normal map into this slot in the same way as the regular normal map slot, but the intention here is that you should use a different scale or frequency of tiling so that the two normal maps together produce a high level of detail at different scales. For example, your regular normal map could define the details of panelling on a wall or vehicle, with groves for the panel edges. A secondary normal map could provide very fine bump detail for scratches and wear on the surface which may be tiled at 5 to 10 times the scale of the base normal map. These details could be so fine as to only be visible when examined closely. To have this amount of detail on the base normal map would require the base normal map to be incredibly large, however by combining two at different scales, a high overall level of detail can be achieved with two relatively small normal map textures.

Normal map (Bump mapping)

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

Normal maps are a type of Bump Map. They are a special kind of texture that allow you to add surface detail such as bumps, grooves, and scratches to a model which catch the light as if they are represented by real geometry.

For example, you might want to show a surface which has grooves and screws or rivets across the surface, like an aircraft hull. One way to do this would be to model these details as geometry, as shown below.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapA sheet of aircraft metal with details modeled as real geometry.

Depending on the situation it is not normally a good idea to have such tiny details modelled as “real” geometry. On the right you can see the polygons required to make up the detail of a single screwhead. Over a large model with lots of fine surface detail this would require a very high number of polygons to be drawn. To avoid this, we should use a normal map A type of Bump Map texture that allows you to add surface detail such as bumps, grooves, and scratches to a model which catch the light as if they are represented by real geometry.
See in Glossary to represent the fine surface detail, and a lower resolution polygonal surface for the larger shape of the model.

If we instead represent this detail with a bump map, the surface geometry can become much simpler, and the detail is represented as a texture which modulates how light reflects off the surface. This is something modern graphics hardware can do extremely fast. Your metal surface can now be a low-poly flat plane, and the screws, rivets, grooves and scratches will catch the light and appear to have depth because of the texture.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapThe screws, grooves and scratches are defined in a normalmap, which modifies how light reflects off the surface of this low-poly plane, giving the impression of 3D detail. As well as the rivets and screws, a texture allows us to include far more detail like subtle bumps and scratches.

In modern game development art pipelines, artists will use their 3D modelling applications to generate normal maps based on very high resolution source models. The normal maps are then mapped onto a lower-resolution game-ready version of the model, so that the original high-resolution detail is rendered using the normalmap.

How to create and use Bump Maps

Bump mapping is a relatively old graphics technique, but is still one of the core methods required to create detailed realistic realtime graphics. Bump Maps are also commonly referred to as Normal Maps or Height Maps, however these terms have slightly different meanings which will be explained below.

What are Surface Normals?

To really explain how normal mapping works, we will first describe what a “normal” is, and how it is used in realtime lighting. Perhaps the most basic example would be a model where each surface polygon is lit simply according to the surface angles relative to the light. The surface angle can be represented as a line protruding in a perpendicular direction from the surface, and this direction (which is a vector) relative to the surface is called a “surface normal”, or simply, a normal.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapTwo 12-sided cylinders, on the left with flat shading, and on the right with smoothed shading

In the image above, the left cylinder has basic flat shading, and each polygon is shaded according to its relative angle to the light source. The lighting on each polygon is constant across the polygon’s area because the surface is flat. Here are the same two cylinders, with their wireframe mesh The main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info
See in Glossary visible:

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapTwo 12-sided cylinders, on the left with flat shading, and on the right with smoothed shading

Viewed as a 2D diagram, three of the surface polygons around the outside of the flat-shaded cylinder would look like this:

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapFlat shading on three polygons, viewed as a 2D diagram

The surface normals are represented by the orange arrows. These are the values used to calculate how light reflects off the surface, so you can see that light will respond the same across the length of each polygon, because the surface normals point in the same direction. This gives the “flat shading”, and is the reason the left cylinder’s polygons appear to have hard edges.

For the smooth shaded cylinder however, the surface normals vary across the flat polygons, as represented here:

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapSmooth shading on three polygons, viewed as a 2D diagram

The normal directions gradually change across the flat polygon surface, so that the shading across the surface gives the impression of a smooth curve (as represented by the green line). This does not affect the actual polygonal nature of the mesh, only how the lighting is calculated on the flat surfaces. This apparent curved surface is not really present, and viewing the faces at glancing angles will reveal the true nature of the flat polygons, however from most viewing angles the cylinder appears to have a smooth curved surface.

Using this basic smooth shading, the data determining the normal direction is actually only stored per vertex, so the changing values across the surface are interpolated from one vertex to the next. In the diagram above, the red arrows indicate the stored normal direction at each vertex, and the orange arrows indicate examples of the interpolated normal directions across the area of the polygon.

What is Normal mapping?

Normal mapping takes this modification of surface normals one step further, by using a texture to store information about how to modify the surface normals across the model. A normal map is an image texture mapped to the surface of a model, similar to regular colour textures, however each pixel The smallest unit in a computer image. Pixel size depends on your screen resolution. Pixel lighting is calculated at every screen pixel. More info
See in Glossary in the texture of the normal map (called a texel) represents a deviation in surface normal direction away from the “true” surface normal of the flat (or smooth interpolated) polygon.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapNormal mapping across three polygons, viewed as a 2D diagram

In this diagram, which is again a 2D representation of three polygons on the surface of a 3D model, each orange arrow corresponds to a pixel in the normalmap texture. Below, is a single-pixel slice of a normalmap texture. In the centre, you can see the normals have been modified, giving the appearance of a couple of bumps on the surface of the polygon. These bumps would only be apparent due to the way lighting appears on the surface, because these modified normals are used in the lighting calculations.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapAn example normal map texture

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapThe example normal map applied to the surface of the cylinder mesh used above

Again, this does not affect the actual polygonal nature of the mesh, only how the lighting is calculated on the surfaces. This apparent raised lettering and shapes on the surface are not really present, and viewing the faces at glancing angles will reveal the true nature of the flat surface, however from most viewing angles the cylinder now appears to have embossed detail raised off the surface.

How do I get or make normal maps?

Commonly, Normal Maps are produced by 3D or Texture artists in conjunction with the model or textures they are producing, and they often mirror the layout and contents of the Albedo map. Sometimes they are produced by hand, and sometimes they are rendered out from a 3D application.

Here are two examples, one is a simple repeating stone wall texture with its corresponding normal map, and one is a character’s texture atlas with its corresponding normal map:

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapA stone wall texture and its corresponding normal map texture How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapA character texture atlas, and its corresponding normal map texture atlas

What’s the difference between Bump Maps, Normal Maps and Height Maps?

Normal Maps and Height Maps are both types of Bump Map. They both contain data for representing apparent detail on the surface of simpler polygonal meshes, but they each store that data in a different way.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapOn the left, a height map for bump mapping a stone wall. On the right, a normal map for bump mapping a stone wall.

Above, on the left, you can see a height map used for bump mapping a stone wall. A height map is a simple black and white texture, where each pixel represents the amount that point on the surface should appear to be raised. The whiter the pixel colour, the higher the area appears to be raised.

A normal map is an RGB texture, where each pixel represents the difference in direction the surface should appear to be facing, relative to its un-modified surface normal. These textures tend to have a bluey-purple tinge, because of the way the vector is stored in the RGB values.

Modern realtime 3D graphics hardware rely on Normal Maps, because they contain the vectors required to modify how light should appear to bounce of the surface. Unity can also accept Height Maps for bump mapping, but they must be converted to Normal Maps on import in order to use them.

Why the bluey-purple colours?

A value of (0.43, 0.91, 0.80) gives a vector of (–0.14, 0.82, 0.6), which is quite a steep modification to the surface. Colours like this can be seen in the bright cyan areas of the stone wall normal map at the top of some of the stone edges. The result is that these edges catch the light at a very different angle to the flatter faces of the stones.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapThe bright cyan areas in the normalmap for these stones show a steep modification to the polygon’s surface normals at the top edge of each stone, causing them to catch the light at the correct angle.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapA stone wall with no bumpmap effect. The edges and facets of the rock do not catch the directional sun light in the scene. How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapThe same stone wall with bumpmapping applied. The edges of the stones facing the sun reflect the directional sun light very differently to the faces of the stones, and the edges facing away. How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapThe same bumpmapped stone wall, in a different lighting scenario. A point light torch illuminates the stones. Each pixel of the stone wall is lit according to how the light hits the angle of the base model (the polygon), adjusted by the vectors in the normal maps. Therefore pixels facing the light are bright, and pixels facing away from the light are darker, or in shadow.

How to import and use Normal Maps and Height Maps

A normal map can be imported by placing the texture file in your assets folder, as usual. However, you need to tell Unity that this texture is a normal map. You can do this by changing the “Texture Type” setting to “Normal Map” in the import inspector A Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
See in Glossary settings.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

To import a black and white heightmap A greyscale Texture that stores height data for an object. Each pixel stores the height difference perpendicular to the face that pixel represents.
See in Glossary as a normal map, the process is almost identical, except you need to check the “Create from Greyscale” option.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

With “Create From Greyscale” selected, a Bumpiness slider will appear in the inspector. You can use this to control how steep the angles in the normalmap are, when being converted from the heights in your heightmap. A low bumpiness value will mean that even sharp contrast in the heightmap will be translated to gentle angles and bumps. A high value will create exaggerated bumps and very high contrast lighting responses to the bumps.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapLow and High Bumpiness settings when importing a height map as a normal map, and the resulting effect on the model.

Once you have a normalmap in your assets, you can place it into the Normal Map slot of your Material in the inspector. The Standard Shader has a normal map slot, and many of the older legacy shaders also support normal maps.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapPlacing a normal map texture into the correct slot in a material using the Standard Shader

If you imported a normalmap or heightmap, and did not mark it as a normal map (By selecting Texture Type: Normal Map as described above), the Material inspector will warn you about this and offer to fix it, as so:

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal mapThe “Fix Now” warning appears when trying to use a normalmap that has not been marked as such in the inspector.

Secondary Normal Maps

You may also notice that there is a second Normal Map slot further down in the Material inspector for the Standard Shader. This allows you to use an additional normal map for creating extra detail. You can add a normal map into this slot in the same way as the regular normal map slot, but the intention here is that you should use a different scale or frequency of tiling so that the two normal maps together produce a high level of detail The Level Of Detail (LOD) technique is an optimization that reduces the number of triangles that Unity has to render for a GameObject when its distance from the Camera increases. More info
See in Glossary at different scales. For example, your regular normal map could define the details of panelling on a wall or vehicle, with groves for the panel edges. A secondary normal map could provide very fine bump detail for scratches and wear on the surface which may be tiled at 5 to 10 times the scale of the base normal map. These details could be so fine as to only be visible when examined closely. To have this amount of detail on the base normal map would require the base normal map to be incredibly large, however by combining two at different scales, a high overall level of detail can be achieved with two relatively small normal map textures.

How to Create Normal Maps from Photographs

In this post I will show you how to create normal maps from photographs. You can often create normal maps using dedicated software or plugins quickly and easily. I created a very easy to use Filter Forge filter – DreamLight_Normal-Map-Maker. I also created a node map based surface you can use right in LightWave 3D to generate your normal maps as well. Once you understand how normal maps work you can even create them from scratch using photographs in any image editor such as Adobe Photoshop.

First I will cover some basic information about what normal maps are and how they work. I will then show you how to create normal maps from photographs in Filter Forge, LightWave 3D or Adobe Photoshop. I will finish by showing how I used this technique in LightWave 3D for a recent project.

You can get Gold Coins similar to those I borrowed for this project on Amazon.com

Contents

What are Normal Maps?

Normal maps are a more advanced form of bump maps. They add simulated detail to a 3D surface. Where a bump map is a grayscale image that encodes elevation data, a normal map uses an RGB color image to encode normal vector directions in 3D. Before learning how to create normal maps from photographs it is a good idea to understand exactly what normal maps are and how they are constructed.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

Let’s examine a simple normal map of geometric shapes by Julian Herzog from an article about Normal Mapping on wikipedia. Two things stand out immediately about this image. First there is a rainbow effect that progresses around the edges of the shapes. Second, all the areas facing the viewer are a lavender color.

Vectors pointing toward the edges of the image progress through shades of red and green while vectors pointing out from the image approaching perpendicular progress through shades of blue.

Before we move on to learn how to create normal maps from photographs let’s take a look at how the XYZ vector data is encoded within an RGB normal map.

RGB Normal Map XYZ Vector Encoding

Normal maps use the three color channels R-red, G-green and B-blue to encode the X, Y and Z normal vector data in an 8-bit image.

Sampling and Analyzing Colors from a Sample Normal Map

Note: In the following images the color values are not exact due to clicking manually on the image rather than typing values into the text fields.

How to Take Photographs for Normal Maps

Now that we have a solid understanding of what normal maps are and how they are constructed we are ready to learn how to create normal maps from photographs. So it is now time to take some photographs.

Take Four Photographs Lighted From Four Directions

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

How to Create Normal Maps from Photographs with DreamLight’s Filter Forge Filter

I created a filter for Filter Forge – DreamLight_Normal-Map-Maker. You may use the free version of Filter Forge with this free filter to generate normal maps very easily.

The logic used to create this Filter Forge filter is outlined below where I show you how to create normal maps from photographs with Adobe Photoshop step-by-step manually.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

You may find all DreamLight’s Filter Forge filters at the following URL. Enjoy!

How to Create Normal Maps from Photographs with DreamLight’s Nodal Surface for LightWave 3D

I created a nodal surface for LightWave 3D – DreamLight Normal Occlusion Map Maker. You may use this free surface to create normal maps from photographs directly in LightWave 3D.

The following screenshot shows the four image nodes feeding into a compound node that creates and outputs a color normal map and a scalar occlusion map.

You could pipe the compound node’s outputs into the normal and diffuse surface inputs to use them directly if you wish. That would not be the most efficient way to use it though because the normal map would need to be created every time it is used. Instead I’ve set it to pipe the color normal map into the surface color input, set the luminosity to 1.0 and the diffuse, specular and reflection to 0.0.

Note: Normal Maps need to be in Linear Colorspace to work properly. When using this node map to create normal maps you should switch to linear colorspace while importing the four photographs, rendering and exporting the resulting normal map. Once done you may switch to sRGB color space if desired but be sure to then set any normal maps to linear colorspace in the Image Editor or they won’t work properly.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

The following node map shows the nodes inside the compound node. The logic used to create this LightWave 3D node map is outlined below where I show you how to create normal maps from photographs with Adobe Photoshop step-by-step manually.How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

I’ve built a nodal surface that can be used to create normal maps and occlusion maps from four photographs. You may download the surface and try it out yourself. Enjoy!

How to Create Normal Maps from Photographs with Adobe Photoshop

Below I will show the step-by-step logic that was used to create the node maps for the DreamLight Normal Map Maker LightWave 3D surface and Filter Forge filter above. [There are even online utilities that may be used in a similar manner. Here is one example of an online normal map creation utility, NormalMap-Online. If you set that utility to a strength of 1 and invert the R, you will end up with a normal map close to what we will create below.]

Now for those who really want to roll up their sleeves and learn how to create normal maps from photographs manually in an image editor such as Adobe Photoshop I present the step-by-step process.

Create the Blue Layer in Photoshop

You could just take a fifth photograph with the light directly perpendicular to the object, but I couldn’t get the right angle due to the size of my camera and the close proximity didn’t allow the light to be placed at the proper angle. So I figured I would construct it by compositing the four side lighted photographs instead. I had initially tried using the shadows from each of the side lighted images to make the composite blue channel but that ended up looking a little rough and splotchy. The highlights are smoother than the shadows so I’ve updated this section to composite the blue channel using the inverse of the highlights instead of the original shadows as follows.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

This results in an image where all the areas facing the viewer are light with smooth shadows for all areas tilting away from the viewer.

Create the Normal Map Layers

At this point in learning how to create normal maps from photographs we have all the necessary ingredients. We have the photographs that capture the lighting from the four sides, top, right, bottom and left. We also have an image composited from those photographs that simulates light perpendicular to the image. Now it’s time to put the images into the appropriate color channels to create the actual normal map.

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

I used adjustment layers throughout so that you may tweak them as desired to adjust the overall balance if necessary.
Export this finished normal map as a png image.

How to Apply Normal Maps in LightWave 3D

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

Repeat the same process with the back face of the coin. You may need to invert some of the axes on the Normal Map node for the back side. Especially if you flip/rotate the image for the back side of the coin on the +Z axis.

Move a light around with VPR on to make sure all the normal vectors are properly oriented. Verify that the light behaves properly as it moves around the object.

Viewing the Results of How to Create Normal Maps from Photographs

Here are some simple examples of using the results of this process of how to create normal maps from photographs. A still test render and a bullet dynamics animation test created in LightWave 3D for a new animation project currently in development – Heads or Tails. Enjoy!

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

How to make normal map. Смотреть фото How to make normal map. Смотреть картинку How to make normal map. Картинка про How to make normal map. Фото How to make normal map

This is an early work-in-progress (WIP) test render from another shot in the same animation project under development – Heads or Tails. This is just an initial test of using a pile of coins in a pot of gold at the end of a rainbow created by a volumetric light. Most of the plant models are from XFrog’s free plant samples and VizPeople’s free grass samples. I refined some of the models and improved their surface textures for what I needed.

And here’s the finished result…

You can get Gold Coins similar to those I borrowed for this project on Amazon.com

If you enjoyed this tutorial please consider making a donation to fund more!

DreamLight Constellation Network Render Controller

DreamLight® Constellation is our cross-platform network render controller that combined with DLI_SNUB-Launcher™ makes configuring, launching and controlling LightWave 3D ScreamerNet LWSN for standalone, batch, network and internet rendering, drag-and-drop-dead-easy™.

Источники информации:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *