CRT Post-Process Material + Tutorial
This is a post process material I made to replicate a CRT screen. I wanted to replicate the vibe of a N64, and utilize low poly models for this project, and wanted a CRT screen to really drive the feeling home.
The material instance for this has parameters set up to control the fisheye effect, the "screen" borders, the scan line size and speed, the resolution, saturation, and size of the slot mask. Each parameter is also artist locked to prevent it from being broken.
The first part of this filter is made to reduce the quality of the scene, pixelating whatever we see. We multiply our TexCoord by our resolution parameter, floor the result, and then divide again by the same parameter.

By changing the resolution, we can make the scene more or less pixelated.
We then feed our results into our fisheye effect. All three of these nodes feed afterward into a lerp. Our radial gradient feeds into the lerp's alpha, while the scale UVs feed into A and B. The lower scale UVs is zooming our screen view in, while the upper scale UV is zooming out. By feeding these into the lerp with our alpha, we're assigning both of these zooms to different locations via our gradient. This replicates our fisheye effect.
The effect won't be super noticeable at first, but it works.
Trevor then help me set up the scan lines that we use to really push forward the CRT ray effect. Time moves our scanlines, and by multiplying by 0.003 I was able to set it to the slow scrolling speed I wanted. But at the end of this node path we end up with a little something like this...
We have the lines, but they're opaque and this is a post processing material so we don't have access to opacity. So what do we do? We use lerps.
Our first lerp, which contains our fisheye and our pixelization feeds into the lower screen texture, while the frac from the scan lines feed into the upper texture. These get lerped together, while the saturate from the scan lines becomes out alpha.
This is still too aggressive, so we need one more lerp. We use out output of the first lerp combines with again our lower screen texture, and then lower our alpha which lowers opacity.
Now our scan lines are barely visible in the outliner, but give us a cool scrolling effect.
In order to make this work I first had to look at some CRT screens. Theres a couple different types but for this specific material I wanted to utilize the slot mask.
I then broke apart each line of based on what color they were supposed to be, and imported each texture into Unreal.
I then took our final lerp and isolated the colors of the screen using masks set to red, green, and blue.
Below this, we have out slot mask set up, multiplying the TexCoord by a value of 30 to create a tiling effect for the texture's UVs.
We then combine the masks for our colors with the isolated colors themselves using lerps, and add the results together.
Now we have our CRT effect, but it's a bit too dark, and we're missing our screen borders.
I made the screen borders with the help of a tutorial that I'll link below.
Our final add gets added to a lerp, and the screen borders feed into the lerp's alpha. We then color correct the result of our lerp by feeding into a desaturation node. We want to desaturate by a negative amount to increase the saturation. However, we also want our parameter to make sense. The fix? Multiply our parameter by -1.
And with that the CRT filter is done! Plop it into your post process material and adjust the exposure to your liking.





















No comments:
Post a Comment