Giter Club home page Giter Club logo

visualization.shadertoy's Introduction

visualization.shadertoy addon for Kodi

This is a Kodi visualization addon.

License: GPL-2.0-or-later Build Status Build Status

screenshot

Build instructions

When building the addon you have to use the correct branch depending on which version of Kodi you're building against. If you want to build the addon to be compatible with the latest kodi master commit, you need to checkout the branch with the current kodi codename. Also make sure you follow this README from the branch in question.

If you want to use your own shaders, see instructions for creating your own preset list.

Linux

The following instructions assume you will have built Kodi already in the kodi-build directory suggested by the README.

  1. git clone --branch master https://github.com/xbmc/xbmc.git
  2. git clone --branch Nexus https://github.com/xbmc/visualization.shadertoy.git
  3. cd visualization.shadertoy && mkdir build && cd build
  4. cmake -DADDONS_TO_BUILD=visualization.shadertoy -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../xbmc/kodi-build/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons
  5. make

The addon files will be placed in ../../xbmc/kodi-build/addons so if you build Kodi from source and run it directly the addon will be available as a system addon.

visualization.shadertoy's People

Contributors

akva2 avatar alwinesch avatar bkuhls avatar gade01 avatar hudokkow avatar kib avatar martijnkaijser avatar memphiz avatar montellese avatar notspiff avatar phunkyfish avatar popcornmix avatar rechi avatar topfs2 avatar un1versal avatar weblate avatar wsnipex 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

Watchers

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

visualization.shadertoy's Issues

LibreELEC 9.0.1 Shadertoy (1.1.9.1) Visualisation, preset list empty

Hello @notspiff ,

I've recently installed LibreELEC 9.0.1 on my Raspberry Pi 3 B+ and looked forward to have those nice shadertoy visualisations again, like they used to be.

Just one issue: the preset list is empty and the only visualisation that seems to get triggered/works is that full screen level indicator. The preset files are indeed located in the correct folder of the installed addon.

I tested the screensaver addon, that one has presets available in the list and they seem to work all fine, running smoothly on this nifty arm device. Both addons were installed from the LibreELEC repo. Any ideas on this?

All the best!

LibreELEC 9.0.1 Shadertoy (1.1.9.1) just shows a blank screen

Just upgraded to 9.0.1 from Libreelec 8, and Shadertoy works no more.

When the screensaver kicks in, I get a blank screen.
Even starting from the configuration and selecting preview I get a blank screen (tried with Random, Ball and a couple more).
Other screensavers work, I tried Aerial, Kaster and Google earth.

Question for compile

Sorry to use this way but no other solution found and no contact via email etc...

i managed to compile full build of kodi on pi3 - all works fine but visualization stay black - i think cause gl and gles but how can i specify to use correct one on compile time ?

I used this way (default on pvr addons)

git clone https://github.com/xbmc/xbmc.git
git clone https://github.com/kodi-pvr/pvr.hts.git
cd pvr.hts && mkdir build && cd build
cmake -DADDONS_TO_BUILD=pvr.hts -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/project/cmake/addons
make

Thx !

wishlist: support multiple shaders/buffers

Hi, many thanks for this addon, I had fun with this coding some simple visualization things for LibreELEC on RPi4.

But compared with Shadertoy website, there are some things missing, for my purposes the most relevant missing feature is support for multiple buffers / shaders, that would let me do feedback effects like reaction-diffusion, game of life, and so on.

For some examples, see https://www.shadertoy.com/results?query=reaction%20diffusion

Perhaps one way of implementing the user-facing parts could scan for .glsl suffix in the channel specifications (where currently audio and image files are supported), and compile them as shaders. There would need to be a double-buffering scheme, because you can't safely read from a texture you are writing too via a framebuffer. This wouldn't be 100% the same as the Shadertoy website but would be less invasive than changing the presets.json file format.

Build for Raspberry Pi (2) broken

Since latest commits, build is broken

