Giter Club home page Giter Club logo

kde-shader-wallpaper's Introduction

FOR PLASMA6, CHECKOUT THE PLASMA6 BRANCH

KDE / Plasma - Shader Wallpaper plugin

Shader Wallpaper is a KDE/Plasma Wallpaper Plugin that allows you to run shaders as your wallpaper.

Installation:

Install through KDE

  • Right click on your desktop > Configure Desktop
  • Click on the "Get New Plugins" button
  • Search and Install the latest version of "Shader Wallpaper"

Install from AUR

Install from Source

  • clone this repository or download the latest release
  • install from folder: kpackagetool5 -t Plasma/Wallpaper -i kde-shader-wallpaper
  • install from archive: kpackagetool5 -t Plasma/Wallpaper -i online.knowmad.shaderwallpaper-2.0.1-alpha.tar.gz

Upgrade

  • kpackagetool5 -t Plasma/Wallpaper --upgrade kde-shader-wallpaper

Uninstall

  • You can uninstall it via KDE's desktop settings otherwise, you can uninstall like this: kpackagetool5 -t Plasma/Wallpaper --remove online.knowmad.shaderwallpaper

Repo:

I'll probably maintain it on Github principally for issues/PR but I'll try my best to maintain both, if anything contact me on twitter @y4my4my4m.

Links:

Roadmap:

  • Version 1.0 - Simply load shaders
  • Version 1.1 - File Dialog added
  • Version 1.2 - iGPU fix
  • Version 1.3 - 70 new shaders + autolisting
  • Version 2.0a - Customize shaders via GUI, directly load shaders from shadertoy.com or file (current version)
  • Version 2.0.1a - Breaking bug fix regarding the pause/fullscreen feature(current version)
  • Version 2.x - Save/Load edits, better customization, better buffers/channel

Notes:

  • GUI Customization is highly experimental, bugs will occur.
  • Shadertoy.com imports doesn't work on all shaders, that is because iChannels/Buffers are not fully implemented yet
  • Performance may vary depending of your specs, but it's actually not all that resource intensive, depends on the shader too.
  • If you modify the shader files and want to see the changes, the KDE Wallpaper QtQuick App itself needs to be restart, I recommend simply to pkill plasmashell and restart it.

Videos:

v1.2 using iGPU (and kvantum) in VirtualBox:

ShaderWallpaperVideoPreviewV1.2

v1.0:

ShaderWallpaperVideoPreviewV1.0

Screenshots:

ShaderWallpaperPreviewImage

ShaderWallpaperPreviewImage2

ShaderWallpaperPreviewImage3

ShaderWallpaperPreviewImage4

Donations:

ko-fi

kde-shader-wallpaper's People

Contributors

ja2142 avatar simons-public avatar y4my4my4m avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kde-shader-wallpaper's Issues

Unchecking iChannels undo shader customization

When unchecking iChannels, the temporary modifications to the shader gets overwritten.

That happens because getShaderContent() gets called.
Should actualize the shader without reloading from source.

[Feature Request] Chimera's Breath shader

With shaders being able to react to the mouse now, like in CubeLines, one shader I think would be really cool is fluid simulation that interacts with the cursor. One example on ShaderToys is Chimera's Breath. I tried compiling the source with qsb, but I'm not sure how any of this works and ran into many errors.

144 FPS?

Hello. I have just a simple question and or feature request. Is it possible to have the shader wallpaper be active with a display which runs at 144 fps? Currently it definetly CAN run on a 144 display, but it does so with heavy lag tearing since the program is only running at 60 FPS.

Recording-2022-04-26_17.44.44.mp4

This is what I see whenever I have the program running and I've set my display setting to run at 144 FPS.

Thank you so much for reading! :D

useing it with the dedicated gpu

can i do that? my iGPU is slow and most shaders are lagy

OS: archlinux

iGPU:

VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
        DeviceName:  Onboard IGD
        Subsystem: Dell Device 05be
        Kernel driver in use: i915
        Kernel modules: i915

dGPU:

01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Mars XTX [Radeon HD 8790M]
        Subsystem: Dell Device 05be
        Kernel driver in use: amdgpu
        Kernel modules: radeon, amdgpu

KDE Plasma Desktop not interactable when plugin installed

Not working:
when I install the software I am not able to interact with files and folder which are visible on the Desktop. Also I am not able to interact with widgets or add or remove widgets. It seems that there is a layer on top of the Desktop prohibiting interactions with any desktop clickables. I am able to right click and go to edit mode but I cant get further than this.

Expected behaviour:
Able to interact with Folder and Files which are on the Desktop, as well as beeing able to interact with and add or remove other desktop widgets.

My Machine: Arch linux, wayland and KDE Plasma.

can't use .qml files anymore in KDE 6?

I used to have the KDE 5 version of this, and have a couple shaders I switched between regularly, all in .qml format. I recently updated to KDE 6, and it seems the preloaded shaders are .qsb files instead of .qml files now. I tried to load my old .qml shaders and they don't seem to load (weren't even shown in the file picker with "shader files" selected.) Is this intentional, a limitation of switching to KDE 6 and thus Qt6, or a bug? If it's not fixable, is there a way to convert my .qml shaders to .qsb? Sorry if this is a stupid question to someone with more knowledge, I have no clue about how shaders work, and just like the funny moving wallpapers. Thanks in advance for help.

How do I use this?

I have found your post on the KDE subreddit and it a go, however I only get a black screen.
The store description nor the README don't give any instructions or requirements either.

So I'm asking here:
Selecting a shader just gives me a black screen. The iChannels are unused (default state).
Are there any requirements for this (i.e. do I need an extra package)?
In your video I saw the iChannels being used. Are they important? What is their purpose for a shader? Are they required for shaders to work?

Wallpaper acts like Schrodinger's cat

Commit 90ada4233e0c18d01e4706f0ad406116ba2230c0

Wallpaper animation works normally while viewing any application in the foreground, but if you view desktop, it will stop, just like Schrodinger's cat 😄

Several shaders fail to load, instead displaying only black.

After logging out and back in again, several shaders that previously did work (including ones distributed with the extension), now only display plain black. Reinstalling the extension does not help. Updating to the latest git commit does not help. journalctl gets spammed with the following two errors 84 times per second. This happens both using the internal AMD iGPU and an external Nvidia graphics card.

plasmashell[5417]: Failed to build graphics pipeline state
plasmashell[5417]: No GLSL shader code found (versions tried:  QList(320, 310, 300, 100) ) in baked shader QShader(stage=4 shaders=QList(ShaderKey(0 Version(100 QFlags()) 0), ShaderKey(1 Version(100 QFlags()) 0), ShaderKey(1 Version(120 QFlags()) 0), ShaderKey(1 Version(150 QFlags()) 0), ShaderKey(2 Version(50 QFlags()) 0), ShaderKey(4 Version(12 QFlags()) 0)) desc.isValid=true)

[Feature request] List and timer of different shaders

I don't know how hard it would be, I may even do it myself if get some heads up but I want there to be an option to not select any shader in particular but to have one random pop out everytime I use it (being it login into KDE or screenlocking).

So the idea is:

  • Being able to select what shaders we want in said list
  • Route 1
    • Being able to set a timer at which the shader will change (maybe even change qualities of the shader every few minutes)
  • Route 2
    • The shader changes everytime the wallpaper is activated

I think also both options are possible but are different ways of doing, ideally both options should be enabled for further customization.

Crashes my PC

When I activated it and picked one, my PC froze, and the screen turned black except for my cursor. I can press the power button, log out and go back to the desktop, but I only have seconds before it crashes again.

From 60 w to 150 w

