diff options
author | pryazha <pryadeiniv@mail.ru> | 2025-08-02 13:21:42 +0500 |
---|---|---|
committer | pryazha <pryadeiniv@mail.ru> | 2025-08-02 13:21:42 +0500 |
commit | 2e64d3c5d6eb1eb04168d39d5eb5f2d89af1a8b0 (patch) | |
tree | 85c8a586a1343469cdcdab5dccad023053571ecd /pbr/textured/pbr.vert | |
parent | 33d5f67044d104d69cb2d11e78e6a79bc20d4c4e (diff) |
Diffstat (limited to 'pbr/textured/pbr.vert')
-rw-r--r-- | pbr/textured/pbr.vert | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/pbr/textured/pbr.vert b/pbr/textured/pbr.vert new file mode 100644 index 0000000..0ff1bdb --- /dev/null +++ b/pbr/textured/pbr.vert @@ -0,0 +1,24 @@ +#version 330 core + +layout(location = 0) in vec3 position; +layout(location = 1) in vec3 normal; +layout(location = 2) in vec2 tex_coords; + +out vert_t { + vec3 position; + vec3 normal; + vec2 tex_coords; +} vert; + +uniform mat4 projection; +uniform mat4 view; +uniform mat4 model; + +void main(void) +{ + gl_Position = projection * view * model * vec4(position, 1.0); + + vert.position = vec3(model * vec4(position, 1.0)); + vert.normal = normalize(mat3(transpose(inverse(model))) * normal); + vert.tex_coords = tex_coords; +} |