make[2]: Verzeichnis „/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build“ wird betreten
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Checking to see if CXX compiler accepts flag -flto
-- Checking to see if CXX compiler accepts flag -flto - yes
-- Found OpenGLES: /opt/vc/lib/libGLESv2.so  
-- SHADERTOY_VERSION=1.2.0
-- Added usage definition: ADDON_GLOBAL_VERSION_MAIN_USED
-- Added usage definition: ADDON_GLOBAL_VERSION_GUI_USED
-- Added usage definition: ADDON_GLOBAL_VERSION_FILESYSTEM_USED
-- Added usage definition: ADDON_INSTANCE_VERSION_VISUALIZATION_USED
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    ADDON_DEPENDS_PATH
    PACKAGE_CONFIG_PATH


-- Build files have been written to: /usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy-prefix/src/visualization.shadertoy-build
Force build of visualization.shadertoy
make[3]: Verzeichnis „/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy-prefix/src/visualization.shadertoy-build“ wird betreten
make[4]: Verzeichnis „/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy-prefix/src/visualization.shadertoy-build“ wird betreten
make[5]: Verzeichnis „/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy-prefix/src/visualization.shadertoy-build“ wird betreten
Scanning dependencies of target kissfft
make[5]: Verzeichnis „/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy-prefix/src/visualization.shadertoy-build“ wird verlassen
make[5]: Verzeichnis „/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy-prefix/src/visualization.shadertoy-build“ wird betreten
[ 20%] Building C object lib/kissfft/CMakeFiles/kissfft.dir/kiss_fft.c.o
[ 40%] Linking C static library libkissfft.a
make[5]: Verzeichnis „/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy-prefix/src/visualization.shadertoy-build“ wird verlassen
[ 40%] Built target kissfft
make[5]: Verzeichnis „/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy-prefix/src/visualization.shadertoy-build“ wird betreten
Scanning dependencies of target visualization.shadertoy
make[5]: Verzeichnis „/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy-prefix/src/visualization.shadertoy-build“ wird verlassen
make[5]: Verzeichnis „/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy-prefix/src/visualization.shadertoy-build“ wird betreten
[ 60%] Building CXX object CMakeFiles/visualization.shadertoy.dir/src/lodepng.cpp.o
[ 80%] Building CXX object CMakeFiles/visualization.shadertoy.dir/src/main.cpp.o
/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy/src/main.cpp: In member function ‘void CVisualizationShadertoy::RenderTo(GLuint, GLuint)’:
/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy/src/main.cpp:363:42: error: ‘GL_RED’ was not declared in this scope
           glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, NUM_BANDS, 2, 0, GL_RED, GL_UNSIGNED_BYTE, m_audioData);
                                          ^~~~~~
/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy/src/main.cpp:363:42: note: suggested alternative: ‘GL_RGB’
           glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, NUM_BANDS, 2, 0, GL_RED, GL_UNSIGNED_BYTE, m_audioData);
                                          ^~~~~~
                                          GL_RGB
/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy/src/main.cpp: In member function ‘GLint CVisualizationShadertoy::LoadTexture(int)’:
/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy/src/main.cpp:509:26: error: ‘GL_RED’ was not declared in this scope
     return CreateTexture(GL_RED, NUM_BANDS, 2, m_audioData);
                          ^~~~~~
/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy/src/main.cpp:509:26: note: suggested alternative: ‘GL_RGB’
     return CreateTexture(GL_RED, NUM_BANDS, 2, m_audioData);
                          ^~~~~~
                          GL_RGB
