Awhile back, I mentioned the long shadows that you see at the terminator on the lunar surface and how you won't get those using normal maps for lighting:
Certainly using a normal map in the lighting calculations won't get you the kind of long shadows you see if you look up images of "lunar terminator", like this image from NASA:
And I posted this picture to illustrate the kind of shadows I'm talking about:
Now I come across this technique, called "Normal Mapping Shadows":
http://enbdev.com/doc_normalmappingshadows.htmHere is an example without this technique and with it. The effect is especially prominent in the tire tracks. (you may need to "view image" if the forum clips it too badly.)
Now to implement this in SNIS, I would need to overcome a few problems:
1. I need to understand the basics of how it works. I think the basic gist of it is, in the fragment shader, you use a vector towards the light to define a line through the normal map texture that you traverse, summing some dot products as you go to see if a shadow would be cast at that location, and how strongly.
2. I need to take into account the curvature of the planet surface. Currently the fragment shader only has the interpolated normal vector at the particular texel, as you traverse across the normal map, this normal would rotate about the center of the planet by a bit. Might be able to ignore this if the traverse is not too far at some loss of accuracy.
3. I need to figure out how to deal with the cubemap seams. This seems a bit harder because the tangent and bitangent vectors change discontinuously across this seam, not to mention other mind bending complexities.
I'm not feeling quite ambitious enough to think I will really implement this, but it is cool to realize that it *is* possible to do with only the normal map. It might also require a better graphics card that what I currently own to do this fast enough, but worrying about that now is putting the cart before the horse.