[vulkan] Clamp composed values to >= 0

This takes care of the nans that got into the output buffer resulting is
weird holes in any overlays.
This commit is contained in:
Bill Currie 2023-07-22 00:43:05 +09:00
parent 99c6c58e25
commit befb3ca31b

View file

@ -22,7 +22,7 @@ main (void)
c = subpassLoad (color).rgb; c = subpassLoad (color).rgb;
l = subpassLoad (light).rgb; l = subpassLoad (light).rgb;
e = subpassLoad (emission).rgb; e = subpassLoad (emission).rgb;
o = BlendFrags (vec4 (c * l + e, 1)).xyz; o = max(BlendFrags (vec4 (c * l + e, 1)).xyz, vec3(0));
o = pow (o, vec3(0.83));//FIXME make gamma correction configurable o = pow (o, vec3(0.83));//FIXME make gamma correction configurable
frag_color = vec4 (o, 1); frag_color = vec4 (o, 1);
} }