Support Forum G3D Web Page |
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... | |
For use with G3D::Shader.
This file is included into NonShadowedPass.pix and ShadowMappedLightPass.pix.
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
|
inline |
|
inline |
Normal mapping Following the algorithm of Blinn '78.
|
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.
|
inline |
Parallax mapping Following the algorithm of Welsh '04.