Download

What is a material, texture and normal map

Can some explain to me what each is used for, in beginner terms?

I think it’s like this:

  1. A material is a 2D image that gets applied to a mesh to make it look like something (rock, brick, etc.).
  2. A texture is a 2D image that is used in the material editor to give the material surface detail (roughness).
  3. I don’t know what a normal map is for. I’ve read about it a little. Is it a method to give 3D models more detail without making them more complex?

Thank you.

I am a beginner too , but will try to explain things , as i think:

  1. Material is not actually an 2D image. In a material you can use 2D images , to give the mesh or surface the look you are looking for. You can control the diffuse color, the reflection, refraction , opacity and a lot of other parameters. You can tweak all the parameters to achieve the result you are looking for.
  2. Textures are 2D images most of the time and yes they are used in the material editor to achieve different results, but most of the times when you are applying 2D texture to a 3D model you must “wrap around” that 2D image , by Unrapping the objects UVs or applying a simpler method of UV mapping(box, spherical, etc.)
    3)Normal mapping is a method of giving a 3D model more detail without the model actually having it. This is achieved by faking the lighting of bumps and dents, so if you want to preview your normal map you will need some lighting. Bottom line, you have more detail on the same low polygon mesh.

You have the right idea but let me introduce you to a whole new world of possibilities: shaders.

A material is not a just 2D image, it’s a shader.
A shader in UE4 is normally written in HLSL (it’s a shading programing language) although the material editor makes this really easy so you don’t have to actually write any code :stuck_out_tongue: much like blueprints instead of C++.

So as you can imagine you can do all sorts of awesome things with a material that go far beyond what a texture can do… custom lighting models, parallax occlusion, ocean displacement and so on… the possibilities are endless really.
There are cases where you don’t need to use a texture in a material at all too.

As tk-master said -

material == shader ( a small program that runs on the gpu and colors each pixel)
texture == 2d image data ( like png or bmp )
normal map== a specially created texture that contains lighting information of the model it is intended to be used with. (also png or bmp)
model == 3d vertexes representing a 3d shape (like fbx or obj)

btw - there are many types of commonly created textures that can be used by the shader like the normal map - e.g. diffuse, ambient occlusion, specular, roughness

You are actually incredibly close to being correct on what each does. Here is a breakdown that I use when explaining this to people.

Texture: A Texture is a static 2D image that can be applied to meshes to give them the appearance of real world objects like rocks or bricks.
Material: A Material is generally made up of a combination of 2D images and / or Math expressions that you manipulate to produce an image. Materials are also dynamic meaning that they can change over time and you can also use a Material to adjust the look of a Texture.
Normal Map: You were actually correct on your description for a Normal map. All a Normal map does it help to re-create small details that would otherwise be too costly to render in real time.

Hope that helps. Please let us know if you have have any more questions.

A normal map doesn’t contain lighting information, it essentially contains an ‘offset’ to the normal of a surface for each pixel.

Basically, 0.5,0.5,0 (or 128,128,0 - corresponding to X,Y,Z) is ‘flat’ meaning the normal map will not affect how light hits the surface. If you start adjusting the first two values (X, Y) then the light hitting it will think the surface is angled in a different direction. Hence, you can use it to add detail like bumps.

Thanks Dave - but I am intentionally trying to keep things simple and clear.

Although I am completely unclear why you insinuate it does not contain lighting information. It contains the normal of the surface which is the primary information needed to calculate the lighting of the fragment. The normal map is absolutely used by the shader to evaluate lighting at the surface in both deferred and forward rendering. The bump detail you speak of is determined by perturbing the fragment color based on the incident angle.

In deferred shading, (the default in UE) the lighting calculation is deferred until the g-bufffer is built. However, the normal map directly contributes to the g-buffer.

Hence my statement “a specially created texture that contains lighting information of the model it is intended to be used with” is completely accurate.

The normal contains information required to light the surface. It is probably the most important piece of lighting information in the model, after the position in 3d space.

I am sorry if you thought I meant “information about lights in the scene”, but rather I intended as “information about the model used to apply lighting it”.

That’s my point: although (I guess…) what you said is accurate, I would describe the normal map as contains information for lighting, rather than lighting information. I think that is clearer for an end user to understand what the normal map is doing as a component of the shader.

So is this how it’s done (my example will be a small first aid kit)?

  1. create a 3D mesh
  2. wrap a 2D image or “material” (white with red cross) around the mesh
  3. use another 2D image “texture” to give the red cross a “raised” look
  4. use a normal map to make the first aid kit look like it has scratches/marks on the surface

