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

    Teach me the basics of using Shaders in Libretro emulators

    Scheduled Pinned Locked Moved Help and Support
    shaderspassesfilterscalelibretro
    7 Posts 4 Posters 3.4k 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.
    • G
      goodpi31
      last edited by goodpi31

      Helloo! Currently I'm experimenting a bit with shader settings. I've read the article on the wiki and searched the forum, but I'm not 100% sure about these questions. If anyone could answer these questions or point me to a related article, it be much appreciated!

      1 Can I use a shader to get a game to run faster?
      2 What exactly are shader passes? Currently I'm using only one..... is that good? Should I use two? or more?
      3 The default filter setting, what exactly does this do? Linear and nearest?
      4 And finally the shader scale? I'm guessing its how big the shader effect looks, but it doesn't seem to visibly change anything with the shaders I've tried?

      Thanks

      Using
      Pi Model: Pi 3 - Model B
      RetroPie Version Used: 4.1.19
      Built From: Pre-made image on official RetroPie website + then updated through setup
      USB Devices connected: 2x Bluetooth PS3 controller
      Controller used: 2x PS3 Controller
      Guide used: https://retropie.org.uk/docs/Shaders-and-Smoothing/#shaders
      Emulator: All Libretro emulators

      caver01C dankcushionsD 2 Replies Last reply Reply Quote 0
      • caver01C
        caver01 @goodpi31
        last edited by caver01

        @goodpi31 I am by no means an expert, but I think I can answer #1: It is unlikely that a shader would ever actually make a game run faster, as it is asking the computer to do more than it would without the shader. It may not always slow a game down, depending on what the specific calculations are and whether there is any processing headroom or memory access performance constraints.

        #2, my understanding is that passes are effectively the number of times the image is processed. More passes would be like layering multiple shader effects.

        Without much digging I found a guide to OpenGL Shading Language that you might find interesting. I suggest looking for similar resources, as you are basically asking about OpenGL programming details.

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

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

          @goodpi31 said in Teach me the basics of using Shaders in Libretro emulators:

          Helloo! Currently I'm experimenting a bit with shader settings. I've read the article on the wiki and searched the forum, but I'm not 100% sure about these questions. If anyone could answer these questions or point me to a related article, it be much appreciated!

          1 Can I use a shader to get a game to run faster?

          no. shaders change each frame after it has been rendered by the emulator. they will only ever slow it down (although the crt-pi shader should be light enough that an RPI3 can do all the operations before the next frame, so no slow anything down)

          2 What exactly are shader passes? Currently I'm using only one..... is that good? Should I use two? or more?

          usually you'd load a shader preset (.glslp) file which has a preset configuration of the number of passes of different shader scripts. don't manually set each pass unless you know exactly what you're doing. a typical 'shader' is a .glslp preset containing one or more passes of one or more shaders.

          3 The default filter setting, what exactly does this do? Linear and nearest?

          again, the glslp file will have the setting for this.

          4 And finally the shader scale? I'm guessing its how big the shader effect looks, but it doesn't seem to visibly change anything with the shaders I've tried?

          again i wouldn't change this :)

          G 1 Reply Last reply Reply Quote 1
          • G
            goodpi31 @dankcushions
            last edited by goodpi31

            @dankcushions @caver01 thanks!

            Doh! I completely missed the preset files. Thanks for pointing that out. Those are much more userfriendly. I found one that I like for the SNES but after applying changes and restarting the emulator the changes are gone.

            Do I need to 'save core preset' or 'save game preset' before closing the game? I havent tried it, cause I dont want to f* something up.

            Also, any shader recommendations for the PSX system?

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

              @goodpi31 instructions for choosing and saving shaders are on the wiki page in the first post :)

              Also, any shader recommendations for the PSX system?

              i use crt-pi for some psx games.

              G 1 Reply Last reply Reply Quote 0
              • G
                goodpi31 @dankcushions
                last edited by

                @dankcushions got it to work, thanks :D

                1 Reply Last reply Reply Quote 0
                • Z
                  Zigurana
                  last edited by

                  Re. speed gains :
                  What about running games at low resolutions, but then using shaders to make it look acceptable? Or do the shaders always run at the emulated resolution?

                  If tetris has thought me anything, it's that errors pile up and that accomplishments dissappear.

                  1 Reply 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.