Fix the shimmering

This commit is contained in:
Eryn Wells 2018-11-23 09:19:51 -07:00
parent b314738ccb
commit 54bb20feef

View file

@ -55,7 +55,7 @@ fragment float4 fragmentShader(ColorInOut in [[stage_in]],
constant Material *materials [[buffer(BufferIndexMaterials)]],
constant Uniforms &uniforms [[buffer(BufferIndexUniforms)]])
{
float4 out;
float3 out = float3();
// Compute the normal at this position.
float3 normal = normalize(uniforms.normalMatrix * in.normal);
@ -88,10 +88,10 @@ fragment float4 fragmentShader(ColorInOut in [[stage_in]],
float factor = pow(reflectDotViewDir, material.specularExponent);
color += factor * material.specularColor * light.color;
}
out += float4(color, 1);
out += color;
}
}
return out;
return float4(out, 1);
}
#pragma mark - Normal Shaders