4 uniform mat4 mmviewproj;
8 const float half_height = 0.855;
11 // varying vec3 normal;
13 varying vec2 tex_coord;
14 varying vec3 world_normal;
16 // const vec3 lpos = vec3(0.0, 100.0, -10.0);
19 layout(location = 1) in vec3 attr_pos;
20 layout(location = 2) in vec3 attr_normal;
21 layout(location = 3) in vec2 attr_tex;
25 vec3 sph_pos = normalize(vec3(attr_pos.x, attr_pos.y - half_height, attr_pos.z));
27 vec3 sph_normal = sph_pos;
28 sph_pos.y += half_height;
30 vec3 p = mix(attr_pos, sph_pos, t);
31 vec3 n = mix(attr_normal, sph_normal, t);
33 gl_Position = mmviewproj * vec4(p, 1.0);
35 pos = (mview * vec4(p, 1.0)).xyz;
36 // ldir = (mview * vec4(lpos, 1.0)).xyz;
38 // mat3 normal_matrix = mat3(mview);
39 // normal = normal_matrix * n;
42 world_normal = (mmod * vec4(attr_normal, 1.0)).xyz;