All files / engine/Source/Shaders/Builtin/Functions getDynamicAtmosphereLightDirection.js

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25                                                 
//This file is automatically rebuilt by the Cesium build process.
export default "/**\n\
 * Select which direction vector to use for dynamic atmosphere lighting based on an enum value\n\
 *\n\
 * @name czm_getDynamicAtmosphereLightDirection\n\
 * @glslfunction\n\
 * @see DynamicAtmosphereLightingType.js\n\
 *\n\
 * @param {vec3} positionWC the position of the vertex/fragment in world coordinates. This is normalized and returned when dynamic lighting is turned off.\n\
 * @param {float} lightEnum The enum value for selecting between light sources.\n\
 * @return {vec3} The normalized light direction vector. Depending on the enum value, it is either positionWC, czm_lightDirectionWC or czm_sunDirectionWC\n\
 */\n\
vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) {\n\
    const float NONE = 0.0;\n\
    const float SCENE_LIGHT = 1.0;\n\
    const float SUNLIGHT = 2.0;\n\
\n\
    vec3 lightDirection =\n\
        positionWC * float(lightEnum == NONE) +\n\
        czm_lightDirectionWC * float(lightEnum == SCENE_LIGHT) +\n\
        czm_sunDirectionWC * float(lightEnum == SUNLIGHT);\n\
    return normalize(lightDirection);\n\
}\n\
";