I was listening to the album Electric Girl by She the other day and wanted to try creating a post fx shader in the style of the album artwork.
There are several things that the art is doing that I’d like to recreate:
- R + B Shifting
- Subpixel Overlay
- Grid Overlay
R + B Shifting
I did the R + B shifting using the sobel edge detection technique I discussed in a previous post. When drawing the pixel, this depth checks the adjacent pixels and if the value difference is large enough, colours the pixel. I pushed out the values a little so it was checking 2 adjacent pixels to give a thicker edge.
The red/blue colour was done by getting the UVs of the screen position and getting the sine of the U component. I used this to lerp between my two colours. I then added this to a lerp between the red and blue components of the gbuffer contents, based on the same interpolator. Multiplying this by the gbuffer contents gave me a blend that brought out the red and blue areas of the scene depending on what the blend colour was.
If you’re reading this as a “how to” – don’t. This is super wrong and hacky. But it works for me!
I made the grid lines by multiplying the screen position UV with my scale UVs and feeding this into two linear gradients. I added these gradients to the U or V component divided by the line thickness, then added one on one side and subtracted one on the other. Flooring this then subtracting one from the other gave me a line! Adding them gave me a grid, but I changed my scale UVs to have lots of horizontal lines and the occasional vertical one.
I used this as an interpolator between my scene colour and line colour to give a bit of choice in the colour of the line.
LED Subpixel Element
The subpixel element was just a very small texture tiling texture. I tried adding and multiplying this, but went for an overlay blend in the end to get the look I was after.
Vignette and Grain
These were both from the scene post process volume settings, but I added an extra vingette to the shader to darken it – just used the radial gradient node that unreal has and used this as an interpolator between scene colour and scene colour raised to the power of 3.