Tag Info

Hot answers tagged

21

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 ...


17

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 ...


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 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, ...


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

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 ...


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

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 ...


3

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 ...


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 ...


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 ...


2

N_a is the result of the normal map fetch, which is usually not unit length because it is a linear blend of almost-unit vectors. The normal map typically encodes normals in tangent space, which is to say that a normal in the map with the value [0,0,1] points directly away from the surface along the surface normal. You are right that N_a is "the normal ... ...


2

Take the diagram below; the normal is simply the deviation from the 'reference normal' for any given coordinate system, correct? No, it is not. The simplest way to understand this is to take the simplest possible case of bump mapping. Your geometry is a flat quad. And you're going to apply a normal map to this quad. Now, let's say that all of the ...


2

This is the effect that will occur if you treat the shape as a rectangle, and use its bounding box as the 0,0 -> 1,1 mapping: This is your texture: This is your shape with texture coords mapped to bounding box(approximate guesses shown): This is the final result: As you can see you've basically sliced a shape out of the original texture. If that's not ...


2

To try and make reasonalby comple mathematical theory sort and concise: it is because the Normal is actually a co-vector rather than a vector. The difference between a covector and a vector is that a co-vector defines an opposite 'handedness' on sign reversal, while a vector defines an opposite 'direction' on sign reversal. For instance, reversing the normal ...


2

Since you didn't provide links to these tutorials that confused you, I am going to assume that they weren't written by idiots and that the code in them is correct (where possible). They're all correct (well, except transpose guy; I'll get to him). Your problem (likely stemming from the writers not being clear) is that you're not seeing the other differences ...



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