Advertisement

Why does normal mapping stop working at flat angles?

Started by January 13, 2016 01:47 PM
7 comments, last by SeraphLance 9 years, 1 month ago

Hello,

I can't understand why normal mapping does not work for flat angles on a flat surface? Why is the impression of depth not preserved?

3684670cabc0465d8fcbda037a7445a0.png

Basically the illusion is spoiled. There is no actual modification to the surface with normal mapping and so its easier to see the failing of the effect, secondly the filtering can get kinda blurry and shallow angles.

Advertisement

I know its spoiled. But its working for other angles fine. Why not for flat angles?

It' because normal mapping only affects the lighting, not the actual shape of the geometry. And by shape, i mean the "height", which is what tesselation based height mapping manipulates. The missing changes in "height" are hard to recognize if the height axis is aligned with the viewing axis. Thats because of the perspective. And the reason why humans can more easily estimate horizontal distance than distance in the depth.

If you want to have the illusion preserved at flat angles, there are actually only two options:

1. Parallax mapping: Instead of just using a normal map to adjust lighting in the shader, you are additionaly providing an additional map (depends on the implementation, I have used height maps, but also more exotic maps for different parallax shaders)... what the parallax shader now does is to displace the pixels of all the other maps depending on the angle...

There is a ton of potential issues, which is why you don't see this used much in DX9/DX10 era games, and now with DX11+ and Tesselation as well as faster cards becoming available, it will become a less and less attractive option.

Issues can include "Texture swimming" (because geometry placed on a parallax shaded object might spoil the illusion, the textures seem to "wobble" when the angle of the camera is changed), or issues at especially flat angles.

There are improved versions (Parallax Occlusion Mapping for example), but all in all they also fail at extrem angles, and most implementations seem to just fade out the effect when the angle gets more extreme to hide these problems.

2. Actual Geometry or Tesselation: Nothing beats actual geometry (more polygons) when it comes to extreme angles, but tesselation actually does more or less the same thing. Of course both are expensive options, but with cards becoming ever more powerful, you could use this to just introduce additional geometry at crucial places that do need it (because they are central objects in the scene and seen at extreme angles). Of course, YMMV, and additional polygons always have to be used with care

The actual exact reason is the lack of self-occlusion on the surface. For a true bumpy surface, as you approach shallow angles things should start disappearing behind the bumps. The moment this fails to happen, the illusion breaks down. Parallax (occlusion) mapping tackles this problem.

SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Advertisement

So I looked into parallex occlusion mapping and I dont know if its just me, but I think the resource I found has an error in the interpolation part:

6pIe93s.png

Taken from: http://sunandblackcat.com/tipFullView.php?topicid=28

If you set nextHeight = 0, then Tp = Tt3. But as your pulling H(T3) up naturally I would say it should be going towards Tt2. Any thoughts on that?


Any thoughts on that?

Yes, I'm wondering why you are spending your time on this.

Normal mapping, like texture mapping, is just a layer of colors on top of a flat geometric surface. Any time you get into steep angles or a position where you can see that the surface is flat (such as a 3D display) your viewer will immediately know it is flat.

If this is a surface that really needs complex geometry then make complex geometry.

Otherwise leave it as a flat surface that looks like it has lighting and colors on it, and move along with things that really matter.

I would treat parallax approaches as a way to reach a deeper amount of fake displacement, rather than one that applies at steeper angles. Normal mapping should only be used for low-amplitude surface detail.

If you want to give the appearance of surface detail at extreme angles, you need geometry, full stop.

This topic is closed to new replies.

Advertisement