http://forum.doom9.org/showthread.php?p=1683051
[QUOTE=cretindesalpes;1683051]Download:
crt_display v1.0
This function emulates a CRT display using aperture grille (Trinitron) or Cromaclear technologies. It is slow but gives interesting results. Could be nice to chain after a NTSC defect emulator like
dotcrawlplus. It implements various features like:
- Works at any (non-integer) upscaling factor
- Various way of adjusting the scanline thickness and beam shape
- Low-pass filtering of the input signal
- Specific gamma target
- Beam glow
- Optional colored phosphor effect and shadow mask
- Automatic contrast adjustment
- Halation
- Very large upscale is possible, showing the grid of phosphors.
Requirements: Dither 1.26.0 or above and its dependencies, Avisynth 2.6, RGB colorspace.
Detailed instructions in the .avsi file. Prototype:
Function crt_display (clip src, float sw, float sh, float "voff", float "ppp",
\ float "cutoff", float "scandist", float "sharpv", float "sharph",
\ float "blurh", float "glowgain", float "glowh", float "glowv",
\ float "glowsens", float "contrast", float "gamma", float "softclip",
\ float "mix", float "beamshape", bool "phosphor", bool "pgrid",
\ float "vcs", float "cromaclear", float "maskpp", float "gainb",
\ float "halgain", float "halrange", string "pixel_type")
Examples of real NTSC footage with aperture grille (left) and cromaclear shadow mask (right):
ar = 10.0 / 11.0
crt_display (2*ar, 2, ppp=1*ar, blurh=2.0) # Left
crt_display (2.5*ar, 2.5, ppp=1.25*ar, maskpp=1.25, cromaclear=1.0, voff=0.25) # right
It works very well for upscaling old-school videogame captures:
Sources, point-resized:
I don’t know at which gamma these pictures should be viewed so I kept them untouched like if they were in standard sRGB.
Cromaclear display type:
ar = 8.0 / 7.0
crt_display (5*ar, 5, ppp=2.5*ar, blurh=1.0, maskpp=2.5, cromaclear=1, scandist=1.5, cutoff=0.9, glowgain=0.125, halgain=0.03)
Aperture grille display type:
crt_display (5*ar, 5, ppp=2.5*ar, blurh=0.75, maskpp=2.5, scandist=1, cutoff=0.9, glowgain=0.125, halgain=0.03)
Simple scanlines without phosphor effect:
crt_display (5*ar, 5, ppp=2.5*ar, blurh=1.0, maskpp=2.5, phosphor=false, scandist=3, cutoff=0.8, glowgain=1.0, glowh=6, glowv=0, halgain=0.03, sharpv=2)
More screenshots
here. Default settings are generally OK, but tweaking the parameters can improve the results a lot.
My 15 kHz CRT is gone for a long time and I only have half-decent monitor photos for reference, so advices based on real CRTs are welcome to improve the emulation.[/QUOTE]