raidillon/resources/shaders/gl_textured.vert
reo 0af4622525 Add texture support to the renderer
- Refactor to use the new model::Model struct
- Implement blinn-phong shading
- Add texture support for shaders
2025-07-13 20:03:43 +03:00

23 lines
No EOL
528 B
GLSL

#version 330 core
in vec3 position;
in vec3 normal;
in vec2 tex_coords;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
uniform vec2 uv_offset;
uniform vec2 uv_scale;
out vec3 v_normal;
out vec2 v_tex;
out vec3 v_position;
void main() {
mat4 modelview = view * model;
v_normal = transpose(inverse(mat3(modelview))) * normal;
v_tex = tex_coords * uv_scale + uv_offset;
v_position = (modelview * vec4(position, 1.0)).xyz;
gl_Position = projection * modelview * vec4(position, 1.0);
}