prevent rounding errors with deinterlacing shaders

This commit is contained in:
hunterk 2018-03-20 20:28:08 -05:00
parent e4f6e62bf1
commit 994fc49f12
3 changed files with 6 additions and 6 deletions

View file

@ -53,7 +53,7 @@ void main()
}
else
{
y = 2.0 * params.SourceSize.y * vTexCoord.y;
y = 2.000001 * params.SourceSize.y * vTexCoord.y;
prev = current;
}

View file

@ -43,7 +43,7 @@ void main()
float y = 0.0;
// assume anything with a vertical resolution greater than 400 lines is interlaced
if (params.SourceSize.y > 400.0) y = params.SourceSize.y * vTexCoord.y + float(params.FrameCount);
else y = 2.0 * params.SourceSize.y * vTexCoord.y;
else y = 2.000001 * params.SourceSize.y * vTexCoord.y;
if (mod(y, 2.0) > 0.99999) FragColor = vec4(texture(Source, vTexCoord + vec2(0.0, params.SourceSize.w)));
else

View file

@ -55,7 +55,7 @@ void main()
if (registers.SourceSize.y > 400.0)
{y = registers.SourceSize.y * vTexCoord.y + (tick * registers.enable_480i) + registers.top_field_first;}
else
{y = 2.0 * registers.SourceSize.y * vTexCoord.y + registers.top_field_first;}
{y = 2.000001 * registers.SourceSize.y * vTexCoord.y + registers.top_field_first;}
if (mod(y, 1.99999) > 0.99999)
{res = res;}