Parallax mapping (also called offset mapping or virtual displacement mapping) is an enhancement of the bump mapping or normal mapping techniques applied to textures in 3D rendering applications such as video games. To the end user, this means that textures such as stone walls will have more apparent depth and thus greater realism with less of an influence on the performance of the simulation. (Definition from Wikipedia). Mokazon shows how to achieve this effect in the Blender Game Engine.
I've been working hard on making a way to achieve parallax mapping without using a GLSL shader. Shaders can run slow on older computers, and also some graphics cards dont support them.
I have attempted to do this effect with nodes, and i'm rather happy with the result. I have decided to share the file with you guys so that everyone can use this resource and improve the BGE games.
- 10 Layers for extra realism
- Self shadowing
- Many options for advanced customization
How it works (in a nutshell) is this: You subtract the Normal output from the UV output of a Geometry node with a math node. That plugs into the vector input of your texture which is then plugged into a mix node. You also plug in a the same texture, although with UV vector, into the lower input of the mix node. Now add another texture node, with the UV output of the Geometry node plugged into the vector input of your texture. On this texture, you will need to put in your parallax/displacement map. The color output of this will plug into the factor input button of the mix node (the gray one on the top). Finally, the mix node outputs into the Output node. I have gone even more detailed and added 10 layers of this to make it look more 3d. I hope all this makes sense.
Here is a video demo to see what it is:
If you have any questions regarding how it works, or how to customize it, please email me at [email protected]