Skip to main content
6 votes
Accepted

How can I make a beveled edge with bump mapping?

The usual approach to this is to use your 3D software to create a “high” and “low”-detail version of your model, then bake a normal map that maps the details from the former onto the latter. For a ...
Noah Witherspoon's user avatar
5 votes
Accepted

How do you compute the tangent space vectors with normals given in the mesh?

Summarizing the clarifications above as an answer: There are multiple ways to generate tangent spaces for a mesh, and not all of them agree on the result. This is a common source of rendering errors ...
DMGregory's user avatar
  • 135k
3 votes
Accepted

Why is a baked normal map more efficient to render than additional physical detail?

Reading the comments I think I've understood what @Viziionary was asking, and that's my answer: First one of your assumption is wrong: normal mapping gives us just an approximation which is clearly ...
Liuka's user avatar
  • 585
3 votes

Why is a baked normal map more efficient to render than additional physical detail?

The problem is that the density of your mesh needs to be higher. Which requires more computational power and memory ( also think of lower end targets/devices ). Additional not ideal for rigged meshes. ...
Sidar's user avatar
  • 3,577
3 votes
Accepted

Issue with tangents/bitangents generation for normal maps

You need to average tangents and binormals from the neighbor triangles to get a the correct result. I suggest you take a look at Martin Mittrings (Crytek) code: http://www.shaderx4.com/...
Henning Semler's user avatar
3 votes
Accepted

How does Mikktspace work for calculating the tangent space during normal mapping?

There is more code to that project: https://github.com/teared/mikktspace-for-houdini/tree/master/source Also you can find information about tangent space normal maps here: https://archive.blender.org/...
Tripl3Fac3's user avatar
2 votes

Is it possible (and practical) to dynamically create normal maps from graphics in Pixi.js?

I'm confused by your question; I think you're going about this all wrong. Let's first consider that it would have to be an advanced algorithm indeed that could (accurately) reconstruct surface ...
Engineer's user avatar
  • 30k
2 votes
Accepted

How can I detect handedness of normal maps in a shader?

There's no good way to detect different data formats from each other in shader code. In general you should always give the same kind of data to your shaders. You need to pre-process your data before ...
Lasse's user avatar
  • 3,241
2 votes

How to write a shader that only uses a bump map without a normal map

The code by Mikkelsen "Bump Mapping Unparametrized Surfaces on the GPU", suggested by Ray Hulha, is the right solution. However the listings are a bit fragmented in the paper. Here is a ...
ramakarl's user avatar
2 votes
Accepted

Why does Radiosity Normal Mapping use 3 directional components and not 5?

You can see this explained in this figure from Valve's slide presentation on the topic at GDC 2004: They don't measure the lighting along 5 basis vectors \$(\pm 1, \pm1, 0), (0, 0, 1)\$, where only ...
DMGregory's user avatar
  • 135k
1 vote

Dark spot glitch in normal mapping shader - WebGPU

The first thing that jumps out at me is that you aren't normalizing your pixel shader inputs that represent quantities that you're expecting to be normalized. This is necessary because the ...
Adam's user avatar
  • 7,384
1 vote

Surface normal vs tangent space

Keep in mind the reason why tangent space is used. It's to provide an orientation for the normal map to know whether the normal needs to be adjusted in the u or v direction. For that you need to know ...
ratchet freak's user avatar
1 vote
Accepted

How to use Texture2DArray with Normal map and Normal Unpack node in Shader Graph

Problem was, Normal Unpacking only works with non-SRGB textures. In order to generate non-SRGB Texture2DArray you'd need to provide last parameter(Set texture to be ...
Nick's user avatar
  • 561
1 vote
Accepted

How can I access the normal map value in Unity?

Following @DMGregory's excellent feedback, I wrote the following class to test: ...
Chuck's user avatar
  • 249
1 vote

Apply Secondary Normal Map to Standard Shader by Script

Turns out the issue was that a constant that represented the keyword was updated to have two keywords instead of just one. In effect, we were doing: ...
Zoop's user avatar
  • 161
1 vote
Accepted

How to calculate normal from normal map in world space? (OpenGL)

When using a deferred rendering pipeline, your normal-mapping workflow is as follows: Writing to GBuffer: Vertex shader: Compute T, B, and N vertex properties. Multiply by normal matrix. Construct ...
Ian Young's user avatar
  • 2,649
1 vote
Accepted

How to write a shader that only uses a bump map without a normal map

Bump mapping simulates surface displacement, i.e. the shader pretends that the pixel is further back along the surface normal than it actually is. It then compares the depth to the pixels next to it ...
Ian Young's user avatar
  • 2,649
1 vote
Accepted

Unity: Change the type of a Texture2D to "Normal map" through script

Nevermind, the fact is you have to apply with a different name: material.SetTexture("_BumpMap", normalMap); material.SetTexture("_ParallaxMap", heightMap); Why, ...
Nicolas Cailloux's user avatar
1 vote
Accepted

Normal doesn't appeared on shadow/dark area in Mobile Shader

Since normals encode the facing direction of your surface, they only produce a change in lighting for directional lighting terms: Direct illumination from a directional, point, spot, or area light ...
DMGregory's user avatar
  • 135k
1 vote

opengl bump mapping (normal mapping) problem with VBO and GLSL

That's not how bump mapping works. Bump mapping adds additional detail to a model, but doesn't change the triangles. You need to render a mooth mesh to make the edges invisible (the normals of a ...
Bálint's user avatar
  • 14.9k
1 vote

Spine and 2D Unity Weird Light Issue

"When you've been working on a problem for 1 hour, ask a question on a forum, and then solve your problem 3 minutes after asking the question" = SMH. The problem is that im rotating my character 180 ...
Jelani's user avatar
  • 121
1 vote

Correct normal map for rotated sprites

this is how I solved this issue for myself. I hope it helps , ) In the frag shader the important bits are. . . ...
phantaguber's user avatar
1 vote

Correct normal map for rotated sprites

Assuming you have access to the code of the shader and not using a "magic" library. Instead of rotating the normal texture, you could modify the direction of the normal vector. Since on the normal ...
Romain Thuillez's user avatar
1 vote
Accepted

Simplst possible TBN-Matrix giving weird results

Found the problem. The TBN apparently needs to be constructed as the following: mat3(worldspaceNormal, biTangent, tangent);. So tangent and normal need to be ...
RenX's user avatar
  • 707
1 vote

How to create a normal map for my dice texture?

Unity can create a normal map from a simple greyscale image where white is the highest and black is the lowest. That means the albedo texture you have there might already serve as a simple normal map. ...
Philipp's user avatar
  • 120k
1 vote

Normal map does not export into .dae file. Does Collada not support normal maps?

One thing I can think off is that it's not correct in the .dae. Open the .dae file in a text editor. Search for: <bump> If it's just called ...
Kus's user avatar
  • 21

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