Support Forum       G3D Web Page     
Public Member Functions | List of all members
glsl::BumpMap_glsl Class Reference


For use with G3D::Shader. More...

Public Member Functions

void bumpMap (in sampler2D normalBumpMap, in float bumpMapScale, in float bumpMapBias, in vec2 texCoord, in vec3 tan_X, in vec3 tan_Y, in vec3 tan_Z, in float backside, in vec3 tsE, out vec3 wsN, out vec2 offsetTexCoord, out vec3 tsN, out float rawNormalLength, const in int maxIterations)
 
void bumpMapBlinn78 (in sampler2D normalBumpMap, in float bumpMapScale, in float bumpMapBias, in vec2 texCoord, in vec3 tan_X, in vec3 tan_Y, in vec3 tan_Z, in float backside, in vec3 tsE, out vec3 wsN, out vec2 offsetTexCoord, out vec3 tsN, out float rawNormalLength, int maxIterations)
 Normal mapping Following the algorithm of Blinn '78. More...
 
void bumpMapTatarchuk06 (in sampler2D normalBumpMap, in float bumpMapScale, in float bumpMapBias, in vec2 texCoord, in vec3 tan_X, in vec3 tan_Y, in vec3 tan_Z, in float backside, in vec3 tsE, out vec3 wsN, out vec2 offsetTexCoord, out vec3 tsN, out float rawNormalLength, int maxIterations)
 Parallax Occlusion Mapping (POM) More...
 
void bumpMapWelsh04 (in sampler2D normalBumpMap, in float bumpMapScale, in float bumpMapBias, in vec2 texCoord, in vec3 tan_X, in vec3 tan_Y, in vec3 tan_Z, in float backside, in vec3 tsE, out vec3 wsN, out vec2 offsetTexCoord, out vec3 tsN, out float rawNormalLength, int maxIterations)
 Parallax mapping Following the algorithm of Welsh '04. More...
 

Detailed Description


For use with G3D::Shader.

This file is included into NonShadowedPass.pix and ShadowMappedLightPass.pix.

Created: 2007-12-18
Last modified: 2013-08-17

This file defines three variations of the following function:

void bumpMap(in sampler2D normalBumpMap, in float bumpMapScale, in float bumpMapBias, in vec2 texCoord, in vec3 tan_X, in vec3 tan_Y, in vec3 tan_Z, in float backside, in vec3 tsE, out vec3 wsN, out vec2 offsetTexCoord);

Input: normalBumpMap .xyz = tangent-space shading normal, .a - 0.5 = displacement from geometric surface bumpMapScale Multiplies the net displacement bumpMapBias Added to normalBumpMap.a texCoord texture coordinate in normalBumpMap tan_X unit tangent-space X vector (usually, the texture-space "u" axis) in world space. a.k.a. "tangent" tan_Y unit tangent-space Y vector (usually, the texture-space "v" axis) in world space. a.k.a. "binormal" tan_Z unit tangent-space Z vector (usually the surface normal) backside 1.0 if this is is a front face, -1.0 if this is a backface with two-sided lighting tsE unit vector to the center of projection, in tangent space

Output: wsN world-space shading normal at offsetTexCoord offsetTexCoord shading texture coordinate rawNormalLength Length of the normal before normalization, based on MIP-mapping of the normal: a measure of smoothness under MIP-mapping

See also
G3D::BumpMap, G3D::UniversalMaterial

Member Function Documentation

◆ bumpMap()

void glsl::BumpMap_glsl::bumpMap ( in sampler2D  normalBumpMap,
in float  bumpMapScale,
in float  bumpMapBias,
in vec2  texCoord,
in vec3  tan_X,
in vec3  tan_Y,
in vec3  tan_Z,
in float  backside,
in vec3  tsE,
out vec3  wsN,
out vec2  offsetTexCoord,
out vec3  tsN,
out float  rawNormalLength,
const in int  maxIterations 
)
inline

◆ bumpMapBlinn78()

void glsl::BumpMap_glsl::bumpMapBlinn78 ( in sampler2D  normalBumpMap,
in float  bumpMapScale,
in float  bumpMapBias,
in vec2  texCoord,
in vec3  tan_X,
in vec3  tan_Y,
in vec3  tan_Z,
in float  backside,
in vec3  tsE,
out vec3  wsN,
out vec2  offsetTexCoord,
out vec3  tsN,
out float  rawNormalLength,
int  maxIterations 
)
inline

Normal mapping Following the algorithm of Blinn '78.

◆ bumpMapTatarchuk06()

void glsl::BumpMap_glsl::bumpMapTatarchuk06 ( in sampler2D  normalBumpMap,
in float  bumpMapScale,
in float  bumpMapBias,
in vec2  texCoord,
in vec3  tan_X,
in vec3  tan_Y,
in vec3  tan_Z,
in float  backside,
in vec3  tsE,
out vec3  wsN,
out vec2  offsetTexCoord,
out vec3  tsN,
out float  rawNormalLength,
int  maxIterations 
)
inline

Parallax Occlusion Mapping (POM)

Following the algorithm of Tatarchuk I3D '06

Linear search and linear interpolation after the hit. Constants have been adjusted to give high performance on GeForce cards.

◆ bumpMapWelsh04()

void glsl::BumpMap_glsl::bumpMapWelsh04 ( in sampler2D  normalBumpMap,
in float  bumpMapScale,
in float  bumpMapBias,
in vec2  texCoord,
in vec3  tan_X,
in vec3  tan_Y,
in vec3  tan_Z,
in float  backside,
in vec3  tsE,
out vec3  wsN,
out vec2  offsetTexCoord,
out vec3  tsN,
out float  rawNormalLength,
int  maxIterations 
)
inline

Parallax mapping Following the algorithm of Welsh '04.


documentation generated on Wed Nov 24 2021 08:02:03 using doxygen 1.8.15