A material doesn’t necessarily have to use a 2D image, it can be just a solid color without any special details, you use textures when you want to add details to the material. So a texture might be a red cross on a white background that you would plug into the Diffuse (color) slot of the material, and then the normal map could be used to make the red cross look like it has a raised effect.

Please let us know if you have have any more questions.

Cool, please see below… Maybe you could clarify those points here or in the thread… Thanks!

#1.

But they can only ever be applied to meshes via materials correct? (or does this only apply to UDK)…

#2.

What about shaders… 3D apps always refer to shaders not materials… (Shader language too).
Are Shaders the implementation of materials, is that how we should look at them?

#3.

Normal maps … Parallax occlusion mapping (POM) … Bump maps … Displacement maps…?
Which gives the best results, which is more important to understand?

Cool, Maybe you could clarify those 3 points… Thanks!

#1.

But they can only ever be applied to meshes via materials correct? (or does this only apply to UDK)…

#2.

What about shaders… 3D apps always refer to shaders not materials… (Shader language also).
Are Shaders the implementation of materials, is that how we should look at them?

#3.

Normal maps … Parallax occlusion mapping (POM) … Bump maps … Displacement maps…?
Which gives the best results, which is more important to understand?

Franktech -

#1 - A 2D Texture can only be applied to a mesh via a Material/Shader.

#2 - A material in a 3D package (and, in this case, Unreal Engine) is just a user-friendly interface for a shader. When you save the material, Unreal creates the actual shader in the background.

#3 - Normal maps are the most common and therefore important to understand, but they all achieve different things. POM tries to mimic depth, which a normal map cannot do. Bump maps are effectively the precursor to normal maps, but they can only infer depth away from the surface normal (not change it’s direction), meaning you can only mimic things like scratches and knocks on a surface. Normal maps used to be called Dot3 Bump Maps because they could manipulate a normal in X,Y,Z instead of just Z. Displacement / Height maps are used for physically displacing the vertexes/polygons of a surface, usually with tessellation.

OK. So to update my previous post:

  1. create first aid kit mesh
  2. apply a texture to the first aid kit
  3. apply a material to the first aid kit (if needed)
  4. use a normal map (if needed)

Is a texture used before applying a material, or the other way around?
Is a texture and material used at the same time to achieve a wanted look?
A normal map is only used if added detail is needed?

The material has a bunch of different slots that you can plug textures into, you apply the material to the mesh, the texture has to be plugged into the material. The normal map is another type of texture that gets plugged into the material as well.

Now I get it. I didn’t know if they were used separately, or all together. I followed a tutorial where I made a “Rock” texture, helpful, but it didn’t explain what each item did.

I also found the material and texture documentation for UE4.

#1: This is correct, you can only ever apply a Texture to an object via a Material.

#2: Shader and Material are interchangeable terms that reffer to the same thing.

#3: All of the maps you talked about are important and used for different reasons. Depending on what you want to do, or what type of detail you are trying to achieve will determine which type of method you will use. If I had to pick one to learn it would be normal maps as they are the most used.

Hope this helps.

Texture - A 2D image that can be applied to a 3D object
Normals (in general) - The surface definition of an object
Normal textures - A 2D image that defines the surface definition of an object. This may be used to bend light around and make bumps along the surface, for example.
Material - A code used to shade a 3D object. Without materials, 3D objects only exist as polygons and vertices in space. The material defines what that 3D object looks like, and how it is rendered.

Parallax - A technique that bends a texture based on the viewing angle to give the illusion of depth along a surface.
Parallax Occlusion - A technique that bends a texture and occludes details to give the illusion of real depth along a surface using only 2D textures.
Displacement map - A texture to provide depth information to use in techniques like parallax, parallax occlusion, or tessellation.

How you decide to make your normal maps is up to you. Some people like to sculpt detail on a high resolution mesh in Z-brush and bake them down onto a lower resolution mesh, generating an accurate normal representation of the object. Others like to make normal maps by hand with tools like XNormal, and then paint texture maps like the color and displacement. But the end result must give you some way to bend the light around details in your mesh to provide a more detailed result than what can be obtained through polygons alone.

In the screenshot below, there are only 2 polygons: the appearance of depth and form comes from the normal maps and displacement maps in the parallax occlusion shader. No polygons.

Cool, thanks Sam, DaveFace, Mariomguy …

So I made a small box in 3DS Max. Exported it as a .FBX file. Imported it into UE4. Applied a material to it (just a white background with a red cross on it). It put the red cross on all 6 sides of the box.

I think I first have to do UVW mapping before exporting/importing it and then open the material in the Material editor for further work. Or do you create the material in UE4 first then use that for UVW mapping?

Is there a tutorial that shows the steps in the correct order?