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

Parallax mapping also can works together with lightmapping:

Parallax Mapping + Lightmapping Parallax Mapping + Lightmapping 2x

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 2nd texture of material; also check 3d object's 'Bump' style. (You need check materials's Specular Enable style to turn on specular lighting)

Textures setting of parallax mapping shaders:
0: decal map
1: normal map
[ 2: light map ]

Factors of all parallax mapping shaders
:

vec4 uvoffset                        //offset of texture coordinates
bool bNormalizeLV               //whether normalize lighting vector, default is True. Turn it off will improve performance but debase lighting quality.

Usage:

material.setEffectVector('vecOffset',
uvoffset )
material.setEffectBool('bNormalizeLV',
false/true )


Example:

(parallax = material)

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