X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=shaders%2Fscene_override.vs;fp=shaders%2Fscene_override.vs;h=88fa7dd558576e8889500ae45172d469c3fb25cc;hb=2c91a71533b4ce86b9e7fd708420ae05c74d8f52;hp=0000000000000000000000000000000000000000;hpb=d27f8a570e5cfad1974b4be303888e17ff846406;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/shaders/scene_override.vs b/shaders/scene_override.vs new file mode 100644 index 0000000..88fa7dd --- /dev/null +++ b/shaders/scene_override.vs @@ -0,0 +1,31 @@ +layout (location=0) in vec3 a_co; +layout (location=1) in vec4 a_norm; +layout (location=2) in vec2 a_uv; + +#include "motion_vectors_vs.glsl" + +uniform mat4x3 uMdl; +uniform mat4 uPv; +uniform mat4 uPvmPrev; +uniform mat3 uNormalMtx; + +out vec2 aUv; +out vec4 aNorm; +out vec3 aCo; +out vec3 aWorldCo; + +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( a_norm.xyz, a_norm.w ); + aCo = a_co; + aWorldCo = world_pos0; +}