I need help using a scanline overlay on a CRT
-
I've been wondering about this - do the scanlines of the CRT-Pi shader for example, scale with the native source? Like will consoles with 240i native resolution have 240 scanlines using the CRT-Pi shader? And will 480i consoles have 480 scanlines with the same CRT-Pi shader? (I seriously haven't sat down and counted how many scanlines each emulator puts up on the screen ;)
-
@simillarian ok so i went with using the single line overlay posted above either single line image works. tested on an lcd but should work the same on a crt. so heres what i di. i used this image:
i renamed it "scanline1_640x480.png"
i placed it in:
/opt/retropie/emulators/retroarch/overlays/1080p_4-3/
then i made a .cfg file and pasted in the same folder. i named it "scanline1_640x480.cfg" inside that .cfg file i added this:
overlays = 1 overlay0_overlay = scanline1_640x480.png overlay0_full_screen = true overlay0_descs = 0
then i opened up /opt/retropie/configs/nes/retroarch.cfg and put a hashtag in front of all the lines for a shader to disable the shader . then i added this:
input_overlay = /opt/retropie/emulators/retroarch/overlays/edmaul69/scanline2_640x480.cfg input_overlay_enable = "true" input_overlay_opacity = 1.000000
then i saved the file and started the game
-
@Dochartaigh said in I need help using a scanline overlay on a CRT:
I've been wondering about this - do the scanlines of the CRT-Pi shader for example, scale with the native source? Like will consoles with 240i native resolution have 240 scanlines using the CRT-Pi shader? And will 480i consoles have 480 scanlines with the same CRT-Pi shader? (I seriously haven't sat down and counted how many scanlines each emulator puts up on the screen ;)
yes it will.
to OP - my understanding is that scanlines don't appear on CRT tvs unless you're running at the correct resolution, which will typically be 240P. still, this might help: https://www.reddit.com/r/retrogaming/comments/3nqijo/bigger_scanlines_on_a_trinitron_tutorial/
-
@dankcushions check out my last post i just uploaded. this should make the scanlines he needs with this overlay i created. here is how it looks on 640X480 on an lcd but should be the same on a crt.
-
@edmaul69 yeah that should work but IMO if you have a CRT you should have no need to fake it :)
-
If I understand it all correctly your scanline overlay is cutting your FPS in half. The advantage of the 240p is that the result is 60 full frames per second. When you use the interlaced mode (480i) 30 times per second the even lines are drawn and 30 times per second the odd lines are drawn. When the odd lines are covered by a black line this means you will only see 30 frames per second. Some NES game use blinking really fast to give the impression of something being half translucent. For example when your hit by an enemy in Mega Man. When you have your scanline overlay over it, this means you either see a fully opaque sprite, or it's entirely gone for awhile.
That's the exact reason why I created the issue on github.
(BTW. if you're using PAL instead of NTSC 480i becomes 576i and 50hz (=50/2 = 25FPS)
-
@starquake so how would it work based on the fact that none of my odd lines are black? Is it needing to alternate back and forth between odds and evens for flashing/translucent?
-
@edmaul69 I'm not sure I understand your question. Are you saying it works perfectly fine right now? Or are you asking how you should make it work?
-
@starquake if i am understanding right it alternates odds and even to create translucent. Or its flashing back and forth to give 60fps. If Which means a good overlay cant work on it correct? Taking the 1080p scanline overlay that is on the pi and making it 640x480 it still looks as crappy as it did before.
-
@starquake how would it look using the crt-pi shader?
-
No that's not what I meant. I'm sorry, I'm not sure how to explain it better than I already did. Maybe this helps:
-
This post is deleted! -
@starquake im half retarded today. 240p and 480i.. forgot the whole 480 interlacing bit and 240 being progressive. I never use a crt so i kinda spaced out about it. Thanks for the video to remind me
-
@simillarian noticed you deleted your post. What was the issue you are having?
-
@edmaul69 Well as long as you're not going full retard. ;-)
-
@starquake great movie... 😄
-
@simillarian @starquake @dankcushions @Floob i added this in my /opt/retropie/configs/nes/retroararch.cfg
video_fullscreen_x = 320 video_fullscreen_y = 240
and i got it in fullscreen 320x240. wouldnt this fix @simillarian 's problem? i also removed the video setting from run command menu right before a game starts
-
If you want scanlines on your CRT and keep 60fps you need 240p which the Raspberry Pi doesn't support. Look it any of my links posted for more explanation. It's a subject that is hard to understand but if you read the second part of this carefully you will understand what's going wrong:
http://scanlines.hazard-city.de/Keep in mind the Raspberry Pi only outputs 480i (or 576i for PAL)
Took me quite a while to understand all this. But if you read carefully you will understand why this all doesn't work.
-
I'll past the important part here for your convenience:
"For 60+ years now, since television has been around, classic standard definition is transmitted as an interlaced signal. In the USA and Japan that's called 480i (running at 60Hz), while it's 576i in Europe, parts of Asia and parts of South America (running at 50Hz). When the first video game systems emerged in the 70s, both as arcade cabinets and as home systems, manufacturers opted for an alternative video standard instead. Instead of alternating the lines between fields, they chose a non-interlaced signal, delivering 60 progressive frames per second instead. To keep the format compatible with the millions of TV sets out there, each frame consists of (roughly) 240 lines - same as the fields in the interlaced signals. The progressive signal eliminated flicker, made text more readable and ultimately created what is known today as "8-bit and 16-bit pixel art".
Because the tubes were initially created for interlaced signals, the spacing and resolution of the tube's mask is optimized for 480i signals. If a progressiv 240p signal is fed, every second line is left blank, creating those visible dark lines, which we call "scanlines". Those lines soften the pixels and create a very distinctive look, which many people prefer to the "emulated" look of raw low-res signals on digital panels.
All the classic home systems out there, starting from early 80s Atari systems, mid 80s Nintendo and Sega systems, early 90s 16-bit systems like SuperNES, PC Engine, Mega Drive or Neo Geo, up to the early days of the 32-bit generation with Playstation One and Sega Saturn, output 240p signals (or 288p in their PAL versions) and are perfectly fitted for any classic CRT display. While the actual active lines differ on this systems (Neo Geo for example has 224 lines), 240p refers to the progressive nature and the 15khz timing of those signals."
-
@edmaul69 said in I need help using a scanline overlay on a CRT:
@simillarian @starquake @dankcushions @Floob i added this in my /opt/retropie/configs/nes/retroararch.cfg
video_fullscreen_x = 320 video_fullscreen_y = 240
and i got it in fullscreen 320x240. wouldnt this fix @simillarian 's problem? i also removed the video setting from run command menu right before a game starts
That won't work. There are three resolutions used when emulating games using retroarch on a Pi. The game resolution (e.g. 240P), the retroarch output resolution (could be 240P as in your example) and the resolution that the Pi uses for it's video output (for composite it's 480i or 576i) which is set in /boot/config.txt. Let's assume 480i in this discussion.
The problem is, even if you get retroarch to output 240P, the Pi will upscale it to 480i and alternate displaying odd and even lines on alternate frames. If you emulate scanlines (by shader or overlay) you will lose either the odd frames or the even ones effectively show a blank frame every other frame. As starquake said, this effectively cuts your frame rate in half. If you have a game that relies on showing or not showing something on alternate frames for transparency effects, you'll only get to see those frames that show (or not) something and the transparency effect will be lost. Even if you don't use games that rely on transparency, you'll only be seeing half the frames which will spoil animation effects and make the screen seem to lag.
@simillarian, You say you have a Trinitron TV. Does it have some form of RGB input? If so, you could use a HDMI to RGB adapter or a Gert VGA adapter to enable you to get a 240P signal you could feed into your TV.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.