You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
606 B
21 lines
606 B
5 years ago
|
#version 450
|
||
5 years ago
|
// SIMPLE TEXTURE : FRAGMENT SHADER
|
||
|
|
||
|
// These come in from the previous shader (vertex)
|
||
5 years ago
|
layout(location = 0) in vec2 texture_position;
|
||
5 years ago
|
|
||
5 years ago
|
// This goes out to the bound image in window_size_dependent setup
|
||
5 years ago
|
layout(location = 0) out vec4 f_color;
|
||
5 years ago
|
|
||
5 years ago
|
// This is bound by the descriptor set
|
||
|
// Currently handled by the individual buffer and are 1:1
|
||
5 years ago
|
layout(set = 0, binding = 0) uniform sampler2D tex;
|
||
5 years ago
|
|
||
5 years ago
|
void main() {
|
||
5 years ago
|
|
||
5 years ago
|
ivec2 pixel_pos = ivec2(gl_FragCoord.x, gl_FragCoord.y);
|
||
5 years ago
|
|
||
5 years ago
|
f_color = texture(tex, texture_position);
|
||
|
float gamma = 0.5;
|
||
|
f_color.rgb = pow(f_color.rgb, vec3(1.0/gamma));
|
||
5 years ago
|
}
|