diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /apps/openmb/resources/shaders/gbuffer.vert | |
Diffstat (limited to 'apps/openmb/resources/shaders/gbuffer.vert')
| -rw-r--r-- | apps/openmb/resources/shaders/gbuffer.vert | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/openmb/resources/shaders/gbuffer.vert b/apps/openmb/resources/shaders/gbuffer.vert new file mode 100644 index 0000000..c9e677c --- /dev/null +++ b/apps/openmb/resources/shaders/gbuffer.vert @@ -0,0 +1,19 @@ +#version 330 core +layout(location = 0) in vec3 aPos; +layout(location = 1) in vec2 aUV; +layout(location = 2) in vec3 aNormal; + +uniform mat4 model; +uniform mat4 view; +uniform mat4 proj; + +out vec2 vUV; +out vec3 vNormalView; + +void main() +{ + vUV = aUV; + vec4 viewPos = view * model * vec4(aPos, 1.0); + vNormalView = mat3(transpose(inverse(view * model))) * aNormal; + gl_Position = proj * viewPos; +} |