1 #extension GL_ARB_uniform_buffer_object : enable
3 layout(std140) uniform colors0
14 varying vec3 ReflectVec;
20 vec3 kcool = min(CoolColor + DiffuseCool * SurfaceColor, 1.0);
21 vec3 kwarm = min(WarmColor + DiffuseWarm * SurfaceColor, 1.0);
22 vec3 kfinal = mix(kcool, kwarm, NdotL);
24 vec3 nreflect = normalize(ReflectVec);
25 vec3 nview = normalize(ViewVec);
27 float spec = max(dot(nreflect, nview), 0.0);
28 spec = pow(spec, 32.0);
30 gl_FragColor = vec4 (min(kfinal + spec, 1.0), 1.0);