summary refs log tree commit diff
path: root/shaders/shader.frag
blob: 90d6ab0d1b964e5403b3ca208b8e300bc2bc2934 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#version 460

//   Set 0 is the default, so we could omit it, but we prefer to be explicit.
// It specifies which the descriptor set layout the binding index pertains to;
// see init_pipeline() in render.rs.
layout(set = 0, binding = 1) uniform sampler textureSampler;
layout(set = 1, binding = 0) uniform texture2D textureImage;

layout(location = 0) in vec3 fragmentColor;
layout(location = 1) in vec2 fragmentTextureCoordinate;

layout(location = 0) out vec4 outColor;

void main() {
  outColor = vec4(fragmentColor
                      * texture(sampler2D(textureImage, textureSampler),
                                fragmentTextureCoordinate).rgb,
                  1.0);
}