Hey everyone, I implemented lately Steep Parallax mapping for the lighting material.
Standard parallax mapping looks fine as long as the parallax height is not too high and as long as you don’t look at it from a steep angle.
Steep parallax mapping addresses those two issues.
here is a video to understand the difference
At the beginning of the video it's standard parallax, the rocks that are near the camera are fine but distant rocks are very flat. Also when raising the height there is quickly some glitches at the base of the rocks that make it look weird.
Then switching to Steep parallax. As you can see rocks look more like 3D objects, and the height can be pushed a lot more giving a real relief impression.
This impression does not fade at steep angles.
Note that the ground is a grid and not a quad. Parallax mapping on a big quad does not work well because the camera direction is computed to each vertex. so when you are near the center and very close to the surface, the computed camera direction is wrong.
Of course there are some draw backs, it's a lot more fps greedy than the classic parallax mapping especially at hi resolutions. it's not that noticeable in the video because it's low res, and fraps is eating his share of fps.
So use it wisely, sometimes standard parallax is enough, especially when you look at a surface at high angle.
To enable it you have to set the SteepParallax boolean parameter to true on the lighting material.
You can also now tweak the parallax height by setting the ParallaxHeight float parameter, the default is 0.05.
On a side note, you can now use normal and parallax maps packed together. Parallax map is a grey scale map that can be stored in one 8 bits channel. using a complete texture (at least 3 8bits channels) is a waste of memory.
you can now store the parallax map in the alpha channel of the normal map, you can do that in any good image editor. This was already implemented in the shader, but there was no way for the user to specify that data were stored that way.
if you use such a map be sure to set the PackedNormalParallax boolean parameter to true in the material.