Novum / vkQuake

Vulkan Quake port based on QuakeSpasm
GNU General Public License v2.0
1.8k stars 220 forks source link

Postprocess contrast looks weird (simple multiplication). #136

Closed sobieh closed 6 years ago

sobieh commented 6 years ago

IMHO postprocess shader should use something like that.

vec3 contrast(vec3 color, float amount)
{
    return ((color.rgb - 0.5f) * max(amount, 0)) + 0.5f;
}

void main() 
{
    vec3 frag = subpassLoad(color_input).rgb;
    frag.rgb = contrast(frag.rgb, ((push_constants.contrast - 1.0) * 0.1) + 1.0);
    out_frag_color = vec4(pow(frag, vec3(push_constants.gamma)), 1.0);
}
Novum commented 6 years ago

This has been taken from QuakeSpasm, you should file a bug with upstream. I don't want to break compatibility, because most people use it and expect the same behavior.

But you are right, I also thought this looks suspicious.