RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Scanlines in Libretro AdvMAME and FBA

    Scheduled Pinned Locked Moved Help and Support
    79 Posts 7 Posters 44.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • caver01C
      caver01 @Riverstorm
      last edited by

      @Riverstorm said in Scanlines in Libretro AdvMAME and FBA:

      Yes I hope Daphne continues development and support. I also tried adding scanlines to Daphne (created a retroarch.cfg) but it was a no go.

      That's because Daphne isn't a Libretro core. It's a standalone emu like AdvaceMAME. I don't really mind that it doesn't have scanlines. It's playing a video after all, so obscuring pixels edges with simulated CRT RGB triads isn't a big deal for me. Arcade unites arcade emulators under one list whether stand-alone or lr cores, but it doesn't combine settings.

      My 4-player cocktail style cabinet built as a custom "roadcase"

      1 Reply Last reply Reply Quote 0
      • caver01C
        caver01 @Riverstorm
        last edited by

        @Riverstorm said in Scanlines in Libretro AdvMAME and FBA:

        Sorry I got to ask, I know integer scaling now but what is fractional scaling? ;)

        It's just what I called not using integer scaling. When you don't bother to specify integer scaling, you are letting it scale to fill your display dimensions, and that is very likely some fractional magnification. It might be 1.5x, 3.2x--whatever.

        My point was that I haven't yet tried DaveJ's update to the shader to improve vertical games on horizontal displays. If it looks OK, it may allow me to avoid using integer scaling (which I don't, but might need to if I want to improve the look of scanlines--but maybe the new shader works either way).

        My 4-player cocktail style cabinet built as a custom "roadcase"

        RiverstormR 2 Replies Last reply Reply Quote 0
        • RiverstormR
          Riverstorm @caver01
          last edited by Riverstorm

          @caver01 said in Scanlines in Libretro AdvMAME and FBA:

          My point was that I haven't yet tried DaveJ's update to the shader to improve vertical games on horizontal displays. If it looks OK, it may allow me to avoid using integer scaling (which I don't, but might need to if I want to improve the look of scanlines--but maybe the new shader works either way).

          Ah ok, that makes sense, a fitting terminology. I popped over there to say thanks for his work and asked if it will make it to the RetroPie Repo at some point. I can wait if it does unless of course it's doing something very different that I should grab it.

          Dank asked if he could break out the shaders which I think I prefer vs. tweaking the files.

          I don't really mind that it doesn't have scanlines. It's playing a video after all, so obscuring pixels edges with simulated CRT RGB triads isn't a big deal for me.

          That's true...

          1 Reply Last reply Reply Quote 0
          • RiverstormR
            Riverstorm @caver01
            last edited by

            @caver01 said in [Scanlines in Libretro AdvMAME and FBA](/topic/834/scanlines-in-libretro-

            Solar Quest and Star Castle are both vector games, so I use AdvanceMAME (can specify full resolution for nice, crisp vector lines).

            One more question for you if that's ok. You're a fountain of knowledge my good sir! ;) How do you get full resolution for these vector games? I am using the overlay which I think was just part of the glass or background and not a generated image which looks really nice but I was just wondering what you tweak to make sure it's full resolution.

            caver01C 1 Reply Last reply Reply Quote 0
            • caver01C
              caver01 @Riverstorm
              last edited by

              @Riverstorm said in Scanlines in Libretro AdvMAME and FBA:

              One more question for you if that's ok. You're a fountain of knowledge my good sir! ;) How do you get full resolution for these vector games?

              You need to look for these lines in your .rc file for the version of advancemame you are using. Edit both if you might use each, but let's say you are using 1.4. So edit advmame-1.4.rc and look for the lines that look like:

              display_width 1280
              display_height 1024
              display_flicker 15
              display_intensity 1.5
              display_antialias yes
              display_translucency yes
              display_beam 1.2
              

              These settings only affect vector games. I like them this way on my screen. The flicker is a nice effect and it's set light here. The beam seems to enlarge in one dimension only, so if you want thick beams, you can't really get them, but I like a little larger than 1 pixel. Intensity can go up to 3 which I like, but if you back it down a bit, the flicker is more visible as is the translucency.

              If you haven't already done it, also set sound_latency 0.05. The default is ridiculously high and you can see/hear the delay, so set this to the minimum of 0.05.

              Finally, make sure when you launch using the runcommand that you are using the full resolution of your display.

              My 4-player cocktail style cabinet built as a custom "roadcase"

              RiverstormR 1 Reply Last reply Reply Quote 0
              • J
                jretropie
                last edited by

                Hi all,

                I tried add the crt shader by using Floob's script. It shader then works on SNES, Sega, NeoGeo but not on any Mame emulator. Is there any trick to enable it on MAME?

                dankcushionsD 1 Reply Last reply Reply Quote 0
                • dankcushionsD
                  dankcushions Global Moderator @jretropie
                  last edited by

                  @jretropie said in Scanlines in Libretro AdvMAME and FBA:

                  Hi all,

                  I tried add the crt shader by using Floob's script. It shader then works on SNES, Sega, NeoGeo but not on any Mame emulator. Is there any trick to enable it on MAME?

                  you have to be using a libretro mame emulator. use https://github.com/RetroPie/RetroPie-Setup/wiki/Runcommand to find out what you're using.

                  J 1 Reply Last reply Reply Quote 0
                  • J
                    jretropie @dankcushions
                    last edited by

                    @dankcushions Hi, I have tried Ir-fba-next, Ir-fba, Ir-mame2003. But none of them shows the shader.

                    dankcushionsD 1 Reply Last reply Reply Quote 0
                    • dankcushionsD
                      dankcushions Global Moderator @jretropie
                      last edited by

                      @jretropie said in Scanlines in Libretro AdvMAME and FBA:

                      @dankcushions Hi, I have tried Ir-fba-next, Ir-fba, Ir-mame2003. But none of them shows the shader.

                      are they in the arcade folder? might be that the script hasn't been updated to use the new(ish) arcade or mame-libretro file paths. not sure. you could instead use the https://github.com/retropie/retropie-setup/wiki/Configuration-Editor

                      anyway, the shaders have been updated to the latest versions. here's some pretty screenshots:

                      crt-pi
                      alt text

                      crt-pi-curvature
                      alt text

                      crt-pi-vertical
                      alt text

                      crt-pi-curvature-vertical
                      alt text

                      reinstall retroarch via retropie-setup to get the new ones

                      J RiverstormR 2 Replies Last reply Reply Quote 1
                      • J
                        jretropie @dankcushions
                        last edited by

                        @dankcushions You are right. Placing ROMs in arcade folder. Shader does not work.

                        dankcushionsD FloobF 2 Replies Last reply Reply Quote 0
                        • dankcushionsD
                          dankcushions Global Moderator @jretropie
                          last edited by

                          @jretropie said in Scanlines in Libretro AdvMAME and FBA:

                          @dankcushions You are right. Placing ROMs in arcade folder. Shader does not work.

                          hmm, one for @Floob i think!

                          1 Reply Last reply Reply Quote 0
                          • FloobF
                            Floob @jretropie
                            last edited by

                            @jretropie If you are using shaders (as opposed to overlays) when you install them via my tool you would need to add

                            video_shader = /opt/retropie/emulators/retroarch/shader/crt-pi.glslp
                            video_shader_enable = true
                            

                            to the top of the file /opt/retropie/configs/arcade/retroarch.cfg

                            That would apply the shader to all games in the arcade folder.

                            Please read the Docs before asking a new question.
                            RetroPie Help Guides: https://goo.gl/3gcNsT

                            1 Reply Last reply Reply Quote 1
                            • J
                              jretropie
                              last edited by

                              Does anyone knows why the shader has vertical color line when I connect to 32" 720p TV?

                              The shader works fine with smaller 22" 1080p computer LCD.

                              alt text

                              davejD 1 Reply Last reply Reply Quote 0
                              • davejD
                                davej @jretropie
                                last edited by

                                @jretropie said in Scanlines in Libretro AdvMAME and FBA:

                                Does anyone knows why the shader has vertical color line when I connect to 32" 720p TV?

                                The shader works fine with smaller 22" 1080p computer LCD.

                                It looks like the shadow mask simulation in the shader is interfering with the dot pitch of your TV - TVs do image processing on input signals which might be making this worse as well. Try turning this off by changing the value of MASK_TYPE in the version of the crt-pi.glsl file you are using to be 0. You can try 2 as well but that is likely to give you red/green/blue colour bands instead of green/magenta ones.

                                It's worth me pointing out that the shader really needs about 4 vertical pixels to do even scan lines so you might get moire patterns on your 720p screen.

                                J 1 Reply Last reply Reply Quote 0
                                • J
                                  jretropie @davej
                                  last edited by jretropie

                                  I am looking at the file and can't find any variable call mask_type

                                  shaders = "1"
                                  shader0 = "shaders/crt-pi.glsl"
                                  filter_linear0 = "true"
                                  wrap_mode0 = "clamp_to_border"
                                  mipmap_input0 = "false"
                                  alias0 = ""
                                  float_framebuffer0 = "false"
                                  srgb_framebuffer0 = "false"

                                  FloobF 1 Reply Last reply Reply Quote 0
                                  • FloobF
                                    Floob @jretropie
                                    last edited by

                                    @jretropie Try

                                    sudo nano /opt/retropie/emulators/retroarch/shader/shaders/crt-pi.glsl
                                    

                                    Please read the Docs before asking a new question.
                                    RetroPie Help Guides: https://goo.gl/3gcNsT

                                    J 1 Reply Last reply Reply Quote 0
                                    • davejD
                                      davej
                                      last edited by

                                      What Floob said, although as you're using a curved version of the shader you'll need to edit the corresponding glsl file. You can find which one by looking for the line that says something similar to:

                                      shader0 = "shaders/crt-pi.glsl"

                                      1 Reply Last reply Reply Quote 0
                                      • RiverstormR
                                        Riverstorm @dankcushions
                                        last edited by Riverstorm

                                        @dankcushions said in Scanlines in Libretro AdvMAME and FBA:

                                        anyway, the shaders have been updated to the latest versions. here's some pretty screenshots:

                                        Those look amazing! I think the scanlines really add another level of genuineness.

                                        1 Reply Last reply Reply Quote 0
                                        • RiverstormR
                                          Riverstorm @caver01
                                          last edited by

                                          @caver01 said in Scanlines in Libretro AdvMAME and FBA:

                                          @Riverstorm said in Scanlines in Libretro AdvMAME and FBA:

                                          One more question for you if that's ok. You're a fountain of knowledge my good sir! ;) How do you get full resolution for these vector games?

                                          You need to look for these lines in your .rc file for the version of advancemame you are using. Edit both if you might use each, but let's say you are using 1.4. So edit advmame-1.4.rc and look for the lines that look like:

                                          display_width 1280
                                          display_height 1024
                                          display_flicker 15
                                          display_intensity 1.5
                                          display_antialias yes
                                          display_translucency yes
                                          display_beam 1.2
                                          

                                          These settings only affect vector games. I like them this way on my screen. The flicker is a nice effect and it's set light here. The beam seems to enlarge in one dimension only, so if you want thick beams, you can't really get them, but I like a little larger than 1 pixel. Intensity can go up to 3 which I like, but if you back it down a bit, the flicker is more visible as is the translucency.

                                          If you haven't already done it, also set sound_latency 0.05. The default is ridiculously high and you can see/hear the delay, so set this to the minimum of 0.05.

                                          Finally, make sure when you launch using the runcommand that you are using the full resolution of your display.

                                          Thanks Caver, I did a copy and paste as I do with several of your posts. I will be adding this in tonight to see how it looks!

                                          caver01C RiverstormR 2 Replies Last reply Reply Quote 0
                                          • J
                                            jretropie @Floob
                                            last edited by

                                            @Floob When I try 0 or 2 for the mask_type. the scanlines disappeared.

                                            FloobF davejD 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            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.