feat: assignment 3
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
uniform int useTexture;
|
||||
uniform sampler2D texSampler;
|
||||
varying vec3 fcolor;
|
||||
varying vec2 ftexcoord;
|
||||
|
||||
void main() {
|
||||
gl_FragColor = vec4(fcolor, 1);
|
||||
if (useTexture == 1) {
|
||||
gl_FragColor = texture2D(texSampler, ftexcoord);
|
||||
} else {
|
||||
gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
uniform mat4 mvp;
|
||||
attribute vec3 vpos;
|
||||
attribute vec3 vcolor;
|
||||
attribute vec2 vtexcoord;
|
||||
varying vec3 fcolor;
|
||||
varying vec2 ftexcoord;
|
||||
|
||||
void main() {
|
||||
gl_Position = mvp * vec4(vpos, 1);
|
||||
fcolor = vcolor;
|
||||
ftexcoord = vtexcoord;
|
||||
}
|
||||
Reference in New Issue
Block a user