Hi, first thanks for your work.
I have been testing just for curiosity.
While testing it, I have measured GPU consumption with nvidia-smi and it goes from 60 w with static image to 150 W (more or less) with mandelbrot.
I think that this could be normal but maybe it is interesting to put an UI label with estimated cost (in w) or in some scale.

Thanks again for your effort.

Testing shaders on the AMD Vega8 GPU

Tested on Ubuntu 20.10 Vega8 AMD Ryzen integrated GPU, there are few problems with this GPU like - just launching radeontop make gpu freeze completely so some of the bugs with gpu/driver crash may come not from shaders/applications.
Tested using this Shader Wallpaper plugin in KDE.

Suggestion - group shaders by light gpu usage, medium gpu usage, high gpu usage in the UI of Shader Wallpaper option window.

Result:
no lag - means shader work with 60fps
30fps - or less is shader has 100% gpu usage that makes whole system UI work at this framerate because shader
0fps - less than 1 frame per second

2D Clouds - no lag
Abstract Glassy_Field - 10-20fps
Abstract_Plane - 30fps
AlienVoxel - 1-5fps
Biomine - 10-20fps
Booting - no lag
Circuits - 10-20fps
Crazy Waves - no lag
Creation - no lag
Cylintrically Mapped Hexagon - 2-5fps
DNA tracer - 1fps
Day 79 - 5-10fps
Earthbound 1/2/3 - no lag
Electric Sinusiod - no lag
Fast Ocean - 0fps or gpu crash, black screen always instead of render
Fireworks - 0fps
Floating Color_Bubles - 5-10fps
Fovea - no lag
Fractal_Flythrough 20-30fps
Fractal_Tiling - no lag
Galaxy_Spirals - no lag
Geodesic_Tiling - 10-20fps

Gibson - 1-5fps
Grid_Landscape - no lag
HappyJumping - 1-2fps
Hyper_Tunnel - 1-2fps
Hyperspace_Travel - 5-10fps
Hypnoferromagnetism - 20-30fps
IO - 30fps
Impact - 60fps but does not work(black scren), may crash gpu
Infinite_Pinballs - 5fps
Invaders - no lag
Journey - 0fps but works (redner)
Kirby - 5-10fps
Laserworld - no lag
Linescape - 10-20fps
Luminescence - 1-5fps
Mandelbrot_Pattern_Decoration - 30-60fps
Matrix - no lag
Minkowski_Tube - no lag
Neon_Lit_Hexagons - 10-20fps
Noise_Fun - no lag
Noise_Watery - no lag
Oblivion_Radar - no lag

PS3_Menu - no lag
Perspex_Web_Lattice - 30fps
Pfhrector - no lag
Pixelated_RGB - no lag
Protean - 0fps
Radial_Blur_2k18 - 1-2fps
Raymarched_Reflections 30fps
Rorschach_Test - no lag
SIG2014 - no lag
Sanctuary - no lag
Satori - no lag
Seascape - 0fps
Seascape_Sailing - 20-30fps
Shiny_Circle - no lag
Shiny_Galaxy - 5-10fps
Ship_HUD - no lag
Simple - 60fps but black screen 
Snail - 0fps
Space_Curvature - 30fps
Spacebubbles - no lag
StarField_Practice - 30fps
Star_Nest - 30fps
Sunset_925 - no lag
Sunset_Cyber - no lag

SuperPlumber - no lag
Twisted_Columns - no lag
Twisted_Rings - 30fps
Vortex_Dust - 20-30fps
Voxel_Land_2 - no lag
Waves - no lag
Wavy_Background_Effect - no lag
Wolfenstein - no lag
Worms - 20-30fps

just updated with latest 30 shaders update, shaders that missing:

Abstract_Terrain - 5-10fps
Cloud_Crystal - 30fps
Corridor_Travel - 20-30fps
Craziness - no lag
CubeLines - no lag
Curvature - 5-10fps
Day_74 - 10-20fps
Descent - 10-20fps
Descent3D - 30-60fps
Dez - 60fps but does not work(black screen)
Flow_Cells - no lag
FlyOnBuckaroo - 20-30fps
Glow_City - 10-20fps
Industry_II - no lag
LOVE - no lag
Liberation - 30fps
Midgar - 0fps
Mist 5-10fps
N64_Logo - 60fps but it just pink screen, does not work I think
Neon_Wires - 60fps but it just pink screen, does not work I think
OpArt_2 - no lag
PSX - 30fps
Paper_Kaleidoscope - 30fps
Patience_2 - 30fps
Reclaim_Streets - 0fps
Server_Room - 20-30fps
Sin_Wave - no lag
Stained_Lights - no lag
Torus_Thingy - 10-20fps
Triangle_Grid_Contouring - no lag
Voxel_Tunnel - no lag
Warping - 30fps

How I got fps numbers - I launch a simple window on top with fps counter, I used my own app(example_minimal), a screenshot with 30 fps, the last number is fps, on the Cloud Crystal shader.

Multi monitor support.

I would love to see some support for multiple monitors, like perhaps the ability to stretch/crop/widen the view of the shader across the monitors.

Plasma 6 Compatibility

Are there plans to allow this to run on plasma 6? Is it already able to? I couldn't see it in the wallpaper plugins.

Refactor

  1. Export settings to it's own file and window
  2. Export customization to it's own file and window
  3. Figure out how to extend QML ShaderEngine
  4. Downscaling
  5. Change shader based on event/calendar/timer

Blank screen when trying out shaders.

Good morning,

I've got a problem with the plugin for Plasma 6 screen lock.

When I'm trying to use whatever shader, I'm either getting blank screen or one color slowly changing screen.

SDDM wayland log prints:

qt.qpa.wayland: eglSwapBuffers failed with 0x300d, surface: 0x0
kf.svg: The theme "Shades-of-purple" uses the legacy metadata.desktop. Consider contacting the author and asking them update it to use the newer JSON format.
kf.svg: The theme "Shades-of-purple" uses the legacy metadata.desktop. Consider contacting the author and asking them update it to use the newer JSON format.
kf.plasma.core: The theme "Shades-of-purple" uses the legacy metadata.desktop. Consider contacting the author and asking them update it to use the newer JSON format.
kf.plasma.core: The theme "Shades-of-purple" uses the legacy metadata.desktop. Consider contacting the author and asking them update it to use the newer JSON format.
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/WindowModel.qml:41:5: QML Connections: Detected function "onValueChanged" in Connections element. This is probably intended to be a signal handler but no signal of the target matches the name.
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:216: TypeError: Cannot read property 'parent' of null
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:131: ReferenceError: wallpaper is not defined
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/WindowModel.qml:28: ReferenceError: wallpaper is not defined
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/WindowModel.qml:42: ReferenceError: wallpaper is not defined
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/WindowModel.qml:39: ReferenceError: wallpaper is not defined
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/WindowModel.qml:85:9: Unable to assign [undefined] to QRect
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:50: TypeError: Cannot read property 'screenGeometry' of null
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:95: ReferenceError: wallpaper is not defined
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:67: ReferenceError: wallpaper is not defined
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:66: ReferenceError: wallpaper is not defined
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:65: ReferenceError: wallpaper is not defined
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:64: ReferenceError: wallpaper is not defined
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:57: ReferenceError: wallpaper is not defined
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:101: ReferenceError: wallpaper is not defined
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:107: ReferenceError: wallpaper is not defined
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:113: ReferenceError: wallpaper is not defined
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:119: ReferenceError: wallpaper is not defined
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:222: ReferenceError: wallpaper is not defined
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/WindowModel.qml:85:9: Unable to assign [undefined] to QRect
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:50: TypeError: Cannot read property 'screenGeometry' of null
Could not find any constructor for value type QQuickVector3DValueType to call with value QVariant(int, 0)
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:57:9: Unable to assign int to QVector3D
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/WindowModel.qml:85:9: Unable to assign [undefined] to QRect
ShaderEffect: 'iTimeDelta' does not have a matching property
ShaderEffect: 'iFrameRate' does not have a matching property
ShaderEffect: 'iSampleRate' does not have a matching property
ShaderEffect: 'iChannelTime' does not have a matching property
kf.svg: The theme "Shades-of-purple" uses the legacy metadata.desktop. Consider contacting the author and asking them update it to use the newer JSON format.
file:///home/gameplayer/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml:50: TypeError: Value is null and could not be converted to an object
qt.qpa.wayland: Could not create EGL surface (EGL error 0x3000)

