Added starfield backdrop to instancing example

This commit is contained in:
saschawillems 2017-01-08 12:27:03 +01:00
parent d335e7be29
commit bb9310b94a
10 changed files with 70 additions and 2 deletions

View file

@ -20,7 +20,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.1) * inColor;
vec3 specular = (dot(N,L) > 0.0) ? pow(max(dot(R, V), 0.0), 16.0) * vec3(0.75) * color.r : vec3(0.0);
outFragColor = vec4(diffuse * color.rgb + specular, 1.0);
}