y4my4my4m / kde-shader-wallpaper

KDE / Plasma - Shader Wallpaper plugin
GNU General Public License v3.0
224 stars 12 forks source link

Add error display regards shader (qml) file #5

Closed Meister1593 closed 3 years ago

Meister1593 commented 3 years ago

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.

y4my4my4m commented 3 years ago

@Meister1593

I believe you have to kill your entire plasmashell and reload it for the changes to appear properly. This is a bug with KDE wallpaper module itself as far as I know...

Development has been a pain because of this...

If you load plasmashell from your terminal, you should see the errors showing up there though.

My understanding is that the plugin itself isn't a QtQuick app, it's just extra qml that the KDE Wallpaper QtQuick App loads. Which makes it difficult to add significant changes... (Someone correct me on this if I'm wrong though)

Meister1593 commented 3 years ago

@Meister1593

I believe you have to kill your entire plasmashell and reload it for the changes to appear properly. This is a bug with KDE wallpaper module itself as far as I know...

Development has been a pain because of this...

If you load plasmashell from your terminal, you should see the errors showing up there though.

My understanding is that the plugin itself isn't a QtQuick app, it's just extra qml that the KDE Wallpaper QtQuick App loads. Which makes it difficult to add significant changes... (Someone correct me on this if I'm wrong though)

Yep, i have to restart plasmashell from terminal in order to apply new shader. Although, restarting plasmashell doesn't kill any app and it's relatively quick.

y4my4my4m commented 3 years ago

@Meister1593

Although this is still a mess and debugging nightmare, shaders are now standalone .frag files instead QT components. They're also editable.

Create a new issue with more specific/up-to-date details if needed. Cheers~