OpenELEC Testbuilds for RaspberryPi (Kodi 15.0) Part 2
(2015-05-30, 14:57)Forage Wrote: Love it! (yeah, it's been a while since I've updated Tongue)
Just how does one add/try others? Can it be done without compiling?

Are you talking about visualisations or screensavers? None of the shadertoy links you gave were for visualisations
(you want shaders with an audio input like this for visualisations).

In theory you can just edit the glsl file (e.g. /usr/share/kodi/addons/visualization.shadertoy/resources/silexarst.frag.glsl)
and the visualisation/screensaver will update on next use (even without relaunching kodi).

But, as OpenELEC is readonly, you will have to copy it somewhere writable. E.g.
Code:
cp -a /usr/share/kodi/addons/screensaver.shadertoy /storage/.kodi/addons/
cp /usr/lib/kodi/addons/screensaver.shadertoy/screensaver.shadertoy.so /storage/.kodi/addons/screensaver.shadertoy/

You'll need to change the id of the new addon. Change:
id="screensaver.shadertoy" to id="screensaver.shadertoy"
name="ShaderToy" to name="ShaderToy2"

Restart kodi (e.g. systemctl restart kodi) and you should see ShaderToy in list of screensavers.

Now you can edit, e.g.
Code:
nano .kodi/addons/screensaver.shadertoy/resources/silexarst.frag.glsl
and after saving your changes the shader should use the updated version (without needing to restart kodi).
Try changing "p-=.5;" to "p-=.25;" and you should see a less centred version of the effect.

(all this applies to visualisations too - just change the path).

Note: on Pi1/Pi2 you can handle about 1000 cycles worth of work per pixel and have a decent framerate.
Complex operations like sin/cos/sqrt will take dozens of cycles. Shaders that have loops with high iterations are likely to struggle.
From your list the first one is probably out (loop of 40, then several calls to complex operations inside that loop).
The others look more plausible.

Also, the textures used by shaders are in the code so needs recompiling to change.
If shader doesn't use textures (many don't - look at the iChannel0, iChannel1, iChannel2, iChannel3 below the shader code on shadertoy site)
then no problem. If it does then modify a shader that uses a similar texture (often the exact texture isn't critical).


Messages In This Thread
RE: OpenELEC Testbuilds for RaspberryPi (Kodi 15.0) Part 2 - by popcornmix - 2015-05-30, 17:17
How to install the builds - by kisas - 2015-05-24, 02:10
MVC 3D ISO Blu-ray - by Azimono - 2015-06-06, 14:28
Logout Mark Read Team Forum Stats Members Help
OpenELEC Testbuilds for RaspberryPi (Kodi 15.0) Part 214