make[5]: *** [CMakeFiles/visualization.shadertoy.dir/build.make:76: CMakeFiles/visualization.shadertoy.dir/src/main.cpp.o] Fehler 1
make[5]: Verzeichnis „/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy-prefix/src/visualization.shadertoy-build“ wird verlassen
make[4]: *** [CMakeFiles/Makefile2:73: CMakeFiles/visualization.shadertoy.dir/all] Fehler 2
make[4]: Verzeichnis „/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy-prefix/src/visualization.shadertoy-build“ wird verlassen
make[3]: *** [Makefile:152: all] Fehler 2
make[3]: Verzeichnis „/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build/visualization.shadertoy-prefix/src/visualization.shadertoy-build“ wird verlassen
make[2]: *** [CMakeFiles/visualization.shadertoy.dir/build.make:102: visualization.shadertoy-prefix/src/visualization.shadertoy-stamp/visualization.shadertoy-build] Fehler 2
make[2]: Verzeichnis „/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build“ wird verlassen
make[1]: *** [CMakeFiles/Makefile2:74: CMakeFiles/visualization.shadertoy.dir/all] Fehler 2
make[1]: Verzeichnis „/usr/src/xbian/xbian-package-xbmc/build/rpi2-matrix/working/cmake/addons/build“ wird verlassen
make: *** [Makefile:84: all] Fehler 2

GL_RED is not defined in GLES2/gl2.h, it's defined in GLES3/gl3.h only (and of course GL/gl.h), which is not part of the Raspberry Pi firmware package

This may fix this issue:
https://github.com/xbmc/visualization.shadertoy/pull/44/files#diff-7ec3c68a81efff79b6ca22ac1f1eabbaR36

No bars in OSMC with kodi 19

Hello,
I've an issue with shadertoy in OSMC qith Kodi v19.
When visualization is activated, for exemple with 2D Spectrum, I see only background.
I've not animations on bars when music is played

(Sorry for my bad english...)

Thanks

Define preset in settings

Hi, nice visualization. Can you possible add the option to predefine a single preset in the settings which will be always used ?

Thx

Kodi Jarvis

How do I go about building this for Kodi Jarvis?

Visualization does not work with Kodi 19.x (LibreELEC 10.x)

RPi-2
LibreELEC 10.0.2

Checked with several presets, visualization does not work properly.
For example, if the 1st preset (2D LED Spectrum) is selected then only a "background grid" is displayed, no bars are displayed when a music is playing.
In case of other presets - only a static picture is displayed, no dynamic images.

A similar issue in OSMC is described here: #91

1.2.1 Not Working on FireTV (Android)

Hi,

Just installed the latest update 1.2.1 on all my Kodi devices (1 x Windows, 2 X FireTV 3rd Gen). All devices are running the latest stable version of Kodi 18.4.

The windows release of shadertoy works fine however the FireTVs don't work. The visualization starts but then there is no movement to the visualization.

Build for Raspberry Pi 1 broken

Sorry, here I'm back again

Build of this binary addon for Raspberry Pi1 (armhfv6) is broken due to errors building glm library

In file included from /home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/glm/src/glm/glm/gtx/.././ext/vector_bool2.hpp:5,
                 from /home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/glm/src/glm/glm/gtx/../vec2.hpp:5,
                 from /home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/glm/src/glm/glm/gtx/../glm.hpp:116,
                 from /home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/glm/src/glm/glm/gtx/dual_quaternion.hpp:19,
                 from /home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/glm/src/glm/glm/detail/glm.cpp:5:
/home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/glm/src/glm/glm/gtx/.././ext/../detail/type_vec2.hpp:90:40: error: 'constexpr const T& glm::vec<2,
   GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const;
                                        ^~~~~~~~
/home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/glm/src/glm/glm/gtx/.././ext/../detail/type_vec2.hpp:89:34: note: previous declaration 'constexpr T
   GLM_FUNC_DECL GLM_CONSTEXPR T& operator[](length_type i);
                                  ^~~~~~~~
In file included from /home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/glm/src/glm/glm/gtx/.././ext/../detail/type_vec2.hpp:398,
                 from /home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/glm/src/glm/glm/gtx/.././ext/vector_bool2.hpp:5,
                 from /home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/glm/src/glm/glm/gtx/../vec2.hpp:5,
                 from /home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/glm/src/glm/glm/gtx/../glm.hpp:116,
                 from /home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/glm/src/glm/glm/gtx/dual_quaternion.hpp:19,
                 from /home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/glm/src/glm/glm/detail/glm.cpp:5:
/home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/glm/src/glm/glm/gtx/.././ext/../detail/type_vec2.inl:118:44: error: no declaration matches 'constex
  GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<2, T, Q>::operator[](typename vec<2, T, Q>::length_type i) const
                                            ^~~~~~~~~~~~
