Raspberry Pi friendly CRT shader

[I][B]OK thanks!

I think then that you can not do better on Raspberry …[/B][/I]

Imho there’s no need for any better crt-shader. In my case it looks nearly exactly the same as my old consoles connected to my old CRT via RGB cable.

Dave J.

There are quite alot of Vector based games for both Mame/Mess and Vectrex.

Is it possible and would you consider making a Pi friendly Vector based shader?

Ps have a look here what John Merrit created http://libretro.com/forums/showthread.php?t=5085&p=50265&viewfull=1#post50265

Edit: followup separate thread http://libretro.com/forums/showthread.php?t=7414

[QUOTE=Rion;50306]Dave J. There are quite alot of Vector based games for both Mame/Mess and Vectrex.

Is it possible and would you consider making a Pi friendly Vector based shader? [/QUOTE] It’s not clear what you’d want from a vector based shader. If it’s just applying overlays by a shader, there’s little point. If it’s upscaling a low resolution image to make the vector lines look better, that’s not the sort of thing the Pi’s GPU would be good at and there are better solutions for that in any case.

Have you seen the How to make vector arcade games look their best thread on the retropie forum?

Hi again.

Yes i have read that thread and sadly it’s only for AdvanceMAME 1.4 and that is not a libretro core so no overlay support or shader support.

Maybe what I’m asking for is not possible using the pi with a shader?

What I’m looking for is more up the alley what mame does with HLSL.

I know Vector games did not have scanlines and shadowmasks were only present on color vector games, and should not be used on monochrome vector games.

Maybe i can mimic some of the effect using crt-pi-curvate by using custom setting inside the shader?

Do you have any advice what to change by using Mame’s HLSL Information from here http://docs.mamedev.org/advanced/hlsl.html#vector-games

[QUOTE=Rion;50319] Maybe what I’m asking for is not possible using the pi with a shader?

What I’m looking for is more up the alley what mame does with HLSL.

I know Vector games did not have scanlines and shadowmasks were only present on color vector games, and should not be used on monochrome vector games.

Maybe i can mimic some of the effect using crt-pi-curvate by using custom setting inside the shader?[/quote] You can turn scanlines off (put // at the start of the #define SCANLINES line in one of the the crt-pi____.glsl files).

A word of warning though: The memory bandwidth (how quickly it can read and write memory) on the Pi is very limited and crt-pi upscaling a typical source screen (say 256x224) for a HD screen (to 1440x1080) uses so much of it it can cause problems when running complicated games. Having a larger source screen, which you would want for vector games to make the lines look good, is very likely to be too much for the system to cope with. The first example image from that retropie thread is probably big enough to cause problems and it doesn’t even look very good.

Do you have any advice what to change by using Mame’s HLSL Information from here http://docs.mamedev.org/advanced/hlsl.html#vector-games

I don’t have any experience of that so can’t give any advice.

I don’t think the Pi is fast enough to do what you want with the software that is available now. If somebody were to port the hardware accelerated vector drawing from AdvanceMAME into a libretro core, and preferably add screen curvature to that, that will be a different matter but for now, it’s not practical.

Can this be downloaded from the updater? That would be awesome!

It’s in the glsl shaders available via the updater.

Ahh found it. Loading as a preset under the Android Shield TV doesnt seem to work. Looks like a sweet plugin though.

Looks like the Shield ATV wants everything to have the precision declared >.>

Try this version (works on mine, so should work on yours, too): https://github.com/hizzlekizzle/glsl-shaders/blob/master/crt/shaders/crt-pi.glsl

Awesome! Looks great. Anyway to get this in the main repo?

[QUOTE=hunterk;51020]Looks like the Shield ATV wants everything to have the precision declared >.>

Try this version (works on mine, so should work on yours, too): https://github.com/hizzlekizzle/glsl-shaders/blob/master/crt/shaders/crt-pi.glsl[/QUOTE] It’s probably better to specify a default precision rather than have precision qualifiers scattered throughout the code. Does the attached version work on the Shield ATV?

@phin586 You were asking about BVM/PVM style shaders in another thread. Try crt-pi with SHARPER enabled.

It should be in the main repo now. If you use the online updater to fetch the glsl shaders, it should pull that version down as well.

Awesome! Thanks for all of the help!

can someone please upload the rest of updated crt pi shaders? the one that has crt pi curvature in it. Thanks

Just wanted to say thanks for writing this shader! Works great on my Intel NUC, a NUC6CAYS. This shader could also be called “crt-lite” since it runs perfectly on many low-powered platforms.

However, I’ve had some trouble enabling SHARPER because I haven’t been able to figure out how to get the cg2glsl script to run. I think I’m just not skilled enough to figure it out. I’m using Windows 10, downloaded the latest Python release and the CG toolkit. I understand the syntax is something like “py filepath-to-cg2glsl.py old-shader.cg new-shader.glsl” When I try this I keep getting syntax errors, which makes sense because I have no idea what I’m doing :stuck_out_tongue:

I was wondering if you (or anyone) could please list the steps needed to edit the cg shader and convert it to glsl in Windows 10? I tried looking online but found very little information on this. Thanks again to dave_j for this very useful shader :slight_smile:

There’s no Cg involved. It was written in native GLSL.

Hey Hunter! Been a while. Thanks for keeping up the good work :slight_smile:

When I open crt-pi.glslp in Notepad, this is what I get:

shaders = “1” shader0 = “shaders/crt-pi.glsl” filter_linear0 = “true” wrap_mode0 = “clamp_to_border” mipmap_input0 = “false” alias0 = “” float_framebuffer0 = “false” srgb_framebuffer0 = “false”

Which looks radically different from what I see here:

With cg shaders, I could just open the file using Notepad and alter/add/remove settings directly. I’m not sure how to edit glsl shaders using Notepad, or if that’s even possible.

You need to edit the glsl file not the glslp one.

Remove the // from the beginning of the //#define SHARPER line to enable it.

Awesome, thanks! Didn’t realize there were two separate files for each shader. Got it working now and it looks great :slight_smile: