New Minko 2 Features: Normal Mapping And Parallax Mapping
One of Aerys' engineers - Roman Giliotte - is the most active developer on Minko. He is the one behind the JIT shaders compiler, the Collada loader and the lighting engine. This last project received a special attention in the past few days with a lot of new features. Among them: normal mapping and parallax mapping.
The following sample shows the difference between (from left to right) classic lighting, normal mapping and parallax mapping:
The 3 objects are the exact same sphere mesh: they are just rendered with 3 different shaders. You can easily see that the sphere using parallax mapping (on the right) appears to have a lot more details and polygons. And yet it's just the same sphere rendered with a special shader that will mimic the volume effect and details on the GPU.
Parallax mapping can be used to add details and volumes on any mesh. This technique is used in many modern commercial games such as Crysis 2 or Battlefield 3. It makes it possible to load and display a lot less polygons but with a high-polygon level of details.
And of course, thanks to Minko and Flash 11/AIR 3, it works just as well on Android and iOS!
The only thing you need is a normal map and a heightmap. And those two assets are very easy to generate from any actual 3D asset. The technique we use is called "steep parallax mapping". And thanks to Minko's exclusive JIT AS3 shaders compiler, you can now use parallax mapping in any of your custom shaders! The code is available on github :
- the code for the parallax mapping is available as a shader part on github in minko-lighting
- the demo is available in the minko-examples repository
One of the future optimizations include storing the height in the w/alpha component of the normal map. This way, the memory usage will be the same than with normal mapping but with a much better rendering.
If you have questions or suggestions, you can leave a comment or post on Aerys Answers.


Aerys