Meshes can display textures
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
#version 300 es
|
||||
precision mediump float;
|
||||
|
||||
in vec2 TexCoord;
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
uniform sampler2D theTexture;
|
||||
|
||||
void main() {
|
||||
FragColor = vec4(1.f, 0.5f, 0.2f, 1.0f);
|
||||
//FragColor = vec4(1.f, 0.5f, 0.2f, 1.0f);
|
||||
FragColor = texture(theTexture, TexCoord);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
#version 300 es
|
||||
|
||||
layout (location = 0) in vec3 aPos;
|
||||
layout (location = 0) in vec2 aPos;
|
||||
layout (location = 1) in vec2 texCoord;
|
||||
|
||||
out vec2 TexCoord;
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(aPos.x,aPos.y,aPos.z,1.0);
|
||||
gl_Position = vec4(aPos.x,aPos.y,0.,1.0);
|
||||
TexCoord = texCoord;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user