Shader for very slight pixel edge softening

I have an idea for a shader, though the effect I’m looking for has already been partially addressed by another. Basically, I’d like a shader that applies only a veeeeeeery small amount of blur, comparable to that which the Pixellate shader applies to certain pixel edges when using non-integer scaling, only on the whole image. The idea is to soften out the edges of all the pixels in the image, just enough to make it look not so damn, well, pixellated, but not as blurry as bilinear. Lanczos IMO doesn’t satisfy me in this respect due to the ringing.

That said, there is one shader, or should I say shader variant that more or less does what I want already, namely this variant for CRT-Geom I cooked up to make thin, 480p-esque scanlines:

http://pastebin.com/3vVqttBQ

I made some additional modifications, namely disabling the interlacing, gamma correction, and phosphor emulation, and increasing the scanline weight so as to make the scanlines lighter. The end result is scanlines that are barely visible, with the added effect of just a pixel or two of blur, enough to give the image a slightly soft look without going overboard. Here’s an example:

There is a downside to this shader, however. For one, not everyone might appreciate the scanlines, though I personally do not mind them since they’re so light. Second, this doesn’t play nice with any scale other than 2x and 4x due to the scanlines, though simple aspect ratio correction works well.

So my proposition is a shader that applies the slight softening seen in the screenshot, but without the scanlines. Pixellate does something similar, but the problem with it is that it is basically just nearest neighbor with slight blurring on only certain edges to hide rounding errors. I want that slight blur, but on the whole image. But of course, I have very little know-how on the matter, else I wouldn’t be here requesting help.

Have you tried the Quilez or bicubic shaders? You might also try messing with aliaspider’s GTU shader, which allows you to finely control how blurry things are, as well as scanline existence/intensity.

The softening from the pixellate shader is just an effect of blowing up the image really big and then shrinking it back down, similar to super sampling anti-aliasing (SSAA).

Quilez is the closest I got to looking like that, but it’s still just a tad too blurry. Whereas this shader only applies one to two pixels of blur, Quilez applies two to three. If it was just the tiniest bit sharper, it would be golden.

Hmmm thin scanline shader is nice, much like the Dosbox CRT shaders to emulate more of a old-school high-res CRT monitor, I might combine it with the TV pack I did and see what I can come up with, I imagine it would be great for old PC games,

I made a shader that adds exactly one row of interpolated pixels. Update glsl/slang shaders using Online Downloader. Load shader shaders_glsl(or slang)\pixel-art-scaling\shaders\edge1pixels, or edgeNpixels with “Pixel Count” parameter = 1.

1 Like