diff --git a/src/3_snap_to_sphere.tes b/src/3_snap_to_sphere.tes index 873e025..0e2a1b6 100644 --- a/src/3_snap_to_sphere.tes +++ b/src/3_snap_to_sphere.tes @@ -35,10 +35,15 @@ void main() // (so before model, view, proj are applied) ///////////////////////////////////////////////////////////////////////////// - // Replace with your code + // Replace with your code + // Based on: + // https://learnopengl.com/Guest-Articles/2021/Tessellation/Tessellation + sphere_fs_in = normalize(interp_pos.xyz); + view_pos_fs_in = view * model(is_moon, animation_seconds) * vec4(sphere_fs_in, 1.0); + normal_fs_in = normalize(mat3(view * model(is_moon, animation_seconds)) * sphere_fs_in); + pos_fs_in = proj * view_pos_fs_in; - - gl_Position = interp_pos; + gl_Position = pos_fs_in; ///////////////////////////////////////////////////////////////////////////// }