add basic shaders and Tile class
This commit is contained in:
parent
569f2dfb00
commit
9124915237
7 changed files with 324 additions and 124 deletions
15
res/shaders/main.frag
Normal file
15
res/shaders/main.frag
Normal file
|
@ -0,0 +1,15 @@
|
|||
#version 150
|
||||
|
||||
uniform sampler2D materialTex;
|
||||
uniform vec4 color;
|
||||
|
||||
|
||||
in vec2 fragTexCoord;
|
||||
in vec3 fragVert;
|
||||
|
||||
out vec4 finalColor;
|
||||
|
||||
void main() {
|
||||
|
||||
finalColor = texture(materialTex, fragTexCoord) * color;
|
||||
}
|
21
res/shaders/main.vert
Normal file
21
res/shaders/main.vert
Normal file
|
@ -0,0 +1,21 @@
|
|||
#version 150
|
||||
|
||||
uniform mat4 projection;
|
||||
uniform mat4 camera;
|
||||
uniform mat4 transform;
|
||||
|
||||
in vec3 vert;
|
||||
in vec2 vertTexCoord;
|
||||
|
||||
out vec3 fragVert;
|
||||
out vec2 fragTexCoord;
|
||||
|
||||
void main() {
|
||||
// Pass some variables to the fragment shader
|
||||
fragTexCoord = vertTexCoord;
|
||||
fragVert = vert;
|
||||
fragColor = vertColor;
|
||||
|
||||
// Apply all matrix transformations to vert
|
||||
gl_Position = projection * camera * transform * vec4(vert, 1);
|
||||
}
|
Reference in a new issue