<p>I'm asking this question on behalf of a friend so can't provide any images for now. The problem is to simulate a car paint material with some flakes or graininess in it. This is first done in blender by creating a material. The flakes are added by using flakes normal map which simulates all the perturbed normals. I suppose this causes micro variations which causes the base color to drop at random locations giving the effect of graininess.</p>
<p>Now blender provides a <a href="https://docs.blender.org/manual/en/latest/render/shader_nodes/vector/normal_map.html" rel="nofollow noreferrer">normal map node</a> which is used in the shader graph. This has a strength parameter. When the strength is 0, there are no flakes. I searched around the net and found that this effect is probably achieved by lerping between the sampled normal from the normal map and the vector <code>0.5, 0.5, 1</code> which seems to be a null or flat normal as it maps to <code>0,0,1</code> in the tangent space which means no change.</p>
<p>The question is, as I understood, changing normals should affect the reflections on the surface, however when I change the strength in blender between 0 and 1, only the graininess changes and the reflection remains the same. When I say the reflection should change, I mean the position of the reflection should change, since the reflection vector would change based on the normal. This doesn't seem to happen in blender. Are they using the plain original normals for reflection and the perturbed ones for other kind of shading?</p>
<p>He implemented the same technique in threejs and it seems the reflections don't change there as well. However, instead of lerping between the sampled normal and <code>0.5, 0.5, 1</code> when we lerped between the sampled normal (after converting it to -1 to 1) and the original geometric normal based on the strength, the reflections on the surface moved as I expected. Can anybody explain what happened? What's the difference between the 2 approaches and why in only the second approach the reflections move or change their position?</p>
<p>UPDATE:- Turns out there was a slight error in triplanar mapping. After fixing it, the reflections do change positions slightly when implemented in threejs. So now the reflection change position in threejs implementation both ways but I still don't understand why the same doesn't happen in blender. Will update if I figure it out eventually</p>

CC BY-SA 4.0
2021-07-04T11:30:55.503Z
Take a look at the answer here (by Nathan Reed). Be sure to follow the link provided in the answer. The paper doesn't answer the question you are asking but it certainly related. https://computergraphics.stackexchange.com/questions/11005/what-does-filter-mean-in-glint-rendering-and-texture-mapping
pmw1234
CC BY-SA 4.0
2021-07-05T16:38:00.530Z
In general yes reflections will depend on the normal. That said, it's hard to tell what's going on without being able to see screenshots. I'm confused by "lerp between the sampled normal and the original geometric normal" since if you're in tangent space, the original geometric normal is by definition (0,0,1). If you were lerping tangent-space vectors to the _world-space_ geometric normal, then you would definitely see reflections moving around, but they wouldn't be correct. :)
Nathan Reed
CC BY-SA 4.0
2021-07-05T16:40:15.893Z
Also, with a car paint material, typically there is a clearcoat layer on top of the flakes, and you would primarily see reflections coming from the clearcoat which remains smooth (or perhaps has its own separate normal map), but is unaffected by the flake normal map. Perhaps that is part of the issue as well.
Nathan Reed
CC BY-SA 4.0
2021-07-05T17:04:47.183Z
You are correct about the clearcoat. But there is no separate normal map provided for the clearcoat. So I'm guessing they are using the original geometry normal for that which I change pretty early in the shader to a different normal based on the flakes normal map.  Regarding your 2nd comment, he is using triplanar normal mapping. When I said lerp between the sampled normal and the geometric, I meant after converting the sampled one to world space.
gallickgunner
CC BY-SA 4.0
2021-07-08T13:50:13.493Z
@gallickgunner this does not seem like a generic computer graphic question but rather a question about how the paricular blender shader is implemented. Go ask blender se, your more likely to get a specific answer.
joojaa
<reflection><normal-mapping>
Normal mapping should affect specular reflections?
gallickgunner
# Normal mapping should affect specular reflections?

(Asked by: username_0 on 2021-07-04)

I'm asking this question on behalf of a friend so can't provide any images for now. The problem is to simulate a car paint material with some flakes or graininess in it. This is first done in blender by creating a material. The flakes are added by using flakes normal map which simulates all the perturbed normals. I suppose this causes micro variations which causes the base color to drop at random locations giving the effect of graininess.

Now blender provides a [normal map node](https://docs.blender.org/manual/en/latest/render/shader_nodes/vector/normal_map.html) which is used in the shader graph. This has a strength parameter. When the strength is 0, there are no flakes. I searched around the net and found that this effect is probably achieved by lerping between the sampled normal from the normal map and the vector `0.5, 0.5, 1` which seems to be a null or flat normal as it maps to `0,0,1` in the tangent space which means no change.

The question is, as I understood, changing normals should affect the reflections on the surface, however when I change the strength in blender between 0 and 1, only the graininess changes and the reflection remains the same. When I say the reflection should change, I mean the position of the reflection should change, since the reflection vector would change based on the normal. This doesn't seem to happen in blender. Are they using the plain original normals for reflection and the perturbed ones for other kind of shading?

He implemented the same technique in threejs and it seems the reflections don't change there as well. However, instead of lerping between the sampled normal and `0.5, 0.5, 1` when we lerped between the sampled normal (after converting it to -1 to 1) and the original geometric normal based on the strength, the reflections on the surface moved as I expected. Can anybody explain what happened? What's the difference between the 2 approaches and why in only the second approach the reflections move or change their position?

UPDATE:- Turns out there was a slight error in triplanar mapping. After fixing it, the reflections do change positions slightly when implemented in threejs. So now the reflection change position in threejs implementation both ways but I still don't understand why the same doesn't happen in blender. Will update if I figure it out eventually

**Tags:** reflection, normal-mapping

> **Comments:**
> **username_1**: Take a look at the answer here (by username_2 username_2). Be sure to follow the link provided in the answer. The paper doesn't answer the question you are asking but it certainly related. https://computergraphics.stackexchange.com/questions/11005/what-does-filter-mean-in-glint-rendering-and-texture-mapping  
> **username_2**: In general yes reflections will depend on the normal. That said, it's hard to tell what's going on without being able to see screenshots. I'm confused by "lerp between the sampled normal and the original geometric normal" since if you're in tangent space, the original geometric normal is by definition (0,0,1). If you were lerping tangent-space vectors to the _world-space_ geometric normal, then you would definitely see reflections moving around, but they wouldn't be correct. :)  
> **username_2**: Also, with a car paint material, typically there is a clearcoat layer on top of the flakes, and you would primarily see reflections coming from the clearcoat which remains smooth (or perhaps has its own separate normal map), but is unaffected by the flake normal map. Perhaps that is part of the issue as well.  
> **username_0**: You are correct about the clearcoat. But there is no separate normal map provided for the clearcoat. So I'm guessing they are using the original geometry normal for that which I change pretty early in the shader to a different normal based on the flakes normal map.  Regarding your 2nd comment, he is using triplanar normal mapping. When I said lerp between the sampled normal and the geometric, I meant after converting the sampled one to world space.  
> **username_3**: @username_0 this does not seem like a generic computer graphic question but rather a question about how the paricular blender shader is implemented. Go ask blender se, your more likely to get a specific answer.  

---

## 0 answers

