Another fast CRT shader

I made a fast CRT shader that combines the mask and curvature effects from CRT-Lottes with simple scanlines. I don’t have a RPi handy to do any actual benchmarking, but I get about 450 fps on my Sandy Bridge HD3000 integrated graphics. That’s about 10% slower than default CRT-Pi, but commenting either the mask or curvature options makes it run a little faster than CRT-Pi at default settings. Importantly, it should look pretty decent at non-integer scales.

It also has an option (commented out by default) to turn the scanlines vertical for TATE orientation.

The shader is called ‘fakelottes’ and is only available in glsl format at the moment. Here’s a shot of it at 3x scale:

I’m curious to hear how it runs on an actual RPi, if anyone has a chance to test it out.

13 Likes

Just tested it quickly, seems to run at full speed on the RPi.

1 Like

@hunterk: tested this on my Pi3. Works very good once I comment out the curvature and mask stuff! (Note I use double-buffering for low latency so my Pi has less CPU/GPU time!) To be able to get perfect scanlines (no patterns, etc) with uneven scaling, I changet these settings:

Scanline intensity: 0.10 Scanline Base Brightness: 0.98 Monitor gamma: 2.50

Of course, scanlines are not visible anymore on all-white screens, but who caes :smiley:

Also, are you sure it’s faster than crt-pi with curvature OR mask stuff disabled? Don’t you mean AND there? Thanks for this!

The only benchmarking I was able to do is on desktop GPUs, which have different bottlenecks and performance concerns than mobile GPUs. On my HD3000, it was slightly faster than crt-pi with either of them commented.

With both commented, it’s basically just misc/scanline.glsl, so you’re probably better off just using it directly :stuck_out_tongue:

Ahh! Thanks, hunterk. Now I understand!

Curvature is nice to play with, but it’s not fullspeed on my non-overclocked PI3, causing small hiccups once in a while (as I said, I am on double-buffered graphics). Maybe overclocking the GPU I could avoid those while keeping curvature. I’ll have to experiment :slight_smile:

I love this shader, it works very well with all the cores in a low-end gpu. They should add it in upcoming Lakka updates.

1 Like

I really like this shader :slightly_smiling_face: It’s possible add some bloom effect?

Not without wrecking performance, unfortunately.

1 Like

Fake lottes is by far the best shader for low end computers like my 2009 macbook. Thanks as usual, hunter!

1 Like

It also runs full speed on an old windows XP laptop, dual core, GMA x4500. Also runs full speed crt-pi, zfast-crt if anyone is interested. Personally i prefer crt-pi on that screen, looks better on 720p.

1 Like

For some reason, ‘fakelottes’ (version that is bundled with the latest Lakka) wrecks the perfomance of the Genesis Plus GX core (while both crt-pi and crt-nes-mini work just fine) on RPi 4. Can anyone suggest why that may be the case?

hi where can i get this shader, wanna try

It should be with the rest of the shaders. [shader dir]/crt/fakelottes

Hi hunterk: i think i have found an error in fakelottes.

    //vec2 omega = vec2(3.1415 * OutputSize.x, 2.0 * 3.1415 * TextureSize.y);
    vec2 omega = vec2(3.1415 * OutputSize.x, 3.1415 * OutputSize.y)

i only get sideways scanlines with my change. (texturesize->outputsize)

[EDIT] knowing full well i may have misunderstood what SCANLINE_SINE_COMP_B was intended to do… But on my box, it just brightens/darkens the image with fakelottes on my Jetson Nano.

My variant is here if anyone wants to check out the horizontal scanline action and maybe tell me what I have misunderstood, if anything.

fastlottes.glsl

Thanks - cheers

fakelottes: 9.9% gpu on Jetson Nano fastlottes: 8.0% gpu on Jetson Nano

I’m loving this shader @hunterk Does it turn vertical automatically with certain cores?

I don’t understand the option for turning vertical being ‘commented out by default’

How do a verticalise it in Retroarch?

Thanks.

open the shader file (crt/shaders/fakelottes.slang) in a text editor and delete the // in front of this line:

2 Likes

Hello, I try to improve performance of this shader in my GPD XD (which use gl graphics only) : please, is there any parameter I can remove to improve the performance and keeping the grid as it is ? So far, my GPD XD is getting really hot while playing with this shader. Thank you very much for your kind help

The mask is the part that uses the most resources. You can comment that out, but that’s about it.

1 Like

I hope to try and feedback the results, a big thanks for your help !

1 Like