# Tag Info

## Hot answers tagged normal-mapping

27

Short Answer Normal maps and Normals are two different things: Normals are a geometric property of any mesh/surface its use is not exclusive for shading and lighting calculations but have actually many other uses for example in physics. Normal maps are textures that encode alternative normal vectors used in computer graphics to simulate bumps. Long Answer ...

18

Tangent space is perpendicular to the geometric normals - the interpolated vertex normals of the polygons. The normal map provides the shading normals, relative to the tangent space defined by the geometric normals. When the shading normals are not the same as the geometric ones - i.e. because you have a detailed surface texture with features that are not ...

14

A texture mapping is the mapping between points on the 3D surface and their corresponding points on a texture image. If you have a 1:1 texture mapping, then every point on the 3D surface maps to a specific and unique point in the texture image (though the reverse would not need to be true. Some locations in the texture would not necessarily map to locations ...

9

I am assuming your intention is to use this normal map in a game, as it was explained in other comments, you most likely don't want world space normals since they only work for a fixed world. Your problem with tangent normal baking is that you don't have a mesh with less detail to bake the map to. This is how you do it: 1 - Create a lower-res version of ...

9

The colors in a normal map represent the normals at each point. If a normal is (x, y, z), the corresponding pixel in the normal map will have each of x, y, and z mapped from the range (-1,1) to (0,255) to get the red, green, and blue components respectively. Now the z-axis is typically used as the direction away from the surface. A perfectly flat surface, ...

8

You already know what you have to do, I'll just summarize it. There are three ways to solve your problem: Go ahead and make a conditional like you're saying, either by sampling the texture or by creating a separate uniform for this purpose. As you probably know, adding branching on a shader is almost never a good idea, and much less so in the fragment ...

7

First of all, re: "why we cannot just use the normalised sum of the sampled-normal vector, and the surface-normal?" If they're in the same space already, summing these two just has the effect of halving the strength of the normal map - it effectively blends 50% between the normal map and the non-normal-mapped geometric normals. If they're not in the same ...

7

The bitmaps might be getting loaded in BGRA format instead of RGBA. Windows .bmp files are always stored in BGRA order, for example. If that's the case, you just need to tell OpenGL so, by passing GL_BGRA instead of GL_RGBA in your glTexImage2D call.

5

To sucessfuly bake a normal-map you need to make sure of 2 or 3 things. Make sure that your mesh is manifold. (E.g. that there are no double-sided faces.) You can check that in edit-mode by pressing Ctrl+Shift+Alt+M, this will select all non-manifold edges. Make sure to select "Tangent" for Normal Space in the Bake Panel. This is the method usually used in ...

5

There are quite some tutorials, I'm sure, on the issue of normal mapping, but since you're here, I assume you're not satisfied with what you found. In your case, the terrain is ussualy a Monge Patch, which is not a complicated 2D manifold to perform geometric measurments using normal differential geometry. First, why a normal map technique? Because the ...

5

Right, normal mapping isn't done by componentwise multiplying the object normal and the texture normal. They're vectors, and that operation doesn't make geometric sense for vectors. For the standard way of doing normal mapping - tangent-space normal maps - the idea is to construct a 3x3 tangent-to-world matrix at each fragment and transform the texture ...

5

Short Answer Because adding two vectors together and normalizing the result will give you a vector that is halfway between the two of them. I don't think that corresponds to what you were thinking it would do. Long Answer Take for instance the following picture from an unrelated subject (Blinn-Phong shading model) and pay attention to the H vector: The ...

5

The skin is fairly smooth with some big dimples. A first approximation would be (in the GIMP): Take a black image (in greyscale mode) Filters | Noise | Hurl to get some dimple locations Colors | Threshold to reduce it to black and white Filters | Gaussian blur at a small radius (maybe 2px) Colors | Curves to restore the necessary contrast and normalise the ...

5

Applying two normal maps is not that bad. Many games apply multiple normal maps already because they're blending between texture layers (e.g. for terrain), so having a normal map representing the larger displacements and another normal map for fine details is pretty reasonable. Check out Blending in Detail by Colin BarrĂ©-Brisebois and Stephen Hill for a ...

5

With any asset with UV coordinates, it's good practice to have parts that need more detail take up more area than parts that don't (usually, anyway). So you can have the UV coordinates for the detailed parts of your normal map scaled quite large, and the UVs for the less detailed parts scaled quite small. You can also have two different sets of UV ...

4

I've not touched DX11, but in the shader you seem to expect sampler 0 to be the diffuse, with sampler 1 to be the normal map. When you set the textures on the C++ side, you seem to have the slots reversed from what I can see.

4

You didn't really get astounding quality with Crazy Bump...hmm. don't know what exactly you are looking for. okey, here is another solution. Its called Insane Bump. Its functionality is similar to Crazy Bump. Try it out. There is an interesting comparison between this two bumpies. Oh did I mention. Its Free!

4

Well to begin, it's actually two textures, but basically what he's done is cram lots of individual maps into separate channels of the textures. So in those two textures, you have specular, normal, masks, albedo etc. Unfortunately, in order to extract all the separate bits of information and use them properly this means he has to have quite complex shaders ...

4

Your problem is in your Light vector calculation. vec3 lightpos = vec3(15.0, 26.5, 0.5); vec3 L = normalize(lightpos - vVertexCoord); Here lightpos is in World space, whilst vVertexCoord in is Object space. You need all your operands in the same space. Furthermore your TBN matrix(its not TNB) is wrong., it should be as follows: mat3 TBNmatrix = ...

4

A space is not just an axis though. Tangent space has 3 axes: the U tangent, the V tangent, and the normal. In your illustration you add an offset to the normal. But how do you know which direction to offset it? That's what tangent space defines. If the normal is Z, the tangent space gives you the orthogonal X and Y directions in which your offset ...

4

It's true that many tangent-space normal maps have only a limited range of colors. Object-space or world-space normal maps would have a wider range of colors, but if we're only using tangent-space normal maps in our game (as most developers do), it's a quite legitimate question to ask why we don't choose an encoding that trades off the range that we're not ...

4

It's common for people to compute lighting in eye space because of how the specular component of lighting in the Phong model is calculated. Doing the calculation in view space, allows you to avoid a vector subtraction in the vertex shader, a basically negligible optimization. If you were instead to do the calculations in world space, which you absolutely ...

3

Normal maps are mapped using the so-called tangent space, which is essentially a local space based on the model's texture-space. This should answer both of your questions. It's not viewpoint dependant because this space has nothing to do with the camera. In the normal map, Z is the up direction. If you look at the normals of a model, most of the normal ...

3

2. They may not always be normalized after transformation into projection or world space, even if you provide the correct inverse transpose of the vertex transformation.

3

The answer for your "cube" problem is probably that you're probably going to need more than 8 vertices. Make 4 for each face and set the normals for them to be the normal of the surface.

3

Who says we do not? You are limiting your thought process to Tangent Space Normal Maps, which (generally) always point away from the surface they are mapped onto. There are also World / Object Space Normal Maps, which contain every color of the rainbow because they are not related to the surface's coordinate space. As a fun experiment, you should multiply ...

3

This line diffuseTexture=vec4(normalize(texture(unifNormalTexture, frag_texcoord).xyz * 2.0-1.0), 1.0); Should be diffuseTexture=vec4(normalize(texture(unifNormalTexture, frag_texcoord).xyz ), 1.0); The reason is before normals are encoded into Normal maps their values could be in the range from -1.0 to 1.0, this doesn't really works with normal ...

3

Hey this function can return a normal map , form an image. It stores the exported image in the Editor Assets folder. You can also specify the strength to increase the bumpiness of the map :) private Texture2D NormalMap(Texture2D source,float strength) { strength=Mathf.Clamp(strength,0.0F,1.0F); Texture2D normalTexture; float xLeft; ...

2

Have you tried CrazyBump? It generates normal/displacement/occlusion/specular maps from a single diffuse texture, with astounding quality.

2

As you note, every vertex can only have one normal. That means that, depending on the lighting appearance you want, you may need to duplicate vertices. Specifically, if you want the edges of the cube to have a sharp boundary, then you will need to have separate vertices for each side. Make new vertices at the exact same position and use each duplicate for a ...

Only top voted, non community-wiki answers of a minimum length are eligible