More rendering stuff

This commit is contained in:
Anuken
2020-01-10 20:27:10 -05:00
parent 49137d4f58
commit f918cdeced
3 changed files with 104 additions and 7 deletions
+9
View File
@@ -0,0 +1,9 @@
#ifdef GL_ES
precision mediump float;
#endif
varying vec4 v_col;
void main(){
gl_FragColor = v_col;
}
+16
View File
@@ -0,0 +1,16 @@
attribute vec4 a_position;
attribute vec3 a_normal;
attribute vec4 a_color;
uniform mat4 u_projModelView;
varying vec4 v_col;
const vec3 ambientColor = vec3(1.0);
const vec3 ambientDir = normalize(vec3(1.0, 1.0, 1.0));
const vec3 diffuse = vec3(0.5);
void main(){
vec3 norc = ambientColor * clamp(lerp(dot(a_normal, ambientDir), 1.0, 0.6), 0.0, 1.0);
v_col = a_color * vec4(norc, 1.0);
gl_Position = u_projModelView * a_position;
}