mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2025-02-23 18:17:44 +11:00
prevent rounding errors with deinterlacing shaders
This commit is contained in:
parent
e4f6e62bf1
commit
994fc49f12
3 changed files with 6 additions and 6 deletions
|
@ -53,7 +53,7 @@ void main()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
y = 2.0 * params.SourceSize.y * vTexCoord.y;
|
y = 2.000001 * params.SourceSize.y * vTexCoord.y;
|
||||||
prev = current;
|
prev = current;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ void main()
|
||||||
float y = 0.0;
|
float y = 0.0;
|
||||||
// assume anything with a vertical resolution greater than 400 lines is interlaced
|
// 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);
|
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)));
|
if (mod(y, 2.0) > 0.99999) FragColor = vec4(texture(Source, vTexCoord + vec2(0.0, params.SourceSize.w)));
|
||||||
else
|
else
|
||||||
|
|
|
@ -55,7 +55,7 @@ void main()
|
||||||
if (registers.SourceSize.y > 400.0)
|
if (registers.SourceSize.y > 400.0)
|
||||||
{y = registers.SourceSize.y * vTexCoord.y + (tick * registers.enable_480i) + registers.top_field_first;}
|
{y = registers.SourceSize.y * vTexCoord.y + (tick * registers.enable_480i) + registers.top_field_first;}
|
||||||
else
|
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)
|
if (mod(y, 1.99999) > 0.99999)
|
||||||
{res = res;}
|
{res = res;}
|
||||||
|
|
Loading…
Add table
Reference in a new issue