I’m running into what seems like specular aliasing, and I’m wondering if this is expected, and whether there’s any obvious way to mitigate it.
I have a shiny material with a normal map, which has some high intensity, high frequency details that represent “microbevels”.
This looks fine when there are enough pixels, but when viewed from afar (low density sampling), I’m getting a lot more sparkly aliasing than I expect.
The aliasing can be mitigated effectively by increasing roughness, or by overriding the texture2D
call to use a mipmap bias. This has the unwanted side effect of reducing detail in other non-problematic areas of the texture.
Ideally, the “roughness” would automatically increase just for the edges, where there is a high rate of change in the normal, and when the pixel density requires it. I could maybe craft a roughnessMap
and modulate roughness
based on these conditions.
But that got me wondering whether ThreeJS is expecting to do this calculation already? Does ThreeJS take into account the normal delta when it decides the way incoming lights will be calculated? Or is each pixel modelled as a “facet”?