Sha256: abcd9bf54a4d9bb800c1a891767f1151b8609fb8d147945cc1c8c14d8461f3e6

Contents?: true

Size: 950 Bytes

Versions: 12

Compression:

Stored size: 950 Bytes

Contents

/**
 * Creates a matrix that transforms vectors from tangent space to eye space.
 *
 * @name czm_tangentToEyeSpaceMatrix
 * @glslFunction
 * 
 * @param {vec3} normalEC The normal vector in eye coordinates.
 * @param {vec3} tangentEC The tangent vector in eye coordinates.
 * @param {vec3} binormalEC The binormal vector in eye coordinates.
 *
 * @returns {mat3} The matrix that transforms from tangent space to eye space.
 *
 * @example
 * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, binormalEC);
 * vec3 normal = tangentToEye * texture2D(normalMap, st).xyz;
 */
mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 binormalEC)
{
    vec3 normal = normalize(normalEC);
    vec3 tangent = normalize(tangentEC);
    vec3 binormal = normalize(binormalEC);
    return mat3(tangent.x,  tangent.y,  tangent.z,
                binormal.x, binormal.y, binormal.z,
                normal.x,   normal.y,   normal.z);
}

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cesium-1.24.0 app/assets/javascripts/Cesium/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl
cesium-1.23.0 app/assets/javascripts/Cesium/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl
cesium-1.18.0 app/assets/javascripts/Cesium/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl
cesium-1.17.0 app/assets/javascripts/Cesium/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl
cesium-0.25.0 app/assets/javascripts/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl
cesium-0.24.1 app/assets/javascripts/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl
cesium-0.24.0 app/assets/javascripts/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl
cesium-0.23.0 app/assets/javascripts/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl
cesium-0.22.0 app/assets/javascripts/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl
cesium-0.21.1 app/assets/javascripts/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl
cesium-0.21 app/assets/javascripts/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl
cesium-0.20.0 app/assets/javascripts/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl