X-Git-Url: https://eleni.mutantstargoat.com/git/?p=demo;a=blobdiff_plain;f=gl_shaders%2Fmorphing.v.glsl;h=d84336f6e08ffecdcd009107cdff9d27ea400c09;hp=6f72aa78d57d91ada32d9d080d14f79a950aa89c;hb=73b9db25a6deff93da45f3c45290ca8a56fefed3;hpb=78426c695a2bc5812508806771ed1affa7c0bcf7 diff --git a/gl_shaders/morphing.v.glsl b/gl_shaders/morphing.v.glsl index 6f72aa7..d84336f 100644 --- a/gl_shaders/morphing.v.glsl +++ b/gl_shaders/morphing.v.glsl @@ -2,16 +2,18 @@ uniform mat4 mview; uniform mat4 mmviewproj; +uniform mat4 mmod; uniform float t; const float half_height = 0.855; varying vec3 pos; -varying vec3 normal; -varying vec3 ldir; +// varying vec3 normal; +// varying vec3 ldir; varying vec2 tex_coord; +varying vec3 world_normal; -const vec3 lpos = vec3(0.0, 100.0, -10.0); +// const vec3 lpos = vec3(0.0, 100.0, -10.0); /* attributes */ layout(location = 1) in vec3 attr_pos; @@ -31,10 +33,11 @@ void main() gl_Position = mmviewproj * vec4(p, 1.0); pos = (mview * vec4(p, 1.0)).xyz; - ldir = (mview * vec4(lpos, 1.0)).xyz; + // ldir = (mview * vec4(lpos, 1.0)).xyz; - mat3 normal_matrix = mat3(mview); - normal = normal_matrix * n; + // mat3 normal_matrix = mat3(mview); + // normal = normal_matrix * n; tex_coord = attr_tex; + world_normal = (mmod * vec4(attr_normal, 1.0)).xyz; } \ No newline at end of file