1
$\begingroup$

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

$\endgroup$
5
  • $\begingroup$ 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. computergraphics.stackexchange.com/questions/11005/… $\endgroup$
    – pmw1234
    Jul 4, 2021 at 11:30
  • $\begingroup$ 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. :) $\endgroup$ Jul 5, 2021 at 16:38
  • $\begingroup$ 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. $\endgroup$ Jul 5, 2021 at 16:40
  • $\begingroup$ 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. $\endgroup$ Jul 5, 2021 at 17:04
  • $\begingroup$ @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. $\endgroup$
    – joojaa
    Jul 8, 2021 at 13:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.