CRT luminofor fading simulation

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

User avatar
mikejmoffitt
Posts: 1353
Joined: Sun May 27, 2012 8:43 pm

Re: CRT luminofor fading simulation

Post by mikejmoffitt »

lidnariq wrote:Fair enough! I tested with Galaxian, and see 3.7 halflives per 1/60th of a second, or a halflife of 4.5ms. This means that the correct constant (with this TV) for the expression I gave above is k=1/13. This is low enough that on the NES, the effect will only ever be visible when transitioning to black pixels. So here's an animated gif, simulating same:
anim.gif
It's really subtle, especially without any of the phosphor size blur. You'll also want to enlarge it; I can't see anything when it's at 100dpi.

And after manually capturing 17 frames from FCEUX, here's how I processed it:

Code: Select all

for i in `seq 0 16`; do 
 pnmarith -maximum $i.ppm previous.ppm > n$i.ppm;
 ppmtogif n$i.ppm > n$i.gif;
 pnmgamma -ungamma 2.2 n$i.ppm | ppmdim .077 | pnmgamma 2.2 > previous.ppm;
done
pnmcat -tb n*.ppm | ppmtogif > all.gif
gifsicle --use-colormap all.gif -O3 -V -o anim.gif -d2 n{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}.gif
Note that I'm fixing up the gamma; if I hadn't, it'd be even harder to see.

I suspect that standard 24-bit displays are not actually deep enough to show this in a compelling way; after two refreshes (1/13)² even full scale content is just 1 LSB.
I should have mentioned that indeed, I only expect something like this to be visible on a totally unlit (black) section.
As the phosphor is no longer being struck by the electron gun, the "Starting brightness" of the fade is very dim, but the "decay" of the dim trail is very slow.
On mine, I can see the trails last for almost two seconds, but the curve is something like this (please excuse the graph quality):
Image
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: CRT luminofor fading simulation

Post by lidnariq »

Sure, exponential curve. In a dark room, with a almost-entirely dark CRT, a human eye can see light over something like 10 factors of ten difference in brightness (not simultaneously. Just "dimmest possible" to "brightest possible without being painful"). But we've only got 2-3 factors of ten on a standard monitor, so that's not going to be visible unless you're willing to horrifically overexpose any visible pixels. (log₂(10¹⁰) ≈33; we'd need 96-bit displays to represent this.)
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: CRT luminofor fading simulation

Post by tepples »

Found via link from this post. Topic age acknowledged.
lidnariq wrote:But we've only got 2-3 factors of ten on a standard monitor
Double that to about 4-5 because of the gamma characteristic of sRGB. Signal values represent voltage, while light output is closer to proportional to power, which is the square of voltage.
lidnariq wrote:so that's not going to be visible unless you're willing to horrifically overexpose any visible pixels. (log₂(10¹⁰) ≈33; we'd need 96-bit displays to represent this.)
That or high dynamic range rendering, which uses a floating-point frame buffer and then a bloom effect during post-processing to indicate to the eyes which pixels were overexposed.
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: CRT luminofor fading simulation

Post by rainwarrior »

I think a bloom effect emphasizes the wrong thing, though. You're trying to capture the fading trail of motion. The "overexposed" part is the non-moving image which should be bright and clean and clear, not fuzzed up with a bloom filter.

The simulation of "HDR" in LDR space with bloom is for a very different purpose. This is trying to communicate that bright lights like the sun are "brighter" than the area the shape covers on the image by bleeding it out. This can correspond to some light scattering effects by particles in the atmosphere (e.g. fog), focal depth effects, or lens defects, which is why it gets that feeling across in the simulation, but it's not an actual representation of a high dynamic range, and the same physical effects that are being represented don't really apply here?
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: CRT luminofor fading simulation

Post by lidnariq »

tepples wrote:Double that to about 4-5 because of the gamma characteristic of sRGB. Signal values represent voltage, while light output is closer to proportional to power, which is the square of voltage.
Looking at quantization error at the low end, there's only really 3.5 orders of magnitude with good coverage. The last range between 10-4 and 10-5 is values of 1,2,3 out of 255 in sRGB.

The difference between 4/255 and 5/255 in gamma 2.2 converted to linear light is a factor of 2, a whole photographic "stop"
Post Reply