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

    Crt Shaders Button On/off?

    Scheduled Pinned Locked Moved Help and Support
    crt shaderarcade retropiecabinetdisplaybuttons gpio
    16 Posts 6 Posters 4.9k 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.
    • M
      MattyL42
      last edited by MattyL42

      Thought this could be a cool interesting feature on my arcade cab. Is it possible to setup a button to switch between using Crt shader of choice/standard normal display?
      E.g. press here for old skool graphics on/off.

      I have a squid style button wired already using gpio pins 5 and 6 (pi3)

      Im also using an ipac2 with a few inputs spare .

      I'm basically a noob when it comes to using linux script and commands but I'm looking for a new project if anyone can help :)

      herb_fargusH 1 Reply Last reply Reply Quote 0
      • M
        MattyL42
        last edited by

        Would this be possible?

        1 Reply Last reply Reply Quote -1
        • dankcushionsD
          dankcushions Global Moderator
          last edited by

          theory: you could bind your button to input_shader_next_btn retroarch.cfg, and then make it so you only had two shaders in your shaders folder: crt-pi and retroarch.glslp, and edit retroarch.glslp in a text editor and set shaders=0?

          M 1 Reply Last reply Reply Quote 3
          • M
            MattyL42 @dankcushions
            last edited by

            @dankcushions Thanks for the reply. I will do some research on this.

            The two shader files did you mean have one active and the other one transparent so it appears to change from 'off to on' when the button is pressed?

            Can you recommend any key words or anything to research to learn the commands or where to edit the script. I'm a noob but should be able to learn this.

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

              @mattyl42 sure!

              so, to bind the 'next shader' button you want to edit /opt/retropie/configs/all/retroarch.cfg. Once you have that open, search for input_shader_next_btn, and if that's not there, add it like so:
              input_shader_next_btn=X where X is the button you want to change your shader on/off. I don't know what number button that would be for you, but you could find it out by running jstest?

              once you have that bound, in game you should be able to hold your hotkey (normally bound to select), and press your shader button, and it should start switching through shaders. i think that's a good first step to get to!

              1 Reply Last reply Reply Quote 2
              • M
                MattyL42
                last edited by

                Hi thank you very much for the help. I have this now working from a single arcade button press but I was not able to edit the config txt yet sadly... I can access it through retropie menu but don't know where I'm looking in there. Is there anyway to edit the text in a Windows or noobs friendly way via ssh? I've watched a fair few you tube videos and learned heaps more so still productive lesson. Not fully grasping linux yet though!

                I managed to get my Crt fx button working force by reconfiguring my ipac2 then got creative and dismantled and modified the button and the loom. Next to create the two shaders...easy. Removing the existing shaders possibly harder if anyone has any suggestions on how to locate and access said files?

                mituM dankcushionsD 2 Replies Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator @MattyL42
                  last edited by

                  @mattyl42 From Windows, you have access via file shares (point Windows Explorer to \\retropie\configs) to the configuration files so you can edit them. I recommend using Notepad++ for editing. The RetroArch configs are in \\retropie\configs\all\retroarch and the joypad cfg files are under the autoconfig folder.

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

                    @mattyl42
                    @mitu has given you some good advice on how to edit the files. in terms of deleting the unwanted shaders, the folder with them all in is:
                    /opt/retropie/configs/all/retroarch/shaders/
                    within that folder, i think you'll see all the files and folders listed here: https://github.com/RetroPie/common-shaders/tree/rpi

                    essentially, each shader is a .glslp parameters file, and a .glsl shader file (in the /shaders/ subdirectory). so, if for example you wanted to use the zfast_crt shader, you would delete everything APART from:

                    /shaders/zfast_crt_standard.glsl
                    /shaders/zfast_resources/ (whole directory)
                    

                    as always, probably a good idea to back up before you do this :)

                    my theory is that if you have one shader, when you use the 'cycle next shader' button it will go between that shader, and NO shader. if it doesn't do that, my next idea would be to create a 'dummy' shader that does nothing. i think this might even already exist.

                    alternatively we could log an issue with retroarch and ask them to make it function in the way we want, as i think it's a useful function.

                    1 Reply Last reply Reply Quote 1
                    • M
                      MattyL42
                      last edited by

                      Thank you very much both of you gents. Mitu's post has made everything clear. I was trying to find everything through ssh/command or reading my SD card. I've now located everything all the configs I can see how to edit values with notepad++. It makes sense all the specified pathways everyone always kindly provides. I don't know how I managed to sort out my ipac inputs without knowing all this!

                      I've also found the shader locations and can determine the two different types of file .glsl and .glslp I need to remove. I'm going to spend a few days becoming familiar with this and think about how everything works and see what I can get with my CRT fx button.

                      I will back up and even burn another SD first.

                      This is a great unexpected hobby :)

                      1 Reply Last reply Reply Quote 0
                      • M
                        MattyL42
                        last edited by

                        Hi there. I've now removed all the shader files apart from the .glsl .glslp I require for my chosen shader.
                        I can confirm when I push my CRT fx button it switches on the shader and displays as usual. When I repress the button it reloads the same shader rather than cycles to the 'no shader' position.
                        What I have to do now is find out how to make a 'dummy or transparent' shader to make up the cycle and act as the 'off phase' .
                        Can anyone set me off on my research on shaders .glslp and .glsl and help me in the direction of making a blank one?

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

                          This could be a nice feature to turn shaders on and off on the fly for comparison, performance, etc. It will be interesting to see how it turns out.

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

                            @mattyl42 try this noshader.glslp file: https://drive.google.com/open?id=1uKXfT0wzUSRx3V2-FSraPDpOk_R5TkeE

                            place it in your /opt/retropie/configs/all/retroarch/shaders/ directory and try :)

                            M 1 Reply Last reply Reply Quote 1
                            • herb_fargusH
                              herb_fargus administrators @MattyL42
                              last edited by herb_fargus

                              @mattyl42 I imagine it would as simple as setting a hotkey to enable the shader, then just configuring your button to that hotkey, but that assumes that's a function of retroarch, I don't use shaders so I don't know but that's personally how I'd do it if it were a thing

                              Edit ignore: for some reason my phone didn't render any replies so I didn't see anyone had already answered

                              If you read the documentation it will answer 99% of your questions: https://retropie.org.uk/docs/

                              Also if you want a solution to your problems read this first: https://retropie.org.uk/forum/topic/3/read-this-first

                              1 Reply Last reply Reply Quote 0
                              • M
                                MattyL42 @dankcushions
                                last edited by MattyL42

                                @dankcushions Great that's got it thank you very much!! Your 'noshaders .glsl works! Was it hard to make? I'd just started reading up on opengl but probably would have taken me a while to work out how to do it haha...i saw it was only 13bytes?

                                I have 2 switches mounted to the same button which is just a spare IL concave button un-fitted for testing purposes at the moment and the system is working. I can confirm it alternates between the active shader and no shader giving a retro on-off impression which I think is really neat. I've ordered some I hope fairly old skool looking illuminated buttons and I'm going to try and get the one of choice attracting by flashing/steady on next. I want friends etc to say "ohh what's this.... cool!"

                                Thank you all for the help and teachings :)

                                dankcushionsD 1 Reply Last reply Reply Quote 2
                                • dankcushionsD
                                  dankcushions Global Moderator @MattyL42
                                  last edited by

                                  @mattyl42 great! not hard at all - the noshaders.glslp file is one line saying shaders = "0" so no shader is loaded :) i didn't think it would work!

                                  that's a really cool setup - when you're done make sure you post photos in the projects and themes forum :)

                                  RionR 1 Reply Last reply Reply Quote 0
                                  • RionR
                                    Rion @dankcushions
                                    last edited by

                                    Better late then never I suppose

                                    https://github.com/libretro/RetroArch/pull/14628

                                    FBNeo rom filtering
                                    Mame2003 Arcade Bezels
                                    Fba Arcade Bezels
                                    Fba NeoGeo Bezels

                                    1 Reply Last reply Reply Quote 1
                                    • 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.