Lightweight LUT-Based Scanline Glow Concept + Prototype GLSL

Okay, had a quick play with the blendoverlay shader within RetroArch using some unorthodox textures and so far it works a treat.

In the examples below I’m combining the blendoverlay.slang as the 4th pass after loading gtu-v050 (but it can be used on it’s own). I always use the passes from gtu-v050 in some form or another as I find they blend and smooth the pixels the best for my taste. One thing to note when you manually create the shader chain the .png file is not included in the preset, after saving the shader chain I had to open the .slangp file add the following lines:

textures = "overlay"
overlay = ":\location\of\image.png"

I also update changed the LUTHeight and LUTWidth within the preset to match the image file size (you can enter bigger widths and heights by editing the preset file, the GUI has a max limit!).

Again, these are just showing off the artistic effects that can be achieved with this type of shader, games are not meant to be played with these visuals, although nothing stopping one from doing so, or if you want to just show off to others (if they are in to this kind of stuff)! You also could just add simple masks or scanlines to get crt effects too (integer scaling might be better on for this though).

Screenshots are best viewed at 100% by clicking in to them and then right clicking on the pop up image and selecting “View Image” in your browser right click menu.

Fabric 1 texture

Fabric 2 texture

Fabric 3 texture

Yarn texture

Dot pitch texture

Effects look better in a running game than static shots

3 Likes

They look awesome. I will play with them soon.

The Dot pitch texture looks great, however I spotted some white dots at some places, don’t know if it should be like that or not (i.e. around the white and yellow text).

1 Like

Yes, I noticed the white dots too. they appear more exaggerated when black and white of the game image blend into each other as a gradient. Seems worse on the dot pitch texture that the others.

2 Likes

Should I increase the max in the GUI? That’s easy to do.

1 Like

Yes please, maybe 1920, that should be more than enough.

1 Like

Where is that shader? I can’t find it under “shader_slang” directory

I downloaded the latest slang shader zip file from the official Libretro repository https://github.com/libretro/slang-shaders

It’s under the reshade folder.

EDIT: Below are my presets for the above shader effects, try them on 2D games especially Super Mario World (SNES), Sonic (Megadrive) and Super Mario (NES).

Download the zip file ( https://www.dropbox.com/s/xnxqezh410x26fm/blendoverlay-shenglong.zip?dl=0 ) and extract it to your RetroArch shaders folder, start a game and load a preset.

The zip file contains the files below, please note the forum compresses images to .jpg, you will need to convert them back to .png. The manual process for the files below is: create a folder called ‘textures’, download the texture files from this post into the the textures folder, convert images to .png, copy the preset text from the pastbin website and save the files in the same level as the textures folder.

Fabric texture gtu-v050+blendoverlay-fabric.slangp

fabric


Fabric2 texture gtu-v050+blendoverlay-fabric2.slangp

fabricv2


Fabric3 texture gtu-v050+blendoverlay-fabric3.slangp

fabricv3


Yarn texture gtu-v050+blendoverlay-yarn.slangp

yarn

2 Likes

Dot pitch texture is missing in your archive. Can you please upload it?

Apologies for that, I excluded the dot pitch effect out on purpose as I thought it didn’t look quite right just yet, which is ironic because I wanted this type of shader (very light weight using a PNG texture) to re-create the @Birm 199x effect, which you have a variation of in your initial post in the other CRT screen shot thread.

I’ve found the blendoverlay shader works amazing with rough, inconsistent textures to create unique arty farty visuals.

I have updated the zip file to include the greyscale-slotmask preset and png for you to play with.

1 Like

Thanks. It works marvelous. Even if it doesn’t look right yet I’m fine with it as I don’t see any glitches or artifacts.

I’ve added “image-adjustment” shader at the end of your chain to bump up luminance to 1.20 as it’s too dark for me.

Anyway this texture overlay just solve my main problem and complain for PSX shading. It’s inconsistency of CRT shaders as many games change their resolution throughout the game. This is especially obvious with FMVs as usually they play on lower resolution compare to a main game.

Just check Silent Hill

I leave this for a reference.

Another example of how good this shader chain is. Although it still requires some more tweaking.

I’m trying to add some diffusion and halation to the picture but haven’t succeeded yet. Can’t get to work “vector-glow” correctly and “crt-easymod-halation” has some problems as well.

1 Like

Glad it’s serving a purpose for you. As the shader fills the screen with an overlay, it’s resolution independent so it doesn’t matter what resolution the game is running at. When combining with other shaders I find adding this as a last pass gives you less problems. You can make the dot pitch smaller by messing with the size paarameters or you can create a new texture with closer grids. I like a bit of bloom too, keep playing and let us know if you find some interesting presets.

Amazing! Are these shaders avalaible in GLSL or CG?

slang only at the moment, but I can convert it to GLSL.

1 Like

It would be great. :grinning: To avoid video driver change if anyone are using OpenGL.

Just wondering: could this be improved by adding more luminance values and “scanline widths” for those values? If you had 31 different luminance values and 31 different scanline widths, would that result in a color bars test image with no banding?

Since you can’t have a fraction of a pixel, it’s going to only be able to have as many bands as there are pixels in a scanline, if that makes sense. That is, with an infinite number of pixels to work with, I think so, yeah.

ah, yeah. I was thinking you would need to vary both the actual width of the scanline in pixels and the transparency(?) of the scanline in order to mimic that many “scanline widths.” Otherwise you’d need a monitor that could go to 31x scale :laughing:

anyway, just wondering if that would get rid of the banding in the color bars test pattern since there are 31 shades in the test pattern. This might also enhance the dynamics of the image/give the image greater depth.

hmm, yeah, possibly combined with transparency. However, I think you might need to do some weird perceptual mojo whenever you dropped a pixel (i.e., when you lose a pixel, I think the transparency would need to drop some, too, in a sort of sawtooth graph).

1 Like

If you, torridgristle, or anyone else wants to take this idea and run with it, please feel free; it’s beyond my current abilities. Just wanted to float the idea.

2 Likes

That tweak fixed the same problem I was having but only with Mode 7 games on any Snes emulator. Thank you so much.