Workbench: TAA quick fix for AMD cards

Seems to be that mix(a, b, 1.0) will not give you b. on nvidia this is
not a problem as a was initialized with 0.0, but on AMD it can be any
floating point number, resulting that mix(inf, b, 1.0) was still more to
inf than to b.
This commit is contained in:
Jeroen Bakker 2018-06-26 18:14:19 +02:00
parent b4c01aca30
commit 6b0670951f
1 changed files with 8 additions and 2 deletions

View File

@ -9,7 +9,13 @@ void main()
{
ivec2 texel = ivec2(gl_FragCoord.xy);
vec4 history_buffer = texelFetch(historyBuffer, texel, 0);
vec4 color_buffer = texelFetch(colorBuffer, texel, 0);
colorOutput = mix(history_buffer, color_buffer, mixFactor);
if (mixFactor == 1.0)
{
colorOutput = color_buffer;
}
else {
vec4 history_buffer = texelFetch(historyBuffer, texel, 0);
colorOutput = mix(history_buffer, color_buffer, mixFactor);
}
}