Proper way to rectify this?

Probably a question for shader experts. I use fakelottes and fake-crt-geom and when large scaling (16x on 1080p) so that i can see small details, i observed that scanlines don’t exactly align where they should be, but around 1 pixel offset (this can be seen even on 4x on 1080p if you look closely) . After checking the code i found this function in vec4 scanline

vec2 omega = vec2(3.1415 * OutputSize.x, 2.0 * 3.1415 * TextureSize.y);

if i change 3.1415 (pi value) that is multiplied to .y to something smaller like 3.125 the scanlines come to proper position as seen in other shaders like Guest.r-dr.Venom. But just wanted to ask what is the proper way to do it. Same happens on plain scanline.glsl.

1 Like

Hmm, dunno about that. When you change it to 3.125, does it align all the way down? My concern would be that it would desync after some number of texels.

1 Like

Looks like it desyncs with 3.125 after some lines on normal games with 200+ visible scanlines.

1 Like

k, yeah, that’s what I was afraid of. Maybe try changing TextureSize.y to (TextureSize.y +/- some_value).

2 Likes