vulkan-tutorial/shadersrc/textured_lit.frag

27 lines
666 B
GLSL
Raw Normal View History

2023-05-16 09:14:46 +00:00
//glsl version 4.5
#version 450
//shader input
layout (location = 0) in vec4 inColor;
layout (location = 1) in vec2 texCoord;
//output write
layout (location = 0) out vec4 outFragColor;
layout(set = 0, binding = 1) uniform SceneData{
vec4 fogColor; // w is for exponent
vec4 fogDistances; //x for min, y for max, zw unused.
vec4 ambientColor;
vec4 sunlightDirection; //w for sun power
vec4 sunlightColor;
} sceneData;
layout(set = 2, binding = 0) uniform sampler2D tex1;
void main()
{
2023-05-17 04:05:05 +00:00
// Flip y coordinate of UVs to fix display
2023-05-17 04:02:56 +00:00
float y = texCoord.y * -1;
vec3 color = texture(tex1, vec2(texCoord.x ,y)).xyz;
2023-05-16 09:14:46 +00:00
outFragColor = vec4(color, inColor.w);
}