Ensure the fragment normal is noramlized

This commit is contained in:
Brad Davis 2018-01-28 14:55:28 -08:00
parent 7565e08657
commit 07aee1ef68

View file

@ -67,7 +67,8 @@ void main(void) {
TransformCamera cam = getTransformCamera(); TransformCamera cam = getTransformCamera();
vec3 fragNormal; vec3 fragNormal;
<$transformEyeToWorldDir(cam, _normal, fragNormal)$> <$transformEyeToWorldDir(cam, _normal, fragNormal)$>
fragNormal = normalize(fragNormal);
vec4 color = vec4(evalSkyboxGlobalColor( vec4 color = vec4(evalSkyboxGlobalColor(
cam._viewInverse, cam._viewInverse,
1.0, 1.0,
@ -80,7 +81,5 @@ void main(void) {
roughness), roughness),
opacity); opacity);
color.rgb += emissive * isEmissiveEnabled(); color.rgb += emissive * isEmissiveEnabled();
// _fragColor = vec4(albedo, opacity);
_fragColor = color; _fragColor = color;
} }