Normal 1: what normal maps are and how they work
artstation.com
artstation.com
It's basically the same thing, but might help if you're more familiar with vector/matrix math
The main thing for me was realizing the goals of the pipeline. You need to process each pixel on its own in parallel to get the speed you need. All these texture techniques are in service of prebaking data down such that it can be effeciently prefetched before the shader needs it.
At least for me, understanding the why helped me understand the what.
The modern normal map was introduced by Kilgard as a rotation on top of the unperturbed surface normal [1] in surface tangent space, allowing it to be encoded with three channels, and compressed to two.
[0] https://www.microsoft.com/en-us/research/wp-content/uploads/... [1] http://developer.download.nvidia.com/assets/gamedev/docs/GDC...
Thank you for sharing!
But there seems to be an error: the first example that shows it applying to a sphere:
https://cdnb.artstation.com/p/media_assets/images/images/000...
The hard-transition version on the left shows the outline of the sphere with clear line segments, but the smooth-transition one on the right shows a perfectly circular outline. (The clearest comparison can be seen in the darkest section, the bottom-left edge.)
So smoothing groups are clearly doing something in addition to changing how light reflects and this is not the full story.
Does anyone know how the perfectly smooth, non-polygonal outline (silhouette) is achieved? This post is clearly not providing the full story.
This makes sense for such things as specular highlights, but most of what we are seeing is simply shading. That is, the brightness of the surface is simply a matter of how much light is hitting the surface, due to the angle of the surface to rays of light from the light source. I would word it "how a surface is illuminated" rather than "how light bounces from a surface."
Put simply, a surface can't bounce any light if it doesn't receive any light to begin with. It's a weird, nitpicky statement, but hey, that's what this site is about, right?
> All lighting is just light bouncing off of things
In real-time graphics, bounce lighting is pretty rare. Typically you cache incoming irradiance into some form offline to emulate bounce lighting. Most of our scenes are lit with analytic lighting. A key directional e.g. sunlight for most light, and then punctual sources like point and spotlights for additional lighting tweaks.
So, I don't agree that the normal's effect on diffuse lighting is on the way light bounces off things, instead it is the quantity of light that hits the surface.
I just think he could change the wording (as I suggested) to make it more accurate, so it betters people's understanding of the more general subject. It would be a simple change that would be easy to make, so it's intended as constructive criticism rather than just quibbling.
In theory, if you had a high enough resolution texture and used enough samples you could actually represent all materials with only specular reflection.
Diffuse light is simply an approximation we use. We effectively have a value for “roughness” of a surface and assume that some percentage of the lights scatters in all directions using various approximations of how rough surfaces typically reflect light.
So yeah, it’s always “light bouncing off things”
Sort of, but not entirely, or you would get micro-flares on the surface, which we don't observe in reality. The other half of the equation is light that bounces around inside the object, and then comes out effectively in a random location. The majority of diffuse light is light that has been subsurface scattered. A huge simplification we make is assuming that that light can be modelled with a uniform constant factor, e.g. Lambertian diffuse. For surfaces with with microgeometry larger than the scattering distance, you need a more robust diffuse model, like Oren-Nayar.
Here's one of many things I've written on it (and my experiments related to specularity and such go back to the early 80s) https://www.quora.com/Why-does-snow-appear-white-in-colour-w...
Do recognize that Carlos said at the beginning, “Most explanations I found are usually too technical, incomplete or too hard to understand for my taste, so I decided to give it a try and explain what I gathered. I recognize that these explanations may be incomplete or not 100% accurate, but I want to try anyway.“
FWIW, your suggestion sounds to me more like it’s about the light sources, and not the surface. The normals don’t really affect how the surface is illuminated before the light bounces off (which is what “how the surface is illuminated” sounds like to me), the normals define the orientation of the surface, and so combined with a material and lights, the normals really do (help) define how light bounces off a surface.
There are some established graphics terms for these things, but getting nit picky and accurate to that level would be detrimental to this blog post, I think. We don’t need everything to have the Wikipedia disease of being so accurate that only the experts who know the material and don’t need it can read the article. Carlos already found other explanations of normal maps too technical, so I guess he’s not interested in explaining the difference between radiance and irradiance just to describe the idea that normal maps change the surface orientation and affect shading.
Since the entry and/or exit angle matters, perturbing the geometrically flat normals (from triangles) makes the surface appear to have curvature.
This is important even for purely diffuse reflections. So I disagree with your wording.
[1]: In some cases, such as skin, it's also important that the entry point and the exit point typically does not coincide. However for most materials one can usually get away with ignoring this aspect.
But the idea here is that it’s easier to understand. If you show an object space normal map, and then show the rendered model, you can say, “aha, it’s really obvious how that works”.
And then you can introduce the tangent space normal map, and describe how you use transformation matrices to convert tangent space to object space. Showing the object-space normal map gives you insight into how tangent space normal maps work.