Homepage › Forums › RetroPie Project › Video Output on RetroPie › GameBoy Shaders?
- This topic has 35 replies, 11 voices, and was last updated 8 years, 11 months ago by k4r7u.
-
AuthorPosts
-
03/05/2015 at 21:13 #90289AnonymousInactive
Is there any shaders that replicate the GB display that dont effect performance on the RPi for the Gameboy emulator?
03/05/2015 at 22:15 #90303RooParticipantNo. All shaders come with a performance hit. That said, I use the bead shader and an overlay and it runs at full speed, I don’t notice any lagging on a RPi 2 model B. I messed with shaders on the older B+ before the 2 came out and I found that the older Pi’s just didn’t have enough processor power to run the emulator and add shaders on top.
Here’s my /opt/retropie/configs/gb/retroarch.cfg for 1920 x 1200 resolution
# All settings made here will override the global settings for the current emulator core video_shader_enable = true video_shader = /opt/retropie/emulators/retroarch/shader/bead.glsl input_overlay_enable = true input_overlay = /opt/retropie/emulators/retroarch/overlays/gb.cfg input_overlay_opacity = 0.70 input_overlay_scale = 1.0 aspect_ratio_index = "22" custom_viewport_width = "645" custom_viewport_height = "648" custom_viewport_x = "637" custom_viewport_y = "275"
and here’s a cfg that works for 1920 x 1080 (1080p) resolution
# All settings made here will override the global settings for the current emulator core video_shader_enable = true video_shader = /opt/retropie/emulators/retroarch/shader/bead.glsl input_overlay_enable = true input_overlay = /opt/retropie/emulators/retroarch/overlays/gb.cfg input_overlay_opacity = 0.70 input_overlay_scale = 1.0 aspect_ratio_index = "22" custom_viewport_width = "642" custom_viewport_height = "581" custom_viewport_x = "638" custom_viewport_y = "248"
I’m using the overlays from http://retroarchborders.blogspot.com
03/05/2015 at 23:52 #90305FloobMemberThanks to Roos suggested config, I’ve had a go, and think these overlays look pretty good.
http://dai.ly/x2is5ktHere is my config:
video_shader_enable = true video_shader = /opt/retropie/emulators/retroarch/shader/bead.glsl input_overlay_enable = true input_overlay = /opt/retropie/emulators/retroarch/overlays/gb.cfg input_overlay_opacity = 0.70 # 1.0 input_overlay_scale = 1.0 aspect_ratio_index = "22" custom_viewport_width = "432" custom_viewport_height = "389" custom_viewport_x = "423" custom_viewport_y = "165"
03/06/2015 at 04:46 #90329RooParticipantHi floob, haven’t seen you for a while :) nice video!
03/06/2015 at 21:38 #90406AnonymousInactiveis there a way to add the ‘pea green’ colour to the screen though?
03/06/2015 at 22:09 #90411RooParticipantI have not found a RetroArch shader in RetroPie that has the puke green color of the original GB.
On my Windows PC, the RetroArch shader “gb-shader.cgp” is a really nice shader for GB, complete with puke green color. But cgp shaders are not compatible with RetroArch on Pi which uses *.glsl shaders. I read somewhere they can be converted, but it never bothered me enough to spend the time to figure out how.
03/06/2015 at 23:32 #90433FloobMember[quote=90329]Hi floob, haven’t seen you for a while nice video![/quote]
Thanks, I’ve just extended it.
Also, looks like conversion steps are here:03/06/2015 at 23:53 #90439RooParticipant[quote=79662]It is necessary to convert cg shaders to glsl shaders. To do this you need the nvidia cg toolkit. The toolkit is only available for x86 platforms. So you need a ubuntu live cd and a PC to convert a shader.
If everything is installed download and run cg2glsl.py:
https://github.com/libretro/RetroArch/blob/master/tools/cg2glsl.py
[/quote]
Yep – that’s where I read about converting cgp to glsl. I gave up when I saw that it required a Ubuntu x86 desktop :) I figured after a bunch of work, I would just end up with an over-aggressive shader for the Pi’s limited resources.
I don’t know much about cgp vs glsl…? Is it just the difference between linux and windows retroarch installations?
Edit – I see now. glsl is the standard for arm-based libretro
03/07/2015 at 14:02 #90491gizmo98ParticipantSurprise surprise!
https://github.com/retropie/RetroPie-Setup/pull/72203/07/2015 at 19:57 #90527RooParticipant[quote=90491]Surprise surprise!
https://github.com/retropie/RetroPie-Setup/pull/722
[/quote]That’s awesome gizmo98, thanks for converting them all!
I downloaded them to my pi, set owner and group to pi, set them all as executable, and pointed RA to them. Some work, some don’t.
For example, I updated /opt/retropie/configs/all/retroarch.cfg
video_shader_dir = /opt/retropie/emulators/retroarch/convertedshaders
And /opt/retropie/configs/gb/retroarch.cfg
video_shader = /opt/retropie/emulators/retroarch/convertedshaders/handheld/gameboy/gb-shader.glslp
But when I launch RA, I get this:
pi@retropie ~ $ /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/gbclibretro/gambatte_libretro.so --config /opt/retropie/configs/all/retroarch.cfg --appendconfig /opt/retropie/configs/gb/retroarch.cfg "/home/pi/RetroPie/roms/gb/Tetris (World) (Rev A).gb" RetroArch: rarch_log_libretro: [libretro INFO] :: Plain ROM loaded. RetroArch: rarch_log_libretro: [libretro INFO] :: cgb: 0 RetroArch: rarch_log_libretro: [libretro INFO] :: rambanks: 0 RetroArch: rarch_log_libretro: [libretro INFO] :: rombanks: 2 RetroArch: rarch_log_libretro: [libretro INFO] :: [Gambatte]: Got internal game name: TETRIS. RetroArch [ERROR] :: compile_program :: Failed to link program #0. RetroArch [ERROR] :: compile_programs :: Failed to create GL program #0. RetroArch [ERROR] :: gl_shader_init :: [GL]: Failed to initialize shader, falling back to stock. RetroArch [WARN] :: gl_glsl_init :: [GL]: Stock GLSL shaders will be used.
Maybe I’m missing something? But I’m thinking the convert script didn’t work on this one… I looked at the glsl code, but I don’t see anything that stands out. I’m a pretty noob programmer though.
So close! I’m really hoping we can all work together to figure this out :) RetroPie would rock with some nicer shaders!
03/07/2015 at 20:27 #90529gizmo98ParticipantSome do not work because the raspy gpu is not capable. I strongly recommend using RGUI for shader experiments because ini file editing takes too long.
I have tested some blur, eagle, sai, pixilation and crt shaders. Only some gameboy shaders are running fine.
03/07/2015 at 20:44 #90533RooParticipantIt’s actually much easier and faster for me to modify the cfg files :) To each their own.
Just FYI, there was some issue with finding the files before. I was able to get around that by pointing RA directly to the full path. Here’s where I’m at now.
/opt/retropie/configs/gb/retroarch.cfg
# All settings made here will override the global settings for the current emulator core video_shader_enable = true video_shader_dir = /opt/retropie/emulators/retroarch/convertedshaders/handheld/gameboy video_shader = gb-shader.glslp
and when I launch RA i get this
pi@retropie ~ $ /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/gbclibretro/gambatte_libretro.so --config /opt/retropie/configs/all/retroarch.cfg --appendconfig /opt/retropie/configs/gb/retroarch.cfg "/home/pi/RetroPie/roms/gb/Tetris (World) (Rev A).gb" RetroArch: rarch_log_libretro: [libretro INFO] :: Plain ROM loaded. RetroArch: rarch_log_libretro: [libretro INFO] :: cgb: 0 RetroArch: rarch_log_libretro: [libretro INFO] :: rambanks: 0 RetroArch: rarch_log_libretro: [libretro INFO] :: rombanks: 2 RetroArch: rarch_log_libretro: [libretro INFO] :: [Gambatte]: Got internal game name: TETRIS. RetroArch [ERROR] :: gl_glsl_init :: [GL]: Failed to parse GLSL shader. RetroArch [ERROR] :: gl_shader_init :: [GL]: Failed to initialize shader, falling back to stock. RetroArch [WARN] :: gl_glsl_init :: [GL]: Stock GLSL shaders will be used.
I still say the conversion script didn’t work on this shader due to “gl_glsl_init :: [GL]: Failed to parse GLSL shader.”
[quote=90529]Some do not work because the raspy gpu is not capable. … I have tested some blur, eagle, sai, pixilation and crt shaders. Only some gameboy shaders are running fine.[/quote]
Have you got any of the converted multipass shaders to work (glslp vs glsl)? I’ve only spot checked a few, but I have yet to see any of these working.
03/07/2015 at 21:46 #90539RooParticipantok, I’ve hacked up a solution
I found that convertedshaders/handheld/gameboy/shader-files/gb-pass-1.glsl through 4 were working. gb-pass-0.glsl is the one that gives RA fits.
According to the author’s git page https://github.com/HarlequinVG/shaders/tree/master/gameboy_shader, pass 0 is for the dot-matrix screen of the GameBoy.
Then I noticed that convertedshaders/handheld/dot.glsl was working :) So I substituted dot.glsl for gb-pass-0.glsl as the 1st pass in gb-shader.glslp
I’ve attached my files for anyone who likes the results. Copy “dot.glsl” and “gb-shader.glslp” from the attached zip to /opt/retropie/emulators/retroarch/shader (overwrite the originals), set the files as executable, and change owner and group to pi.
Then with this /opt/retropie/configs/gb/retroarch.cfg you should be set
# All settings made here will override the global settings for the current emulator core video_shader_enable = true video_shader = /opt/retropie/emulators/retroarch/shader/gb-shader.glslp input_overlay_enable = true input_overlay = /opt/retropie/emulators/retroarch/overlays/gb.cfg input_overlay_opacity = 0.70 input_overlay_scale = 1.0 aspect_ratio_index = "22" custom_viewport_width = "642" custom_viewport_height = "581" custom_viewport_x = "638" custom_viewport_y = "248"
The picture doesn’t do it justice. It a nice simulated dot matrix grid pattern with a lovely puke green color.
[edit] after some more testing, I’ve noticed it does lag a bit… :(
03/08/2015 at 00:30 #90559FloobMemberThanks so much for the conversions! I’ve put an updated video up here (on a B+):
I played about with the setup a bit as I’ve only pulled down the shaders I was after, I’m not too sure this would be straightforward for some users though.
I think the easiest way would be to follow Roos instructions above (and use his edited files), although I think you will also need to get the 4 shader files (not 0) here https://github.com/gizmo98/RetroPie-Setup/tree/7fa6d471361ff882bcfb2bdc11e20e4b438ef064/supplementary/RetroArchShader/handheld/gameboy/shader-files
As well as putting the 2 png files here in your working (shader) directory:
https://github.com/gizmo98/RetroPie-Setup/tree/7fa6d471361ff882bcfb2bdc11e20e4b438ef064/supplementary/RetroArchShader/handheld/gameboy/resourcesDid you test yours on a Pi2 Roo?
It seems the framerate drops from 60 to 30 when the gb-shader is used (on a B+ at High overclock).03/08/2015 at 01:35 #90570RooParticipantYes, Pi 2 model B, overclocked to “Pi2” setting. It’s lagging just enough to be annoying. Can you see it in this comparison?
03/08/2015 at 01:59 #90572FloobMemberYes, it does seem a little sluggish. Can you turn the FPS monitor on via RGUI? Does it differ from 30fps on the gb-shader ?
03/08/2015 at 02:35 #90573RooParticipantI dunno what secret sauce you’re pouring on your Pi B+…
I’m getting around 45 FPS with just dot.glsl and around 13 FPS with gb-shader.glslp on a Pi2 OC’d to Pi2 setting
03/08/2015 at 11:19 #90592AnonymousInactiveGreat work!!. If anyone interested I’ve made numerous GB, GBC and GBA system overlays from pictures found on the web, I’ll upload them later
03/08/2015 at 13:14 #90608FloobMember[quote=90592]Great work!!. If anyone interested I’ve made numerous GB, GBC and GBA system overlays from pictures found on the web, I’ll upload them later[/quote]
Would be good to see those, the handhelds do look good with these overlays.
Even if it does seem to open a can of worms about exactly what resolution these should be played in :)I used these that Roo pointed to:
http://retroarchborders.blogspot.com/03/08/2015 at 16:45 #90639AnonymousInactive03/08/2015 at 19:30 #90669FloobMember[quote=90639]Here you go
https://www.dropbox.com/s/xqd4crkihlpfidl/Nintendo%20Handhelds.rar?dl=0
[/quote]
They look great, thanks very much.03/09/2015 at 20:51 #90792koffieleutParticipantI just can’t get the shader to work.
I followed everything on this topic, used all the files and edited my gb cfg file.cfg file:
video_shader_enable = true
video_shader = /opt/retropie/emulators/retroarch/shader/gb-shader.glslpinput_overlay_enable = true
input_overlay = /opt/retropie/emulators/retroarch/overlays/gb.cfg
input_overlay_opacity = 0.70
input_overlay_scale = 1.0aspect_ratio_index = “22”
custom_viewport_width = “642”
custom_viewport_height = “581”
custom_viewport_x = “638”
custom_viewport_y = “248”here is the gb-shader.glslp file:
shaders = 5
shader0 = shader-files/dot.glsl
shader1 = shader-files/gb-pass-1.glsl
shader2 = shader-files/gb-pass-2.glsl
shader3 = shader-files/gb-pass-3.glsl
shader4 = shader-files/gb-pass-4.glslscale_type0 = viewport
scale0 = 1scale_type1 = source
scale1 = 1scale_type2 = source
scale2 = 1scale_type3 = source
scale3 = 1scale_type4 = source
scale4 = 1filter_linear0 = false
filter_linear1 = false
filter_linear2 = false
filter_linear3 = false
filter_linear4 = falsetextures = COLOR_PALETTE;BACKGROUND
COLOR_PALETTE = resources/palette.png
COLOR_PALETTE_linear = false
BACKGROUND = resources/background.png
BACKGROUND_linear = trueI store my shaders in opt/retropie/emulators/retroarch/shader/
also in opt/retropie/emulators/retroarch/shader/shader-files/In both those folders are the png files and also in
opt/retropie/emulators/retroarch/shader/resources/If I just change the shader in the gb cfg file to dot.glsl it works but without the green color. I tried changing the shader option in the emulator itself by pressing hotkey + F1 > options > shaders, but that doesn’t do a thing.
I use a RPI1 model b
Please help me.
Cheers
03/09/2015 at 23:52 #90811FloobMemberDo these files and paths exist for you – as they are referenced in your file above?
shader-files/gb-pass-1.glsl (etc..)
resources/palette.png
resources/background.pngIt could be easier for you to drop the paths above and just put the files in the same directory.
03/10/2015 at 00:48 #90824koffieleutParticipantYes they all exist, another problem is when booted up a gameboy rom with the border on Retroarch keeps those settings for the other roms like Nes roms display in the bottom right corner of my tv screen until I change the ratio within retroarch.
Fixed the palette problem, but it can’t open the background.png strangely enough they are in the same folder.
Fixed2 ratio issue: forgot to put save per core on enable :s
03/10/2015 at 21:08 #90902FloobMemberWhere you state your “cfg file:” file above, that should be
/opt/retropie/configs/gb/retroarch.cfg
Is that where you have put the entries?Make sure the user pi has access to the files mentioned above as well.
03/11/2015 at 14:31 #91003koffieleutParticipantthe shaders are in /opt/retropie/emulators/retroarch/shader
and the retroarch.cfg is in the folder you have mentiont above.Can someone upload the background.png again?
It seems that some files will work and some don’t as in the palette.png wokrs but other palette files like dmg-palette-1.png doesn’t work.03/11/2015 at 15:21 #91010FloobMemberYou can grab the images you need here:
https://github.com/libretro/common-shaders/tree/master/handheld/gameboy/resources03/12/2015 at 22:36 #91178murianiParticipantWhooowee, wish I’d found this thread a couple of days ago.
I also did a manual conversion of the shaders and posted a .tar.gz here: http://www.kf5rsx.com/retroarch-quick-glsl-shader-recompile/
It’s basically the exact same thing gizmo93 put up on github, whoo!I’ll have to look closer at all this later, I’m really interested in getting good GB shaders too, as well as GBC. lcd-shader is ok, but looks better for something like Game Gear instead of GB/GBC IMO.
06/14/2015 at 19:23 #99833footwoParticipant[quote=90824]
Fixed the palette problem, but it can’t open the background.png strangely enough they are in the same folder.
[/quote]Sorry for necroing this thread but this has been driving me mad for two hours now. How did you fix the palette problem? No matter what I try I cannot get the colour to work. I’m using the modified files from roo above, but changed for my own purposes, plus i’ve made sure all the paths are correct and the palette.png file is in the right place. No matter what, when I start I get errors in the runcommand log:
RetroArch: rarch_log_libretro: [libretro INFO] :: [Gambatte]: Got internal game name: WIZARDS WARRIORS. RetroArch [WARN] :: resolve_extensions :: [GL]: GLES implementation does not have BGRA8888 extension. 32-bit path will require conversion. RetroArch [ERROR] :: compile_program :: Failed to link program #1. RetroArch [ERROR] :: compile_programs :: Failed to create GL program #1. RetroArch [ERROR] :: gl_shader_init :: [GL]: Failed to initialize shader, falling back to stock. RetroArch [WARN] :: gl_glsl_init :: [GL]: Stock GLSL shaders will be used. RetroArch [WARN] :: resolve_extensions :: [GL]: GLES implementation does not have BGRA8888 extension. 32-bit path will require conversion. RetroArch [ERROR] :: compile_program :: Failed to link program #1. RetroArch [ERROR] :: compile_programs :: Failed to create GL program #1. RetroArch [ERROR] :: gl_shader_init :: [GL]: Failed to initialize shader, falling back to stock. RetroArch [WARN] :: gl_glsl_init :: [GL]: Stock GLSL shaders will be used.
this is on retropie 3.0 BETA 3 on a pi2, using the stock emulator choice for gb.
Can anyone assist?
06/15/2015 at 01:00 #99866footwoParticipantnvm fixed it.
on 3.0 beta 3 its just a matter of copying dot.glsl into
/shader-files
and then editing the gb-shader.glslp thusly:shader0 = shader-files/dot.glsl
then set your shader as normal in retroarch.cfg, or using the in-emu retroarch gui menu.
06/28/2015 at 00:35 #100868AnonymousInactiveHow do you get glslp shader config to work with RetroPie??, i select ‘load shader preset’ and then select the glslp shader but nothing happens?
11/08/2015 at 20:40 #109407LodanZarkParticipant[quote=100868]How do you get glslp shader config to work with RetroPie??, i select ‘load shader preset’ and then select the glslp shader but nothing happens?
[/quote]
Yeah :( I am having the same issue
11/12/2015 at 19:31 #109766gizmo98Participant@LodanZark
Update retroarch. There is a gameboy shader in the main shader directory now.11/13/2015 at 08:37 #109816dustloopParticipantFor those having issues setting it up or not getting it working, I discovered last night in the QUICK MENU and CORE SETTINGS that in lr-gambette you can emulate GameBoy colors without shaders and still achieve practically the same effect of the muddy green color which is all I wanted and now I have achieved it :D
12/01/2015 at 11:53 #111004DinoflyParticipantHi,
Thanks for all the informations you provided in this topic. This was driving me mad for two weeks. But i’m curious: why bother including shaders in the Retropie distribution that are known to be crashing on the Raspberry Pi and Pi 2 ?
Couldn’t we just remove all the useless and misleading shaders that we cannot use ? -
AuthorPosts
- The forum ‘Video Output on RetroPie’ is closed to new topics and replies.