So, Easymode, could you explain conceptually what you’re doing to keep the scanlines from getting funky at non-integer scales? It’s a thing I’d like to achieve with a number of scanline-related shaders but I haven’t seen anyone talking about the problem in the usual places.
Before I started writing the shader, I compared each of the shaders in the repo to find out which ones handled non-integer scanlines best. I narrowed it down to crt-geom (with USEGAUSSIAN defined) and scanline.cg. The former method flew over my head, so I settled on the latter’s sine wave method as a basis, but simplifying it further for my sake.
I switched to cosine because I wanted to darken the top and bottom of each scanline. Multiplying the wave by 0.5 and adding 0.5 keeps it in the 0.0-1.0 range, ensuring that it influences every pixel. Wrapping all of this in pow() to a power greater than 1.0 widens the peak of the wave (well it becomes the peak after I invert it). Graphing f(x) = 1.0-pow(cos(xPI2.0)*0.5+0.5,1.5) shows the basic shape of the wave, which just seems to work well for non-integer scanlines. At least that’s the case for scaling factors >= 4.0. You need enough resolution to draw the subtle transitions. Clipping too hard will lose these transitions. If you raise the Brightness Boost parameter too high you’ll see how clipping messes up non-integer scanlines.