texture loading
This commit is contained in:
13
OpenGL/cube/resources/shaders/simple.frag
Normal file
13
OpenGL/cube/resources/shaders/simple.frag
Normal file
@@ -0,0 +1,13 @@
|
||||
#version 130
|
||||
|
||||
in vec3 Colour;
|
||||
in vec2 TexCoord;
|
||||
out vec4 outColour;
|
||||
|
||||
uniform vec3 triangleColour;
|
||||
|
||||
uniform sampler2D tex;
|
||||
|
||||
void main() {
|
||||
outColour = texture(tex, TexCoord);// * vec4(Colour, 1.0);
|
||||
}
|
||||
15
OpenGL/cube/resources/shaders/simple.vert
Normal file
15
OpenGL/cube/resources/shaders/simple.vert
Normal file
@@ -0,0 +1,15 @@
|
||||
#version 130
|
||||
|
||||
in vec2 position;
|
||||
in vec2 texcoord;
|
||||
in vec3 colour;
|
||||
|
||||
out vec3 Colour;
|
||||
out vec2 TexCoord;
|
||||
|
||||
void main() {
|
||||
Colour = colour;
|
||||
TexCoord = texcoord;
|
||||
gl_Position = vec4(position, 0.0, 1.0);
|
||||
// Equivilent to vec4(position.x, position.y, 0.0, 1.0)
|
||||
}
|
||||
BIN
OpenGL/cube/resources/textures/dirtside.jpg
Normal file
BIN
OpenGL/cube/resources/textures/dirtside.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.1 KiB |
Reference in New Issue
Block a user