Fixing image leak and computeDiffuse in Wavefront shading

This commit is contained in:
mklefrancois 2020-07-09 11:30:10 +02:00
parent 2eb9b6e522
commit e56201ef1d
25 changed files with 141 additions and 77 deletions

View file

@ -36,7 +36,8 @@ vec3 computeDiffuse(WaveFrontMaterial mat, vec3 lightDir, vec3 normal)
float dotNL = max(dot(normal, lightDir), 0.0);
vec3 c = mat.diffuse * dotNL;
if(mat.illum >= 1)
return c + mat.ambient;
c += mat.ambient;
return c;
}
vec3 computeSpecular(WaveFrontMaterial mat, vec3 viewDir, vec3 lightDir, vec3 normal)