X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;ds=sidebyside;f=shaders%2Fscene.vs;fp=shaders%2Fscene.vs;h=9c8e4ebdfb113df60b7faaa8457cf1ca63ae96f7;hb=aa4c26eae2208872824e0eb5b71bc05c16d43242;hp=0000000000000000000000000000000000000000;hpb=3e8fda9c7cbc50d1ae95195905c953bdeedf71b9;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/shaders/scene.vs b/shaders/scene.vs new file mode 100644 index 0000000..9c8e4eb --- /dev/null +++ b/shaders/scene.vs @@ -0,0 +1,33 @@ +layout (location=0) in vec3 a_co; +layout (location=1) in vec4 a_norm; +layout (location=2) in vec2 a_uv; +layout (location=3) in ivec4 a_lights; + +#include "motion_vectors_vs.glsl" + +uniform mat4x3 uMdl; +uniform mat4 uPv; +uniform mat4 uPvmPrev; + +out vec2 aUv; +out vec4 aNorm; +out vec3 aCo; +out vec3 aWorldCo; +flat out ivec4 aLights; + +void main() +{ + vec3 world_pos0 = uMdl * vec4( a_co, 1.0 ); + vec4 vproj0 = uPv * vec4( world_pos0, 1.0 ); + vec4 vproj1 = uPvmPrev * vec4( a_co, 1.0 ); + + vs_motion_out( vproj0, vproj1 ); + + gl_Position = vproj0; + + aUv = a_uv; + aNorm = vec4( mat3(uMdl) * a_norm.xyz, a_norm.w ); + aCo = a_co; + aWorldCo = world_pos0; + aLights = a_lights; +}