diff --git a/shader/picture/textureArray.frag b/shader/picture/textureArray.frag new file mode 100644 index 000000000..f35f28aeb --- /dev/null +++ b/shader/picture/textureArray.frag @@ -0,0 +1,9 @@ +#version 450 core +layout (location=0) out vec4 fColor; +uniform sampler2DArray thetexture; +in vec4 vColor; +in vec3 vTexCoord; +void main() +{ + fColor = texture(thetexture, vec3 (vTexCoord.xyz)) * vColor; +} diff --git a/shader/picture/textureArray.vert b/shader/picture/textureArray.vert new file mode 100644 index 000000000..27146b61f --- /dev/null +++ b/shader/picture/textureArray.vert @@ -0,0 +1,13 @@ +#version 450 core +layout (location = 0) in vec3 inPos; +layout (location = 1) in vec4 inColor; +layout (location = 2) in vec4 inTexCoord; +layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ; +out vec4 vColor; +out vec3 vTexCoord; +void main() +{ + gl_Position = theMat * vec4(inPos.xyz, 1.0); + vColor = inColor; + vTexCoord = inTexCoord.xyz; +}