Coloring triangles with texture

This commit is contained in:
Caesar2011
2016-09-05 19:45:14 +02:00
parent 433983e4ff
commit aed54bd694
8 changed files with 37 additions and 22 deletions

View File

@@ -1,8 +1,17 @@
#version 330 core
in vec3 fragmentColor;
// Interpolated values from the vertex shaders
in vec2 UV;
// Ouput data
out vec3 color;
// Values that stay constant for the whole mesh.
uniform sampler2D myTextureSampler;
void main(){
color = fragmentColor;
// Output color = color of the texture at the specified UV
color = texture( myTextureSampler, UV ).rgb;
}