Files
Vulkan-Samples/shaders/texture_loading/glsl/texture.frag
T
2025-09-28 17:18:58 +08:00

25 lines
466 B
GLSL

#version 450
layout (binding = 1) uniform sampler2D samplerColor;
layout (location = 0) in vec2 inUV;
layout (location = 1) in vec3 inNormal;
layout (location = 0) out vec4 outFragColor;
void main()
{
vec4 color = texture(samplerColor, inUV);
vec3 N = normalize(inNormal);
vec4 textureColor = color;
if (textureColor.a < 0.1) {
textureColor = vec4(0.2, 0.2, 0.2, 0.5);
}
outFragColor = textureColor;
// outFragColor = vec4(1, 0, 0, 1);
}