wip: engine enhancements and fixes
This commit is contained in:
parent
9816f14f53
commit
cc7921a5fe
27 changed files with 347 additions and 32 deletions
23
assets/shaders/gl_textured.vert
Normal file
23
assets/shaders/gl_textured.vert
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue