Crt-hyllian shader not loading on Android

Hi, I use the CRT-Hyllian shader on desktops, which looks great.

It was working in Android up until a few versions back. I assumed I had installed a different Retroarch version the last time I upgraded and perhaps that’s why it stopped working (32 vs 64 or something).

So, I installed all available versions in the Play Store, and also the various apk’s from here: https://buildbot.libretro.com/stable/1.17.0/android/

But none of the versions will load the crt-hyllian.glslp shader.

I get a “Failed to apply shader preset” error.

I tried re-downloading the Shaders but unfortunately it did not make a difference. Some of the other variations (glow) do not load either.

I am hoping someone may know how to fix it; I saved a log:

> [Shader driver]: Using GLSL shader backend.
> [GLSL]: Found GLSL vertex shader.
> [GLSL]: Found GLSL fragment shader.
> [GLSL]: Linking GLSL program.
> [GLSL]: Found GLSL vertex shader.
> [GLSL]: Using GLSL version 100.
> [GLSL]: Found GLSL fragment shader.
> [GLSL]: Using GLSL version 100.
> Shader log: ERROR: 0:196: '[' : Syntax error:  syntax error
> INTERNAL ERROR: no main() function!
> ERROR: 1 compilation errors.  No code generated.
> 
> 
> Failed to compile fragment shader #0
> Failed to link program #0.
> Failed to create GL program #0.
> [GL]: Stock GLSL shaders will be used.
> [GLSL]: Found GLSL vertex shader.
> [GLSL]: Found GLSL fragment shader.
> [GLSL]: Linking GLSL program.
> [GLSL]: Found GLSL vertex shader.
> [GLSL]: Found GLSL fragment shader.
> [GLSL]: Linking GLSL program.
> [GLSL]: Found GLSL vertex shader.
> [GLSL]: Found GLSL fragment shader.
> [GLSL]: Linking GLSL program.
> [GL]: Failed to set multipass shader. Falling back to stock.
> [Config]: Saved new configuration to "/storage/emulated/0/Android/data/com.retroarch/files/retroarch.cfg".
> [Core]: Content ran for a total of: 00 hours, 00 minutes, 04 seconds.
> [Runtime]: Saving runtime log file: "/storage/emulated/0/RetroArch/playlists/logs/Genesis Plus GX/Michael Jackson's Moonwalker (World) (Rev A).lrtl".
> [Core]: Unloading game..
> [Core]: Unloading core..
> [Core]: Unloading core symbols..
> [Core]: Saved core options file to "/storage/emulated/0/RetroArch/config/Genesis Plus GX/Genesis Plus GX.opt".
> [Video]: Average monitor Hz: 52.276648 Hz. (14.878 % frame time deviation, based on 2048 last samples).
1 Like

Well, the shader works on windows. So no syntax error I think. Looks like your glsl is only version 100.

The shader needs at least version 120.

I’ll look to see which term isn’t supported by version 100.

Hi, thanks, some of the other Hyllian variants do load:

  • multipass
  • fast
  • 3d

Perhaps those versions use an older GLSL version? Or perhaps my install is a bit messed up?

2 Likes

The only one loading on Android GLSL is “Hyllian-fast” i ported with HunterK some time ago from D3D (because i was using it on some older phones, GLES 2.00 or else “version 110” :stuck_out_tongue: ).

And yes it looks good, like a flat crt-geom. Which makes sense since it uses catmull which is almost the same with Lanczos.

2 Likes

I can confirm those not working are using resources only provided by glsl version 120.

For them to work on version 100, I’ll have to take out a bunch of mask code and revert to old green/magenta only mask. So, glsl will be centuries behind slang version.

Anyway, if that’s what is demanded, I’ll provide an old version to work on all potato android devices. :stuck_out_tongue:

3 Likes

Thanks :+1:

If you really want to that would be great, but there’s no demand :sweat_smile:

I was hoping it was a setting in Retroarch I could tweak.

My phone is from 2019, Xiaomi Redmi Note 7. I suppose it is getting on a bit now :older_man:

Adreno 512 is a GLES 3.1 device so it should run, but the problem is with gles quirks that require some things written it’s way. They still won’t run on a snapdragon 835 I have and that’s 3.1 too I think.

Multipass and 3d work too, just tested.

Try this simpler version: crt-hyllian.glsl

You only need to replace the shader, not the preset.

It’s using green/magenta mask now. Anyway, on a mobile I think the mask won’t make any difference on a tiny screen.

2 Likes

Thanks :smiley: Can you please tell me which directory the file needs to be placed into?

Here: shaders_glsl\crt\shaders\hyllian

Thanks, I think need root access? I tried adding those folder in the Retroarch folder (the shaders folders aren’t visible)

Now it goes beyond me. You need to know where Retroarch is installed and have access to its folders and files. I can’t help you on how to use your OS though.

No problem, thanks very much, I really appreciate your help and for sending the shader :+1:

I think I know where the file needs to go, but I need root access. I may have a way around it; if I find a method without root I’ll post it here :blush:

2 Likes

I think I see what’s up: the version directive needs to be on the very first line and it looks like they’re below your license block currently, so some drivers are going to give the highest GL they can and some will give the lowest (i.e., version 100).

1 Like

Unfortunately it didn’t work on my phone, even putting the version at the very first line.

My phone always fall back to version 100.

1 Like

Ok, so I got it to work :smiley:

First I downloaded the full pack of shaders from here https://buildbot.libretro.com/assets/frontend/

I expanded these on my desktop computer (takes way too long to expand on my phone).

I replaced the crt-hyllian.glsl file in the full pack with the one @Hyllian kindly posted above :+1:

You should find it here: /shaders_glsl/crt/shaders/crt-hyllian.glsl

I then copied the full pack (now modified) to a location on my external micro SD card where I have full access and placed it into my phone.

Then I edited the retroarch config file (make a backup first) found in:

/storage/emulated/0/Android/data/com.retroarch/files/retroarch.cfg

search the file for

video_shader_dir

then replace the part in quotes with the directory you placed the modified shaders e.g.:

video_shader_dir = "/storage/0000-0000/modified_shaders" (update with your directory)

I think this method could also be used to allow Retroarch access to other folders.

I hope this works for someone else :wink:

1 Like

Nice that it worked!

Here I just use some File Browser app on my android phone and I can see any files and folders. Just replace the shader and that’s it.

I wish it was that easy for me :sweat_smile:

I am enjoying Revenge of Shinobi with the shader :blush:

2 Likes

I actually want to know where to modify the path of shaders in the game, but it seems like I can’t find the configuration entry. Now I have to put the shaders in a path that requires root permission to write to.