Thanks. I sure wish it was as accurate as you’re making it sound, but to be honest, I only have so much knowledge. If you read my code, I’m sure you won’t have much of a problem figuring out how I did the effect. The key is to filter the signal both when encoding and when decoding.
Just for now, on Genesis, you might like Guest’s NTSC better. Theirs is set up to artificially retain sharpness and to only add rainbows in places where it looks good. The way I might reach both those same goals in the future without compromising so much on accuracy is with an adaptive comb filter, like the one in shaders_slang/nes_raw_palette/cgwg-famicom-geom.
There are still some performance issues with my implementation:
- Currently, the shader has terrible performance whenever a game switches to 480i/480p. I’ll have to fix this by adding interlacing support.
- Appending crt-hyllian after my presets also causes a performance drop. I don’t get this problem with crt-guest-advanced or crt-royale.
- RF noise is slow because it has to add up about 500 randomly generated sine waves in a for-loop. I did this so that the noise would move across the screen at the correct rates like real hardware. To disable noise, set the cable to 0 (composite).
- My entire code is just very messy, with some places that can just blatantly be better optimized and cleaned up. It started getting this bad after my fall semester started up.
The difference between the presets in patchy_presets and elsewhere is that the patchy_presets ones add 4 additional passes. At the beginning, there’s a dummy pass added to rearrange the settings and move the commonly used ones to the top of the list. At the end are 3 passes for CRT-guest-advanced afterglow with a fix to make it glow the output of my shaders shader, instead of using OriginalHistory which gets the game’s output directly.
So the main difference is that the SignalOnly presets add afterglow.
I recommend prepending the patchy-snes preset and making your own dummy shader to reorder the settings, but knowing how your shaders are, my default color settings probably aren’t what you want.
The main color settings you’ll want to mess with are:
- Built-in test patterns (This is actually very useful)
- R-Y/G-Y/B-Y matrix (0 is the same RGB colors, 1 might not have existed on real CRTs, 2 and 3 are JP, 4 thru 8 are US (7 is the Sony CXA2025AS US, like the NES palette), 9 lets you set the settings yourself)
- Tint
- Brightness
- Color
- White point
- Chromatic adaptation
- Phosphors
You can use Chthon’s program called gamutthingy to add more phosphor gamut LUTs. I’ll soon add a color temperature white point setting, since Grade suggests about 8500K.
I’m not sure about this, but maybe it’s better to keep Terrible Gamut Mode turned off. Just a thought.
And for signal quality, mess with:
- the various B-Y R-Y filter options (on the leaky integrator, only change the rate)
- (7) Easy Sharpness (or whatever it’s called)
- the 2-chip SNES RGB blur amount (I do not own a real SNES, so someone will have to figure out the right blur amount for this)
- For noise, just change the random seed and the overall severity.
The red push is caused by the “R-Y/G-Y/B-Y formula” setting. You can set it to 0 to turn it off, which will get you closer to the developer’s colors. Apparently, a lot of CRTs in NTSC regions in the 90s were messing with their YIQ matrix to correct from 1953 NTSC color to P22 color, and they had different corrections in Japan than elsewhere. The NES palette called “Sony CXA2025AS US” does exactly this. This happened because of the SMPTE standard still allowing the use of old NTSC hardware, while Japan also had 9300K as its standard reference white. By the 90s, PAL CRTs did not mess with their YUV decoding at all.
To be honest, I haven’t done as much research about these color corrections as I would like yet. My preset settings for the YIQ correction are sourced from just a few random chips’ documentation, but I really need to just sit down and look up a bunch of them. The trick is to search up a bunch of CRTs on Facebook Marketplace and on CRT Database, search for their service manuals online, and if you can find the service manual, search the TV’s jungle chip online and see if you can find its official paper with the R-Y and G-Y settings. It’s a good idea to pay attention to the year that the CRT was made in too. My code converts these settings into a decoding matrix.