CRT simulation for Stella
Started by ibogost, Apr 22 2009 4:43 AM
54 replies to this topic
#26 ONLINE
Posted Wed Apr 22, 2009 10:10 PM
This is almost one of those 'ineffable' qualities missing from emulated systems vs. the real thing. This is a milestone step towards 'perfect emulation'. Not only are we emulating the discerete logic chips, the cpus, sound synthesizer chips, LC networks, ladder d/a converters, ram, rom, i/o these days we are taking the next step in simulating the output devices. I cannot emphasize enough that we make this as modular as possible so that programmers can implement this in their emulators. It is also important to make as many parameters adjustable. Afterall, my unearthly beautiful AFFS LCD's are probably of a different mfg, that yours is. And yours most likely has a different crystal shape or arrangement (hahah phospohor mask) than that of my girlfriend's monitors. And my friend's 1600x1200 classic UXGA is different than your kid's laptop, which might be a 1440x900 WXGA+ .. Perhaps somebody has a an S-PVA or MVA type.. so you see, tweakability is paramount! And as a side bonus, it would be nice to have a crt.ini profile file that we could post or exchange amongst the user forums. After all, I would want to share my blazing Sony Trinitron aperture grille (O'led enhanced!!) with all of the emulation community! Especially since it would have hundreds of hours of tweaking behind it. So you see.. This is defnitely
#27
Posted Thu Apr 23, 2009 8:02 AM
I am waiting for this a very long time...
#28
Posted Fri Apr 24, 2009 11:58 AM
In my opinion, the effects demonstrated on the screenshots are too strong (stronger than they appear on a real CRT), but propably they're adjustable...
Also it doesn't look like all like the picture on a TV because of the missing scanlines. Like the sky in Enduro would appear as alternating bright blue and dark blue lines if you go close to the TV...
Also it doesn't look like all like the picture on a TV because of the missing scanlines. Like the sky in Enduro would appear as alternating bright blue and dark blue lines if you go close to the TV...
#29 ONLINE
Posted Fri Apr 24, 2009 1:11 PM
There needs to be NTSC noise and waviness and more general imperfections here.
#30
Posted Fri Apr 24, 2009 6:01 PM
Yup, lots of improvements we can make. What you're seeing is a snapshot of current progress; we'll be making more adjustments before May. And I'm sure many more will need to be made, but it will be a concrete start.
#31
Posted Fri May 1, 2009 1:18 AM
I read this a few days ago, and originally thought it sounded really interesting, but reading further I was disappointed. You appear to be reducing the complex interaction of the color encoding, the color carrier, the bandwidth limits, the electron beam hitting phosphors, and all the other details that make up an NTSC CRT based display system into "let's slap on some texture, delay, blur, and noise filters, and call it a day". It even appears to be done on RGB pixels, and not YUV and the frequency domain.
It's also a bit scary to see that people seem to think of modern (i.e. TFT) displays as just "better". CRTs' main disadvantage were sharpness and size, but in nearly every other respect they were actually better: sporting wider color gamut, better contrast, resolution independence, no latency, and supporting a wide range of scan rates. While a modern TFT is better suited to the everyday tasks of users today, they're a major stumbling block when it comes to emulation.
It's also a bit scary to see that people seem to think of modern (i.e. TFT) displays as just "better". CRTs' main disadvantage were sharpness and size, but in nearly every other respect they were actually better: sporting wider color gamut, better contrast, resolution independence, no latency, and supporting a wide range of scan rates. While a modern TFT is better suited to the everyday tasks of users today, they're a major stumbling block when it comes to emulation.
#32
Posted Fri May 1, 2009 9:39 AM
IMHO, recreating RF with all of its noise and fuzzy edges is not something I'm interested in. I didn't like RF back in the day and have no nostalgia for it now. But the stock look of emulators on an LCD monitor is too sterile as well. I would want to get the CRT emulation to recreate a well tuned composite or S-video mod. So you get the CRT monitor feel, but not an intentionally cruddy picture.
Edited by mos6507, Fri May 1, 2009 9:40 AM.
#33
Posted Fri May 1, 2009 9:41 AM
MagerValp, on Fri May 1, 2009 9:18 AM, said:
I read this a few days ago, and originally thought it sounded really interesting, but reading further I was disappointed. You appear to be reducing the complex interaction of the color encoding, the color carrier, the bandwidth limits, the electron beam hitting phosphors, and all the other details that make up an NTSC CRT based display system into "let's slap on some texture, delay, blur, and noise filters, and call it a day". It even appears to be done on RGB pixels, and not YUV and the frequency domain.
#34
Posted Fri May 1, 2009 11:02 AM
Thomas Jentzsch, on Fri May 1, 2009 12:11 PM, said:
MagerValp, on Fri May 1, 2009 9:18 AM, said:
I read this a few days ago, and originally thought it sounded really interesting, but reading further I was disappointed. You appear to be reducing the complex interaction of the color encoding, the color carrier, the bandwidth limits, the electron beam hitting phosphors, and all the other details that make up an NTSC CRT based display system into "let's slap on some texture, delay, blur, and noise filters, and call it a day". It even appears to be done on RGB pixels, and not YUV and the frequency domain.
#35 ONLINE
Posted Fri May 1, 2009 1:53 PM
Yes, we will need to see this firsthand on our own monitors and configurations. Only then can we offer constructive criticism in a manner that will move the project closer to what we expect.
#36 ONLINE
Posted Fri May 1, 2009 1:57 PM
mos6507, on Fri May 1, 2009 10:39 AM, said:
IMHO, recreating RF with all of its noise and fuzzy edges is not something I'm interested in. I didn't like RF back in the day and have no nostalgia for it now. But the stock look of emulators on an LCD monitor is too sterile as well. I would want to get the CRT emulation to recreate a well tuned composite or S-video mod. So you get the CRT monitor feel, but not an intentionally cruddy picture.
You should then be easily satisfied with a simple phosphor mask .png application. And perhaps some good saturation and bleedthrough/glow. The picture will have some semblence of scanlines but continue to be sharp.
That is why I say all the parameters of this project must be user configurable. Everyone will have different expectations; and those expectations will be based on how they remember the early system. And as you can guess, there were probably countless variations in the TV hookups, wire lengths, contact cleanliness. etc.. Not to mention the hundreds of differnt TV's. And with those TV's - I'm absolutely certain none of them have been identically adjusted. ANALOG, babycakes!!
Edited by Keatah, Fri May 1, 2009 1:58 PM.
#37
Posted Fri May 1, 2009 2:14 PM
I use the rendering filters on Mame & Mess and it looks
much better, it's NOT perfect but it has very nice look & feel...
much better, it's NOT perfect but it has very nice look & feel...
#38
Posted Fri May 1, 2009 3:11 PM
stephena, on Fri May 1, 2009 6:02 PM, said:
I agree. This is a very good first effort, and I fully support anyone who wants to help with Stella development, especially when it's something as complex as this. It hasn't been released yet, and no doubt there's more improvements to be made, but it's 100 times better than what Stella had before in this area (ie, nothing). I thnk it's a little early to be disappointed when we haven't even seen the initial version yet, let alone the final one.
Quote
Many of today's players may only experience Atari games in emulation. Indeed, many of my students may have little to no memory of CRT televisions at all. Given such factors, it seems even more important to improve the graphical accuracy of tools like Stella.
#39
Posted Fri May 1, 2009 3:16 PM
If they are going for authenticity, they should also correct the pixel size ratio.
I believe Stella uses 2:1 pixels (i.e. horizontal to vertical) ratio, which is correct for PAL but for NTSC the actual pixel ratio is around 1.6:1. This means games will be stretched vertically in Stella compared to real hardware.
I haven't brought this up before because I prefer the 2:1 ratio for development since the pixels can be rendered cleanly, and it's important to see individual pixels.
1.6:1 pixels would likely require anti-aliasing which would normally result in a fuzzier pixels, but for this project it probably wouldn't, and would look more authentic overall.
I believe Stella uses 2:1 pixels (i.e. horizontal to vertical) ratio, which is correct for PAL but for NTSC the actual pixel ratio is around 1.6:1. This means games will be stretched vertically in Stella compared to real hardware.
I haven't brought this up before because I prefer the 2:1 ratio for development since the pixels can be rendered cleanly, and it's important to see individual pixels.
1.6:1 pixels would likely require anti-aliasing which would normally result in a fuzzier pixels, but for this project it probably wouldn't, and would look more authentic overall.
#40
Posted Fri May 1, 2009 4:17 PM
batari, on Fri May 1, 2009 5:46 PM, said:
If they are going for authenticity, they should also correct the pixel size ratio.
I believe Stella uses 2:1 pixels (i.e. horizontal to vertical) ratio, which is correct for PAL but for NTSC the actual pixel ratio is around 1.6:1. This means games will be stretched vertically in Stella compared to real hardware.
I haven't brought this up before because I prefer the 2:1 ratio for development since the pixels can be rendered cleanly, and it's important to see individual pixels.
1.6:1 pixels would likely require anti-aliasing which would normally result in a fuzzier pixels, but for this project it probably wouldn't, and would look more authentic overall.
I believe Stella uses 2:1 pixels (i.e. horizontal to vertical) ratio, which is correct for PAL but for NTSC the actual pixel ratio is around 1.6:1. This means games will be stretched vertically in Stella compared to real hardware.
I haven't brought this up before because I prefer the 2:1 ratio for development since the pixels can be rendered cleanly, and it's important to see individual pixels.
1.6:1 pixels would likely require anti-aliasing which would normally result in a fuzzier pixels, but for this project it probably wouldn't, and would look more authentic overall.
The default for NTSC and PAL is 2:1, as you say, which is obtained with a gl_aspect(n|p) of '100'. So, since (1.6/2.0)*100 = 80, that's what you should use in NTSC mode. And sure enough, if you bump gl_aspectn down to 85 or so, you'll get a much more authentic image. The extra 5 (or so) comes from the fact that your particular monitor might not have exactly square pixels.
The following snapshots from River Raid illustrate this:
Normal mode NTSC (100%, 2:1):
Aspect ratio corrected, NTSC (87%, ~1.7:1 mathematically, looking more like 1.6:1 in reality):
#41
Posted Fri May 1, 2009 4:25 PM
stephena, on Fri May 1, 2009 5:17 PM, said:
batari, on Fri May 1, 2009 5:46 PM, said:
If they are going for authenticity, they should also correct the pixel size ratio.
I believe Stella uses 2:1 pixels (i.e. horizontal to vertical) ratio, which is correct for PAL but for NTSC the actual pixel ratio is around 1.6:1. This means games will be stretched vertically in Stella compared to real hardware.
I haven't brought this up before because I prefer the 2:1 ratio for development since the pixels can be rendered cleanly, and it's important to see individual pixels.
1.6:1 pixels would likely require anti-aliasing which would normally result in a fuzzier pixels, but for this project it probably wouldn't, and would look more authentic overall.
I believe Stella uses 2:1 pixels (i.e. horizontal to vertical) ratio, which is correct for PAL but for NTSC the actual pixel ratio is around 1.6:1. This means games will be stretched vertically in Stella compared to real hardware.
I haven't brought this up before because I prefer the 2:1 ratio for development since the pixels can be rendered cleanly, and it's important to see individual pixels.
1.6:1 pixels would likely require anti-aliasing which would normally result in a fuzzier pixels, but for this project it probably wouldn't, and would look more authentic overall.
The default for NTSC and PAL is 2:1, as you say, which is obtained with a gl_aspect(n|p) of '100'. So, since (1.6/2.0)*100 = 80, that's what you should use in NTSC mode. And sure enough, if you bump gl_aspectn down to 85 or so, you'll get a much more authentic image. The extra 5 (or so) comes from the fact that your particular monitor might not have exactly square pixels.
The following snapshots from River Raid illustrate this:
Normal mode NTSC (100%, 2:1):
Aspect ratio corrected, NTSC (87%, ~1.7:1 mathematically, looking more like 1.6:1 in reality):
#42
Posted Fri May 1, 2009 6:19 PM
MagerValp, on Fri May 1, 2009 5:11 PM, said:
I'm sorry, I don't mean to belittle the improvements to Stella. Anyone that helps development should be supported, and adding post-processing is great. It's just that when I saw something about CRT simulation from a professor at a respected university, I expected more than run of the mill filters. Shouldn't the first steps be to analyze, understand, and document the phenomenon?
I appreciate this sentiment. And actually, a lot more research went into the effects than just eyeballing, but certainly more could be done. This is an ongoing project, as Stella is an open platform, and you're seeing the results of a student capstone done in a few month's time. I'm just now preparing to set up the next round of it for our summer sessions, though. Also, I wouldn't underestimate the rhetorical power of doing a rough-cut on something as a way to build a set of ideas around future work, including the very reactions you're offering.
#43
Posted Tue May 12, 2009 7:47 AM
When do u think the first version (Stella) with this feature will be released ?
I.G
I.G
#44
Posted Tue May 12, 2009 2:42 PM
israelg, on Tue May 12, 2009 11:17 AM, said:
When do u think the first version (Stella) with this feature will be released ?
I.G
I.G
#45
Posted Tue May 12, 2009 8:59 PM
I wonder if you could eventually incorporate some virtual control knobs for adjusting the palette as if we're adjusting our TV set and/or the color pot on our Atari? There's some code in the "Request for screenshots" thread that might be good to use for that. You wouldn't need to calculate the colors all the time, just when the control knobs (brightness, contrast, tint, saturation, red, green, blue, color pot phase angle) are being adjusted, then calculate the new palette and store it in an array. And maybe have an option to let the user save the array to a new palette file and give it a name.
Michael
PS-- At first I liked the old aspect ratio adjuster better, but I finally realized what the two new ones are-- N is for NTSC, and P is for PAL, right?
Michael
PS-- At first I liked the old aspect ratio adjuster better, but I finally realized what the two new ones are-- N is for NTSC, and P is for PAL, right?
#46
Posted Fri May 22, 2009 5:50 PM
SeaGtGruff, on Tue May 12, 2009 10:59 PM, said:
I wonder if you could eventually incorporate some virtual control knobs for adjusting the palette as if we're adjusting our TV set and/or the color pot on our Atari? There's some code in the "Request for screenshots" thread that might be good to use for that. You wouldn't need to calculate the colors all the time, just when the control knobs (brightness, contrast, tint, saturation, red, green, blue, color pot phase angle) are being adjusted, then calculate the new palette and store it in an array. And maybe have an option to let the user save the array to a new palette file and give it a name.
Yes, thinking about this seriously...
#47
Posted Fri May 22, 2009 5:58 PM
ibogost, on Fri May 22, 2009 9:20 PM, said:
SeaGtGruff, on Tue May 12, 2009 10:59 PM, said:
I wonder if you could eventually incorporate some virtual control knobs for adjusting the palette as if we're adjusting our TV set and/or the color pot on our Atari? There's some code in the "Request for screenshots" thread that might be good to use for that. You wouldn't need to calculate the colors all the time, just when the control knobs (brightness, contrast, tint, saturation, red, green, blue, color pot phase angle) are being adjusted, then calculate the new palette and store it in an array. And maybe have an option to let the user save the array to a new palette file and give it a name.
Yes, thinking about this seriously...
#48
Posted Fri May 22, 2009 8:03 PM
stephena, on Fri May 22, 2009 7:58 PM, said:
Yes, I was actually thinking in terms of it being done within Stella at the core level, rather than being a filter.
Michael
#49
Posted Sun May 24, 2009 2:48 PM
Trebor, on Wed Apr 22, 2009 2:44 PM, said:
It would be great if the end results looked like Blargg's NTSC Libraries, here:
http://slack.net/~ant/libs/ntsc.html
kat5200 has incorporated an NTSC filter - and it really is fantastic. As shown in the link above there has been NTSC filters incorporated in various other system emulators (including Nestopia). It would be great to see an Atari 2600 emulator and an Atari 7800 emulator with such an effect.
All the best with this endeavor, ibogost. I'm looking forward to the end results.
-Trebor
http://slack.net/~ant/libs/ntsc.html
kat5200 has incorporated an NTSC filter - and it really is fantastic. As shown in the link above there has been NTSC filters incorporated in various other system emulators (including Nestopia). It would be great to see an Atari 2600 emulator and an Atari 7800 emulator with such an effect.
All the best with this endeavor, ibogost. I'm looking forward to the end results.
-Trebor
I think it would actually be better for those two projects to stay separate and don't mix their focuses. No need to duplicate other's work. Both effects could be combined then - applying Ian's filters to a screen processed previously by Blargg's would give interesting results, wouldn't it.
Stephen, I advise you to look into Atari800's source. Blargg's filter has been implemented there over three years ago, and it gives really nice results. Both Atari 800 and 2600 produce screen in a similar way (128/256 colours, each pixel is exactly 1 colour clock wide), so copying the code into Stella would give pretty accurate results without any adjustments.
Edited by Kr0tki, Sun May 24, 2009 2:50 PM.
#50
Posted Sun May 24, 2009 4:05 PM
Kr0tki, on Sun May 24, 2009 6:18 PM, said:
Trebor, on Wed Apr 22, 2009 2:44 PM, said:
It would be great if the end results looked like Blargg's NTSC Libraries, here:
http://slack.net/~ant/libs/ntsc.html
kat5200 has incorporated an NTSC filter - and it really is fantastic. As shown in the link above there has been NTSC filters incorporated in various other system emulators (including Nestopia). It would be great to see an Atari 2600 emulator and an Atari 7800 emulator with such an effect.
All the best with this endeavor, ibogost. I'm looking forward to the end results.
-Trebor
http://slack.net/~ant/libs/ntsc.html
kat5200 has incorporated an NTSC filter - and it really is fantastic. As shown in the link above there has been NTSC filters incorporated in various other system emulators (including Nestopia). It would be great to see an Atari 2600 emulator and an Atari 7800 emulator with such an effect.
All the best with this endeavor, ibogost. I'm looking forward to the end results.
-Trebor
I think it would actually be better for those two projects to stay separate and don't mix their focuses. No need to duplicate other's work. Both effects could be combined then - applying Ian's filters to a screen processed previously by Blargg's would give interesting results, wouldn't it.
Stephen, I advise you to look into Atari800's source. Blargg's filter has been implemented there over three years ago, and it gives really nice results. Both Atari 800 and 2600 produce screen in a similar way (128/256 colours, each pixel is exactly 1 colour clock wide), so copying the code into Stella would give pretty accurate results without any adjustments.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users














