kwin-effect-shaders icon indicating copy to clipboard operation
kwin-effect-shaders copied to clipboard

Can this use arbitrary GLSL shaders?

Open parkerlreed opened this issue 2 years ago • 2 comments

You have scratched an itch I have been having for a long time now.

Successfully got this project setup and working on a Steam Deck using Plasma 5.26.

My dream is to use the RetroArch GLSL CRT shaders for a "retro" look on the desktop.

Is it possible to use GLSL shaders as they are?

https://github.com/libretro/glsl-shaders/tree/master/crt/shaders

parkerlreed avatar Mar 05 '23 05:03 parkerlreed

They require a bit of modification unfortunately (although for the most part it's pretty simple to convert).

In the 2_main.frag file, I commented some of the libretro variable names to make it easier to port them:

https://github.com/kevinlekiller/kwin-effect-shaders_shaders/blob/main/2_main.frag#L20

Here's an example of a fragment shader ported:

https://github.com/libretro/glsl-shaders/blob/master/cel/shaders/advcartoon.glsl#L86 -> https://github.com/kevinlekiller/kwin-effect-shaders_shaders/blob/main/AdvancedCartoon.frag

And a vertex shader:

https://github.com/libretro/glsl-shaders/blob/master/cel/shaders/advcartoon.glsl#L8 -> https://github.com/kevinlekiller/kwin-effect-shaders_shaders/blob/main/AdvancedCartoon.vert

The settings are in the 1_settings.glsl file: https://github.com/kevinlekiller/kwin-effect-shaders_shaders/blob/main/1_settings.glsl.example#L107

The function prototype and the execution of the function are done in the 2_main files conditionally based on the 1_settings.glsl file.

kevinlekiller avatar Mar 06 '23 00:03 kevinlekiller

Hi, maybe can you add this to your project ?

https://docs.rs/librashader/latest/librashader/

This add support for retroarch shaders because it's implements the entire retroarch pipeline.

charmandercha avatar Mar 29 '23 00:03 charmandercha