Failed to write to the pipe: Bad file descriptor.

I've also tried porting the Plasma waves shader but gives the same result. (modified source code).

Is there any way to resolve this?

Add function to allow upload of others shaders

I think it would be really cool if we could some how upload shaders from other people in the community and view them as well. Would make this plugin even better.

Maybe need a website if its not possible to do through other means?

Just an idea, but would make this so cool.

ShaderCompiler.py fails to parse shader

When trying to add a shader to the plasma6 version, running ShaderCompiler.py fails with the error message:

QSpirvCompiler: Failed to parse shader
Shader baking failed: ERROR: package/contents/ui/Shaders/ConvertMe/red bubbles 3.frag:3: 'ubuf' : undeclared identifier  
ERROR: package/contents/ui/Shaders/ConvertMe/red bubbles 3.frag:3: 'iResolution' : vector swizzle too long  
ERROR: package/contents/ui/Shaders/ConvertMe/red bubbles 3.frag:3: 'iResolution' : unknown swizzle selection  
ERROR: package/contents/ui/Shaders/ConvertMe/red bubbles 3.frag:3: 'iResolution' : unknown swizzle selection  
ERROR: package/contents/ui/Shaders/ConvertMe/red bubbles 3.frag:3: 'iResolution' : unknown swizzle selection  
ERROR: package/contents/ui/Shaders/ConvertMe/red bubbles 3.frag:3: '' : compilation terminated  
ERROR: 6 compilation errors.  No code generated.  
Conversion failed for: red bubbles 3.frag

The file, red bubbles 3.frag, is a simple shader that has worked flawlessly in the plasma5 version. I've attached the file (as a txt due to github limitations). I understand the issue is probably with my shader rather than with the compiler, I still don't fully understand how any of it works.

bubbles.txt

iChannels need improvement

It currently ignore info such as uv flip, also only textures work for now but it could load buffers/shadereffect sources.

Add error display regards shader (qml) file

I'm really enjoying this plugin and was excited to see if custom shaders work, but copying shader and adapting it to work seems to be hard without proper error handling.
I've tried importing this shader bellow, which works fine on shadertoy, but doesnt in this plugin (no error, just last shader not changing to next shader):
Shader_Coloroid.qml

import QtQuick 2.12
import QtQuick.Controls 2.12
Item {
    property string pixelShader: '

    const float k = 8.0 * 3.14;

    void mainImage(out vec4 fragColor, in vec2 fragCoord) {
        vec2 p = fragCoord / iResolution.x;
        vec2 a = sin(k * p);
        vec3 c = (a.x * a.y >= 0.0) ? vec3(1, 0, 0) : vec3(0, 1, 0);
        fragColor = vec4(c, 1);
}
'
}`

Would be nice to have some sort of error display in this case.

Abstract_Liquid by SentientCymatic

I modified this from the original is this line to have a zoom that fit a my screen a little better. This way it doesn't have a repetitive pattern across the screen.

Default is:
float iSmoke = 0.01;

vs

float iSmoke = 0.005;

Otherwise, only added in the code bits for manual frag > qsb compilation.

Abstract_Liquid.frag.tar.gz

use it as a standalone application

Hello, I'm not using a graphical environment (only Awesome WM), I was wondering if it could be compiled or used without Plasma.
Thanks!

Suggestion: Optimisations for laptops and iGPUs

I love this! Thank you so much for making it! One of the few things I miss from Windows is the ability to use Wallpaper Engine, specifically one of its built-in shaders which blows colourful circles across the screen. I've spent the weekend learning basic shader programming and recreating this wallpaper in a format compatible with kde-shader-wallpaper, and it's excellent, much better than the original since I can tune everything to perfection now.

However, I'm running a 4k120Hz monitor on a weak iGPU, and despite all the optimisations I can come up with, this wallpaper remains graphically intensive, pinning me at 100% load and significantly less than 120 frames per second. I also can't use it on my laptop because it would consume the battery very quickly.

I suggest adding a few optimisation features for laptops and lower-end hardware.
First, a resolution cap. If I could render at 1080p instead of the native 4k, my iGPU wouldn't struggle, and my laptop would use significantly less battery. Shaders take an iResolution variable, so it should be relatively easy to add a slider to smoothly adjust down (or up) the resolution.
Second, a frame cap. Many shaders could implement a motion blur and remain aesthetically pleasing with as little as 30 or even 15 frames per second. This would save a lot of resources.
Third, the ability to trigger lower quality settings depending on whether a computer is currently connected to AC power or not, and even to pause rendering altogether if this is the case, like how the current "pause when a window is maximised" setting works.

I'm afraid I can't contribute this code myself, I don't have the skill, but I'll happily submit a pull request with my custom shader once I finish tuning it, if anyone is interested.

FPS counter is inefficient

You don't need to rotate a hidden object, you can access some signals from the attached window object

import QtQuick.Window 2.12
Window.window.onFrameSwapped: fps++

[Shader Request] Cacafire

Screencast_20240408_170122.webm

This is cacafire,
he wants to be included,
please include him.

  • Best regards, a cacodemon

...

No but jokes on a side, can something like this can be added? Minus the ascii. So just a cool fireplace animation.

Possibility to decide which GPU is used

Hi!

I am using these awesome wallpaper shader - cudos for the implementation.

Since I have two GPUs (one iGPU and one Nvidia) - as of now only the Nvidia GPU is used (where I have a constant 40% of GPU utilization with active wallpaper shaders).

Is it possible, that I can decide which GPU is used for these wallpaper shaders? (I would want to give that task to the iGPU - since it probably won't need that much power and I would expect a lower power consumption)

  1. KDE PLasma 6.0.5
  2. KDE Frameworks: 6.2.0
  3. Qt: 6.7.1
  4. Kernel: 6.9.3-zen1-1-zen (64 bit)
  5. Graphics Platform: Wayland
  6. Graphics Processor: NVIDIA GeForce RTX 4090/PCIe/SSE2

Always crashes

Hello!

After cycling through several shaders, I selected one which would crash the session (I could only move the mouse), however after a reinstall, the crash now occurs whichever shader I choose. Are there any config/cache files that remain after removing the plugin that would cause this behavior and which I should delete manually?

Was running version 2.0.1a.

Allow downscaling shaders

It would be size to render the shaders at a lower resolution than the screen size. In my case for example I am using a 4k monitor with a fairly modest gpu, so a lot of the more intensive shaders stutter.

Interacting with KDE desktop elements or changing wallpaper settings on high refresh rate monitors causes shader to speed up.

When using this wallpaper on a monitor with a refresh rate above 60 Hz, interacting with desktop components of KDE Plasma 5 (not including applications like Dolphin) causes the shader to speed up very briefly, and it's very distracting.
https://github.com/y4my4my4m/kde-shader-wallpaper/assets/33814663/a34f79b9-2235-44fe-b5bf-1e5e37e5e7c9
In this case, I'm currently using a monitor with a refresh rate of 240 Hz but the problem is still visible in a 60 FPS recording.

A similar issue occurs when opening the wallpaper settings to adjust the shader, this time speeding up consistently for the entire time the menu is open.
https://github.com/y4my4my4m/kde-shader-wallpaper/assets/33814663/6f8d570a-74e1-45c9-8400-90b1099e8a0c

Changing the refresh rate to 60 Hz does resolve this problem, but I would rather not have to do that.

Recompiling shader is not having any effect

Here is a modified version of the PS3 menu shader I've updated to be compatible with the latest developer instructions.

#version 450

layout(location = 0) in vec2 qt_TexCoord0;
layout(location = 0) out vec4 fragColor;

layout(std140, binding = 0) uniform buf {
    mat4 qt_Matrix;
    float qt_Opacity;
    float iTime;
    float iTimeDelta;
    float iFrameRate;
    float iSampleRate;
    int iFrame;
    vec4 iDate;
    vec4 iMouse;
    vec3 iResolution;
    float iChannelTime[4];
    vec3 iChannelResolution[4];
} ubuf;

layout(binding = 1) uniform sampler2D iChannel0;
layout(binding = 1) uniform sampler2D iChannel1;
layout(binding = 1) uniform sampler2D iChannel2;
layout(binding = 1) uniform sampler2D iChannel3;

vec2 fragCoord = vec2(qt_TexCoord0.x, 1.0 - qt_TexCoord0.y) * ubuf.iResolution.xy;

float iTime = ubuf.iTime;
vec3 iResolution = ubuf.iResolution;

// https://www.shadertoy.com/view/4ddGzj
// Credits to jabudcha

const float speed = 0.4;
const float widthFactor = 2.0;

vec3 calcSine(vec2 uv,
              float frequency, float amplitude, float shift, float offset,
              vec3 color, float width, float exponent, bool dir)
{
    float angle = iTime * speed * frequency + (shift + uv.x) * 0.75;

    float y = sin(angle) * amplitude + offset;
    float clampY = clamp(0.0,y,y);
    float diffY = y - uv.y;

    float dsqr = distance(y,uv.y);
    float scale = 1.0;

    if(dir && diffY > 0.0)
    {
        dsqr = dsqr * 4.0;
    }
    else if(!dir && diffY < 0.0)
    {
        dsqr = dsqr * 4.0;
    }

    scale = pow(smoothstep(width * widthFactor, 0.0, dsqr), exponent);

    return min(color * scale, color);
}

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    vec2 uv = fragCoord.xy / iResolution.xy;
    vec3 color = vec3(0.0);

    float t1 = (sin(iTime/20.0) / 3.14) + 0.2;
    float t2 = (sin(iTime/10.0) / 3.14) + 0.2;

    color += calcSine(uv, 0.20, 0.2, 0.0, 0.5,  vec3(0.5, 0.5, 0.5), 0.1, 15.0,false);
    color += calcSine(uv, 0.40, 0.15, 0.0, 0.5, vec3(0.5, 0.5, 0.5), 0.1, 17.0,false);
    color += calcSine(uv, 0.60, 0.15, 0.0, 0.5, vec3(0.5, 0.5, 0.5), 0.05, 23.0,false);

    color += calcSine(uv, 0.26, 0.07, 0.0, 0.3, vec3(0.5, 0.5, 0.5), 0.1, 17.0,true);
    color += calcSine(uv, 0.46, 0.07, 0.0, 0.3, vec3(0.5, 0.5, 0.5), 0.05, 23.0,true);
    color += calcSine(uv, 0.58, 0.05, 0.0, 0.3, vec3(0.5, 0.5, 0.5), 0.2, 15.0,true);

    color.x += (0.9-uv.y);
    color.y += (0.7176-uv.y);
    color.z += (0.77-uv.y);

    fragColor = vec4(color,1.0);
}

void main() {
    vec4 color = vec4(0.0);
    mainImage(color, fragCoord);
    fragColor = color;
}

As you can see, I've modified the color x, y, z to fixed values. Here is my expected look from shadertoy:

image

I originally compiled this file with the same name using the original colors, without modification. The original changes the red and green channel values only, based on the t1 and t2 values.

I chose another shader in wallpaper selector, then performed this command:

❯ ls -lah
total 24K
drwxr-xr-x  2 jbanasik jbanasik 4.0K May 21 23:46 .
drwxr-xr-x 50 jbanasik jbanasik 4.0K May 21 23:46 ..
-rw-r--r--  1 jbanasik jbanasik 2.5K May 21 23:46 jb-test2.frag
-rw-r--r--  1 jbanasik jbanasik 2.5K May 21 23:39 jb-test.frag
-rw-r--r--  1 jbanasik jbanasik 5.5K May 21 23:46 jb-test.frag.qsb
❯ rm -v jb-test.frag.qsb; rm -v /home/jbanasik/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/Shaders6/jb-test.frag.qsb; qsb --glsl "100 es,120,150" --hlsl 50 --msl 12 -o jb-test.frag.qsb jb-test.frag && cp -v jb-test.frag.qsb /home/jbanasik/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/Shaders6/
removed 'jb-test.frag.qsb'
removed '/home/jbanasik/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/Shaders6/jb-test.frag.qsb'
'jb-test.frag.qsb' -> '/home/jbanasik/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/Shaders6/jb-test.frag.qsb'

I reselect the jb-test.frag.qsb, and I get the same exact results. I copied my file, adding a 2 to the name, and reran this command a couple of times just to be sure before selecting the shader.

❯ rm -v jb-test2.frag.qsb; rm -v /home/jbanasik/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/Shaders6/jb-test2.frag.qsb; qsb --glsl "100 es,120,150" --hlsl 50 --msl 12 -o jb-test2.frag.qsb jb-test2.frag && cp -v jb-test2.frag.qsb /home/jbanasik/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/Shaders6/
removed 'jb-test2.frag.qsb'
removed '/home/jbanasik/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/Shaders6/jb-test2.frag.qsb'
'jb-test2.frag.qsb' -> '/home/jbanasik/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/Shaders6/jb-test2.frag.qsb'

It is now correct. The files are identical, but one works and the other doesn't:

❯ diff -q /home/jbanasik/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/Shaders6/jb-test2.frag.qsb /home/jbanasik/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/Shaders6/jb-test.frag.qsb
❯ stat /home/jbanasik/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/Shaders6/jb-test2.frag.qsb; stat /home/jbanasik/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/Shaders6/jb-test.frag.qsb
  File: /home/jbanasik/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/Shaders6/jb-test2.frag.qsb
  Size: 5560      	Blocks: 16         IO Block: 4096   regular file
Device: 254,0	Inode: 88630918    Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/jbanasik)   Gid: ( 1000/jbanasik)
Access: 2024-05-21 23:49:25.660685445 -0700
Modify: 2024-05-21 23:49:25.020685465 -0700
Change: 2024-05-21 23:49:25.020685465 -0700
 Birth: 2024-05-21 23:49:25.020685465 -0700
  File: /home/jbanasik/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/Shaders6/jb-test.frag.qsb
  Size: 5560      	Blocks: 16         IO Block: 4096   regular file
Device: 254,0	Inode: 88630917    Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/jbanasik)   Gid: ( 1000/jbanasik)
Access: 2024-05-21 23:48:02.570688013 -0700
Modify: 2024-05-21 23:48:01.910688033 -0700
Change: 2024-05-21 23:48:01.910688033 -0700
 Birth: 2024-05-21 23:48:01.910688033 -0700

What mechanism is leading to this being cached and how can I avoid it for rapid development?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.