X-Git-Url: https://eleni.mutantstargoat.com/git/?p=demo;a=blobdiff_plain;f=vk_shaders%2Fmorphing.v.glsl;fp=vk_shaders%2Fmorphing.v.glsl;h=0000000000000000000000000000000000000000;hp=a93a40fab540a1d74eed504dfdc494df21f2453d;hb=0f6519c2606f2863d9c7ee8b9754b9f23df281ab;hpb=05d269a194496bcef85da78652b947f5bf1c9bcf diff --git a/vk_shaders/morphing.v.glsl b/vk_shaders/morphing.v.glsl deleted file mode 100644 index a93a40f..0000000 --- a/vk_shaders/morphing.v.glsl +++ /dev/null @@ -1,41 +0,0 @@ -#version 450 - -layout(std140, binding = 0) uniform matrix_state { - mat4 mview; - mat4 mmviewproj; - mat4 mmod; - float t; -} m; - -const float half_height = 0.855; - -layout(location = 0) out vec3 pos; -layout(location = 1) out vec2 tex_coord; -layout(location = 2) out vec3 world_normal; - -/* attributes */ -layout(location = 1) in vec3 attr_pos; -layout(location = 2) in vec3 attr_normal; -layout(location = 3) in vec2 attr_tex; - -void main() -{ - vec3 sph_pos = normalize(vec3(attr_pos.x, attr_pos.y - half_height, attr_pos.z)); - - vec3 sph_normal = sph_pos; - sph_pos.y += half_height; - - vec3 p = mix(attr_pos, sph_pos, m.t); - vec3 n = mix(attr_normal, sph_normal, m.t); - - gl_Position = m.mmviewproj * vec4(p, 1.0); - - pos = (m.mview * vec4(p, 1.0)).xyz; - // ldir = (mview * vec4(lpos, 1.0)).xyz; - - // mat3 normal_matrix = mat3(mview); - // normal = normal_matrix * n; - - tex_coord = attr_tex; - world_normal = (m.mmod * vec4(attr_normal, 1.0)).xyz; -}