All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Common.ShaderLib.Common.glsllib Maven / Gradle / Ivy

There is a newer version: 3.7.0-stable
Show newest version
vec3 Common_UnpackNormal(in vec3 norm){
    return (norm * vec3(2.0)) - vec3(1.0);
}

vec3 Common_UnpackNormalLA(in vec4 norm){
    vec3 newNorm = norm.agb;
    newNorm.b = sqrt(1.0 - (newNorm.x * newNorm.x) - (newNorm.y * newNorm.y));
    return (newNorm * vec3(2.0)) - vec3(1.0);
}

vec3 Common_PackNormal(in vec3 norm){
    return (norm * vec3(0.5)) + vec3(0.5);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy