Crt Shaders Button On/off?
-
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 :)
-
Would this be possible?
-
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?
-
@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.
-
@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 forinput_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!
-
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?
-
@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 theautoconfig
folder. -
@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/rpiessentially, 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.
-
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 :)
-
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? -
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.
-
@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 :) -
@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
-
@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 :)
-
@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 :)
- topic:timeago-later,5 years
-
Better late then never I suppose
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.