This commit is contained in:
Anuken
2020-11-16 19:43:56 -05:00
parent 3b609f698a
commit f296d23cfa
17 changed files with 52 additions and 19 deletions

View File

@@ -17,9 +17,9 @@ const float shinelen = 0.2;
void main(){
vec3 norc = u_ambientColor * (diffuse + vec3(clamp((dot(a_normal, u_lightdir) + 1.0) / 2.0, 0.0, 1.0)));
float shinedot = max((-dot(u_camdir, a_normal) - (1.0 - shinelen)) / shinelen, 0.0);
float shinyness = (1.0 - a_color.a) * pow(shinedot, shinefalloff);
float albedo = (1.0 - a_color.a) * pow(shinedot, shinefalloff);
vec4 baseCol = vec4(a_color.rgb, 1.0);
v_col = mix(baseCol * vec4(norc, 1.0), vec4(1.0), shinyness * norc.r);
v_col = mix(baseCol * vec4(norc, 1.0), vec4(1.0), albedo * norc.r);
gl_Position = u_proj * u_trans * a_position;
}