/home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/glm/src/glm/glm/gtx/.././ext/../detail/type_vec2.inl:104:39: note: candidate is: 'constexpr T& glm:
  GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & vec<2, T, Q>::operator[](typename vec<2, T, Q>::length_type i)
                                       ^~~~~~~~~~~~

I compared the thee addons visualization.spectrum, visualization.waveform and this one, and figured out that they are different version of the glm library. visualization.spectrum, visualization.waveform are using

-- Processing /home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/visualization.waveform/depends/common/glm/glm.txt
-- glm url: https://github.com/g-truc/glm/archive/0.9.9.4.tar.gz
-- glm extraflags: -DGLM_TEST_ENABLE_CXX_11=1;-DGLM_TEST_ENABLE=0;-DGLM_TEST_ENABLE_SIMD_SSE2=0;-DCMAKE_INSTALL_LIBDIR=lib

whereas this one is using a 3 or 4 month older versionof this library

-- Processing /home/xbian/xbian-package-xbmc/build/rpi-leia/working/cmake/addons/build/visualization.shadertoy/depends/common/glm/glm.txt
-- glm url: https://github.com/g-truc/glm/archive/47031aa4b7b079716e4cac496819e7f464b6a713.tar.gz
-- glm extraflags: -DGLM_TEST_ENABLE_CXX_11=1;-DGLM_TEST_ENABLE=0;-DGLM_TEST_ENABLE_SIMD_SSE2=0;-DCMAKE_INSTALL_LIBDIR=lib

Is there any reason for doing this?

wishlist: mipmaps for textures

Mipmapping is a technique using multiple downscaled levels of texture to improve quality (reduced aliasing) when displaying textures smaller than the resolution of the base level.

Shadertoy website has a few options for channel images: filter mode (nearest / linear / mipmap) , wrap mode (clamp / repeat), flipping (none / vertical).

There are two steps involved, first use glGenerateMipmap() (supported in OpenGLES 2+, OpenGL 3+) after changing texture base level data to generate the downscaled levels, then using glTexParameteri() with GL_TEXTURE_MIN_FILTER GL_LINEAR_MIPMAP_LINEAR. (Other minification filters are available, but linear/linear should be a good default to start with.)

This would allow some cool things to be done apart from improved quality of images: for just one example you can compare the sample from the base level with a sample from a downscaled level (which gives a local average) to do simple peak detection (I currently do this in my shader for the FFT channel of the audio texture by looping over a neighbourhood and reading the texture multiple times, which is very inefficient - it could be two texture reads with mipmaps).

Note: generating mipmaps for large textures can be performance intensive for the GPU (especially if you need to do it every frame), so if my other wishlist item for multliple buffers/shaders gets implemented, there would need to be a way to turn it off for selected buffers and just use GL_NEAREST for texture filtering. The audio texture should be small enough not to need this turning off but an option might not hurt.

Note: if glGenerateMipmap() is not available (desktop OpenGL < 3 and no suitable extension), you can do it yourself with framebuffers from OpenGL extensions (they are not in core until OpenGL 3+) or as a last resort by downscaling on the CPU and uploading each level to the GPU texture separately (probably not worth doing that though).

Not an issue: are there demo videos around

Sorry to hijack the issues system, but I'm currently not using Kodi and was wondering if there are any videos showing nice shaders running on your plugin?
Thanks in advance

v1.1.2 failure

At least the GLES implemention on Freescale iMX6 (Vivante) doesn't like the reordering introduced in dc09129 I.e. it wants the "#extension ..." statement to come first.

Use shadertoy.com shader?

I'm trying to use the heartfelt shader but I can't get it to work correctly.

https://www.shadertoy.com/view/ltffzl

I have the glsl code in a file and selected in shadertoy add-on, I changed the code so the background image is iChannel1, set a background image to iChannel1 in shadertoy add-on settings but when I attempt to preview I get a black screen.

Am I doing something wrong?

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.