Homepage Forums RetroPie Project Video Output on RetroPie GameBoy Shaders?

  • This topic has 35 replies, 11 voices, and was last updated 9 years ago by k4r7u.
Viewing 35 posts - 1 through 35 (of 36 total)
  • Author
    Posts
  • #90289
    Anonymous
    Inactive

    Is there any shaders that replicate the GB display that dont effect performance on the RPi for the Gameboy emulator?

    #90303
    Roo
    Participant

    No. 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

    #90305
    Floob
    Member

    Thanks to Roos suggested config, I’ve had a go, and think these overlays look pretty good.
    http://dai.ly/x2is5kt

    Here 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"
    #90329
    Roo
    Participant

    Hi floob, haven’t seen you for a while :) nice video!

    #90406
    Anonymous
    Inactive

    is there a way to add the ‘pea green’ colour to the screen though?

    #90411
    Roo
    Participant

    I 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.

    #90433
    Floob
    Member

    [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:

    Convert CG Shader to GLSL ?

    #90439
    Roo
    Participant

    [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

    http://emulation-general.wikia.com/wiki/Shaders_and_Filters

    #90491
    gizmo98
    Participant
    #90527
    Roo
    Participant

    [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!

    #90529
    gizmo98
    Participant

    Some 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.

    #90533
    Roo
    Participant

    It’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.

    #90539
    Roo
    Participant

    ok, 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… :(

    #90559
    Floob
    Member

    Thanks 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/resources

    Did 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).

    #90570
    Roo
    Participant

    Yes, Pi 2 model B, overclocked to “Pi2” setting. It’s lagging just enough to be annoying. Can you see it in this comparison?

    http://youtu.be/PtkMgs7sk-E

    #90572
    Floob
    Member

    Yes, it does seem a little sluggish. Can you turn the FPS monitor on via RGUI? Does it differ from 30fps on the gb-shader ?

    #90573
    Roo
    Participant

    I 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

    #90592
    Anonymous
    Inactive

    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

    #90608
    Floob
    Member

    [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/

    #90639
    Anonymous
    Inactive
    #90669
    Floob
    Member

    [quote=90639]Here you go

    https://www.dropbox.com/s/xqd4crkihlpfidl/Nintendo%20Handhelds.rar?dl=0

    [/quote]
    They look great, thanks very much.

    #90792
    koffieleut
    Participant

    I 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.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”

    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.glsl

    scale_type0 = viewport
    scale0 = 1

    scale_type1 = source
    scale1 = 1

    scale_type2 = source
    scale2 = 1

    scale_type3 = source
    scale3 = 1

    scale_type4 = source
    scale4 = 1

    filter_linear0 = false
    filter_linear1 = false
    filter_linear2 = false
    filter_linear3 = false
    filter_linear4 = false

    textures = COLOR_PALETTE;BACKGROUND
    COLOR_PALETTE = resources/palette.png
    COLOR_PALETTE_linear = false
    BACKGROUND = resources/background.png
    BACKGROUND_linear = true

    I 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

    #90811
    Floob
    Member

    Do 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.png

    It could be easier for you to drop the paths above and just put the files in the same directory.

    #90824
    koffieleut
    Participant

    Yes 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

    #90902
    Floob
    Member

    Where 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.

    #91003
    koffieleut
    Participant

    the 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.

    #91010
    Floob
    Member
    #91178
    muriani
    Participant

    Whooowee, 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.

    #99833
    footwo
    Participant

    [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?

    #99866
    footwo
    Participant

    nvm 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.

    #100868
    Anonymous
    Inactive

    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?

    #109407
    LodanZark
    Participant

    [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

    #109766
    gizmo98
    Participant

    @LodanZark
    Update retroarch. There is a gameboy shader in the main shader directory now.

    #109816
    dustloop
    Participant

    For 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

    #111004
    Dinofly
    Participant

    Hi,

    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 ?

Viewing 35 posts - 1 through 35 (of 36 total)
  • The forum ‘Video Output on RetroPie’ is closed to new topics and replies.