Complete planet panning

This commit is contained in:
Anuken
2020-02-21 13:48:50 -05:00
parent 99d3e9ae7c
commit a5e469e96c
7 changed files with 128 additions and 212 deletions

View File

@@ -6,12 +6,12 @@ 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);
const vec3 diffuse = vec3(0);
const vec3 v1 = vec3(1.0, 0.0, 1.0);
const vec3 v2 = vec3(1.0, 0.5, 0.0);
void main(){
vec3 norc = ambientColor * clamp((dot(a_normal, ambientDir) + 1.0) / 2.0, 0.0, 1.0);
vec3 norc = ambientColor * lerp(vec3(1.0), diffuse, 1.0 - clamp((dot(a_normal, ambientDir) + 1.0) / 2.0, 0.0, 1.0));
v_col = a_color * vec4(norc, 1.0);
gl_Position = u_projModelView * a_position;