Calculate matrices from node-hierarchy and pass via push constant

This commit is contained in:
Sascha Willems 2020-04-13 16:26:40 +02:00
parent 6c43ab37ff
commit 579c7d086f
5 changed files with 31 additions and 18 deletions

View file

@ -18,7 +18,7 @@ void main()
vec3 L = normalize(inLightVec);
vec3 V = normalize(inViewVec);
vec3 R = reflect(-L, N);
vec3 diffuse = max(dot(N, L), 0.0) * inColor;
vec3 diffuse = max(dot(N, L), 0.15) * inColor;
vec3 specular = pow(max(dot(R, V), 0.0), 16.0) * vec3(0.75);
outFragColor = vec4(diffuse * color.rgb + specular, 1.0);
}