It was the gamma being wrong. Interesting how much different this is working than SFML+OpenCL

This commit is contained in:
2019-07-18 23:43:55 -07:00
parent 58f5289a3b
commit e476cb2e4e
4 changed files with 43 additions and 66 deletions

View File

@@ -2,26 +2,15 @@
layout(location = 0) in vec2 tex_coords;
layout(location = 0) out vec4 f_color;
layout(set = 0, binding = 0) uniform sampler2D tex;
layout(set = 0, binding = 1, rgba8ui) readonly uniform uimage2D img;
layout(set = 0, binding = 1, rgba32ui) readonly uniform uimage2D img;
void main() {
vec2 onePixel = vec2(1.0, 1.0) / (720.0, 756.0);
vec2 pos = tex_coords * onePixel;
ivec2 ipos = ivec2(pos);
vec4 colorSum = imageLoad(img, ipos);
f_color = colorSum;
// f_color = texture(tex, tex_coords);
// ivec2 t = ivec2(tex_coords.x, tex_coords.y );
ivec2 size = ivec2(gl_FragCoord.x, gl_FragCoord.y);
//ivec2 size = ivec2(0, 0);
f_color = imageLoad(img, size) / (200);
// f_color.w = 0;
// f_color.r = 75;
// f_color.g = 30;
// f_color.b =;
f_color = imageLoad(img, size) / (255.0);
// f_color.a += 100;
// f_color = texture(tex, tex_coords);
float gamma = 0.5;
f_color.rgb = pow(f_color.rgb, vec3(1.0/gamma));
}