Parallax Mapping

Parallax Mapping can produce a stunningly real three-dimensional appearance on flat surfaces, without the intensive tessellation computations and extreme polygon counts required for true displacement mapping. In addition to a base texture, it requires a corresponding normal map and height map to work.

dot3 bump mapping

dot3 bump mapping + parallax mapping

All parallax mapping shader files can be found at the "effects\parallax_mapping" folder. You need store height map to normal map's alpha channel, and set normal map to the 1st texture of material; also check 3d object's 'Bump' style.

Factors of all parallax mapping shaders:

vec4 uvoffset                        //offset of texture coordinates

Usage:

material.setEffectVector('vecOffset',
uvoffset )

Example:

(parallax = material)

local uvofs=vec4.new(-0.02,-0.02,-0.02,1)
parallax.setEffectVector('vecOffset',uvofs
 )