This interests me beyond belief! I've gone on record saying that TV viewing could go beyond the spacial limitations of modern tech in some way. What resolution is this simulation running at? Details, please. I want to know what you know... I want to know everything.
There's no set resolution, since it's a material on a surface in 3D space. Here's how the TV screen looks up close:
Some details aren't entirely accurrate because I was focused on getting a proof of concept working first. I use two mask textures: one for the apperture grille and other for masking the "raster beam" (aka: the scanlines):
The grill is a picture from a real set, but the "beam mask" is a quick paint.net job that has no basis on any real data, for now. The grille is "fixed" like on a real TV: there are enough for 720 vertical lines and the image is "beamed" on it, no matter what the source's horizontal resolution is. The scanlines are the ones that match vertical resolution.
Here's an overview of the material itself:
I'm not doing anything fancy such as generating a YUV/NTSC signal or anything like that, so you could call this a "virtual RGB monitor", since I'm using RGB values during the entire process.
There's two tricks in the way texture coordinates for sampling the source image are calculated, where I make an attempt to mimic the way the raster beam works:
- There's no vertical interpolation/filtering (I round down the Y coordinates so they always grab a pixel center). The raster beam works line by line, so it shouldn't blend the color of different lines. (I actually had to make the shader gradually re-enable vertical interpolation when the camera gets far away from the screen enough to not make out the scanlines, otherwise the image would shimmer).
- Horizontal interpolation still exists since the beam's color switching isn't instantaneous, but it's made shaper/faster than linear interpolation/filtering by elevating the fractional part of the texel coordinate to some power (I'm using 2). This is another part that isn't based on real data, it just looks good.
One problem I had (and still have) to deal with was dealing with shimmering and moire artifacts on the grille and scanline masks when viewing the screen from afar. It's mostly solved by using mipmaps generated with additional blur settings, so the grille and scanlines gracefully "melt together" when the camera gets far. I still have shimmering issues with the actual game image at a distance, since the emulator buffer has no mipmaps. I'll probably have to multisample it to keep it stable.
The rest is done by UE4's fantastic rendering pipeline: I just output HDR values from my "TV" and UE4 does the rest (bloom, exposure, etc). The material uses UE4's "clear cot" shading, so the CRT's "phosphor" layer has low, diffuse reflectivity compared to the "glass" layer, which is polished and shiny.