pseudo scanlines
pseudo scanlines
Anyone have a hankering to enhance a BBC Micro emulator with pseudo "scanline" effect?
In lieu of a sophisticated "CRT filter emulation" graphical layer, one conceptually easy way is:
A. Use a line-doubling approach.
B. Apply a percentage bias with the "raster" displayed line, that is averaged with the "blank" scanline below it.
C. The emulator UI could allow the user to control the percentage of simple "scanline effect".
I think the effect is a good starting point, and the maths are simple. The effect should be kept to fixed multiples (e.g. 2x or 4x) of the BBC screen, since we're dealing with integer presentation here, and therefore the UI should probably disallow it in "free resizing" mode.
See image below for the idea. Any thoughts?
In lieu of a sophisticated "CRT filter emulation" graphical layer, one conceptually easy way is:
A. Use a line-doubling approach.
B. Apply a percentage bias with the "raster" displayed line, that is averaged with the "blank" scanline below it.
C. The emulator UI could allow the user to control the percentage of simple "scanline effect".
I think the effect is a good starting point, and the maths are simple. The effect should be kept to fixed multiples (e.g. 2x or 4x) of the BBC screen, since we're dealing with integer presentation here, and therefore the UI should probably disallow it in "free resizing" mode.
See image below for the idea. Any thoughts?
Re: pseudo scanlines
B-Em currently has a scanlines mode, though it is not as advanced as you describe here. To try it: Settings->Video->Display Type->Scanlines
- BeebMaster
- Posts: 7434
- Joined: Sun Aug 02, 2009 5:59 pm
- Location: Lost in the BeebVault!
- Contact:
Re: pseudo scanlines
Perhaps I don't understand the terminology, but why does the higher percentage dark scanline produce a lighter scanline?
Re: pseudo scanlines
Perfectly good question. It's arguably just as valid to invert the percentage. Swings and roundabouts!BeebMaster wrote: ↑Thu Nov 16, 2023 10:43 pm Perhaps I don't understand the terminology, but why does the higher percentage dark scanline produce a lighter scanline?
Re: pseudo scanlines
Yeah - a controllable percentage would be nicer, since I think a "full" black scanline is overly harsh in appearance. But thanks for pointing me to that feature of B-Em.
Re: pseudo scanlines
I would have thought pulling in a hardware based shader effect from another source would be fairly simple, but I don't know SDL!
Doesn't MAME support various effects and as it now supports the beeb except a few 6845 issues, it might be good to experiment with.
Doesn't MAME support various effects and as it now supports the beeb except a few 6845 issues, it might be good to experiment with.
Re: pseudo scanlines
Ultimately, Tricky, yes a proper shader is the route to go. My suggestion above is merely a "good enough" quick win, so to speak.tricky wrote: ↑Fri Nov 17, 2023 7:46 am I would have thought pulling in a hardware based shader effect from another source would be fairly simple, but I don't know SDL!
Doesn't MAME support various effects and as it now supports the beeb except a few 6845 issues, it might be good to experiment with.
Re: pseudo scanlines
Fair enough.
I don't know what the excellent virtual beeb https://virtual.bbcmic.ro/ does, but it looks like it has some horizontal noise and looks a bit like scan lines from the right distance, but it doesn't support interlaced mode
I don't know what the excellent virtual beeb https://virtual.bbcmic.ro/ does, but it looks like it has some horizontal noise and looks a bit like scan lines from the right distance, but it doesn't support interlaced mode
Re: pseudo scanlines
I think one of the issues with emulating this kind of thing is it may be a bit of variable target. In the case of CRTs, does a shadow mask tube (most of them) look different from an aperture grille tube (Trinitron and clones)? For shadow mask, were there different placements of the colour phosphors - I think I remember precision in-line being different from some others? Then, monochrome displays (green, amber etc) would not have had any mask at all.
With no mask, I would expect each line to have a brighter area in the middle and fade towards the edges but just how the brightness is distributed across the width would surely depend on how well focused the beam is - there is an electrode specifically to do this. Then brightness will presumably have an effect, especially as the phosphor presumably also has a saturation point, though I have no idea if real CRTs were capable of reaching it. If you were designing/adjusting a CRT, the ideal, surely, would be for the beam width to be such that the point midway between two lines is getting 50% from the beam above and 50% from the one below so the illumination is actually completely even. Could this be done on an aperture grille tube?
With no mask, I would expect each line to have a brighter area in the middle and fade towards the edges but just how the brightness is distributed across the width would surely depend on how well focused the beam is - there is an electrode specifically to do this. Then brightness will presumably have an effect, especially as the phosphor presumably also has a saturation point, though I have no idea if real CRTs were capable of reaching it. If you were designing/adjusting a CRT, the ideal, surely, would be for the beam width to be such that the point midway between two lines is getting 50% from the beam above and 50% from the one below so the illumination is actually completely even. Could this be done on an aperture grille tube?
Re: pseudo scanlines
I know we are going a little off topic here!
It is optical illusion, or is more phosphor excited in brighter areas, meaning that 50/50 would only be at some "brightness" level?
This might be fine for the beeb with each gun being max or min, but would be different for a NULA.
It is optical illusion, or is more phosphor excited in brighter areas, meaning that 50/50 would only be at some "brightness" level?
This might be fine for the beeb with each gun being max or min, but would be different for a NULA.
Re: pseudo scanlines
It might be good to have some photos of actual CRTs (whether televisions or monitors, whether monochrome or colour) to see what kinds of visibility might be apparent. I have a feeling that some scanlines effects might be slightly overdoing the retro reality. What they do do is make something visually distinctive - it looks "retro" even if not authentic.
Re: pseudo scanlines
On the portable that I have to hand, even with interlave turned off, there are no scan lines visible!
The mask is arranged:
That is, roughly a square consisting of three columns, one each of red, green and blue with each square offset vertically by half a square from the previous one.
I wonder if the whole scan line thing comes from the arcades and NTSC resolutions where the gaps between scan lines are wider.
It may be that the focus not very focused or that the beeb colours saturate the guns, meaning that the scan lines merge perfectly or possibly some magic that the TV is doing with my RGB to SCART signal.
None of this means that if you want scan lines you shouldn't have them, or that a quick cheap alternative isn't a good start
I'll try and get some CUB photos when I am feeling better.
The mask is arranged:
Code: Select all
||||||/\/\/\||||||
\/\/\/||||||\/\/\/
/\/\/\||||||/\/\/\
||||||\/\/\/||||||
||||||/\/\/\||||||
\/\/\/||||||\/\/\/
/\/\/\||||||/\/\/\
||||||\/\/\/||||||
I wonder if the whole scan line thing comes from the arcades and NTSC resolutions where the gaps between scan lines are wider.
It may be that the focus not very focused or that the beeb colours saturate the guns, meaning that the scan lines merge perfectly or possibly some magic that the TV is doing with my RGB to SCART signal.
None of this means that if you want scan lines you shouldn't have them, or that a quick cheap alternative isn't a good start
I'll try and get some CUB photos when I am feeling better.
Re: pseudo scanlines
Fair point, if people want scanlines that's fine! I think perhaps NTSC on a large tube could well be where you'd be more likely to see the lines. (Hmm, sometimes the tube is vertical so for those games a recreation would need scanlines running the other way...)
I'm sure brightness, focus, and image contrast will all play into it.
I'm sure brightness, focus, and image contrast will all play into it.
Re: pseudo scanlines
Scanlines are quite visible to my eye on a Cub monitor with interlacing disabled. With interlacing on I instead seem to see divisions between the RGB phosphor dots.
Here's an old photo taken probably with interlacing enabled and a long enough exposure to not show scanlines, but it does show the phosphor pattern. A lot will depend on camera settings, and I don't think the naked eye is quite as good at seeing this fine detail.
Here's an old photo taken probably with interlacing enabled and a long enough exposure to not show scanlines, but it does show the phosphor pattern. A lot will depend on camera settings, and I don't think the naked eye is quite as good at seeing this fine detail.
Re: pseudo scanlines
Certainly a single frame capture would be interesting, I wonder if the slowmo guys filmed it as well as the vector displays, I'm sure that I've seen a video somewhere.
I can't see any scan lines in that image, but they would be much less visible and jumping up and down in interlaced mode.
The only thing that I can see in that image is the shadow mask and even squinting, I don't see where the scan lines would be, only the shadow mask pattern which will practically never match the scan lines.
I can't see any scan lines in that image, but they would be much less visible and jumping up and down in interlaced mode.
The only thing that I can see in that image is the shadow mask and even squinting, I don't see where the scan lines would be, only the shadow mask pattern which will practically never match the scan lines.
Re: pseudo scanlines
Coincidentally this just popped up today: https://hackaday.com/2023/11/18/bringin ... -software/
Re: pseudo scanlines
Cool. Seems to be a nice CRT shader library, albeit NTSC focused.gfoot wrote: ↑Sat Nov 18, 2023 10:53 pm Coincidentally this just popped up today: https://hackaday.com/2023/11/18/bringin ... -software/