@@ -185,6 +185,8 @@ void display(void)
|
|
185
185
|
glUniform3f(loc, camera_pan, 10, 0);
|
186
186
|
|
187
187
|
// Task 3.1
|
188
|
+
glActiveTexture(GL_TEXTURE0);
|
189
|
+
glBindTexture(GL_TEXTURE_2D, texture);
|
188
190
|
|
189
191
|
glBindVertexArray(vertexArrayObject);
|
190
192
|
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0);
|
@@ -7,6 +7,7 @@ precision highp float;
|
|
7
7
|
in vec2 texCoord;
|
8
8
|
|
9
9
|
// Task 3.4: Receive the texture as a uniform
|
10
|
+
layout(binding = 0) uniform sampler2D colortexture;
|
10
11
|
|
11
12
|
layout(location = 0) out vec4 fragmentColor;
|
12
13
|
|
@@ -14,5 +15,5 @@ void main()
|
|
14
15
|
{
|
15
16
|
// Task 1: Use the texture coordinates for the x,y of the color output
|
16
17
|
// Task 3.5: Sample the texture with the texture coordinates and use that for the color
|
17
|
-
fragmentColor =
|
18
|
+
fragmentColor = texture2D(colortexture, texCoord.xy);
|
18
19
|
}
|