Custom shadertoys.
#1
Hi,

I just found the Shadertoys plugin and I really like it. I am writing my own but I have to run them by pasting my shader into one of the presets in ~/.kodi/addons/visualization.shadertoy/resources because I don't know where the filenames of the presets are stored. If they are not hard coded in the binary the first place. So is there a more elegant way to do things? Like a custom.frag.glsl I can add to the list to play around with?
Reply
#2
Ohaï !

Just came here to say I'm really interested in this too, I managed to modify presets.json and to copy my shader but it seems I can't make audio+buffer work, I also don't really know how to do that as I'm a shadertoy Newbie Smile

Here is the shader I wan't to add to Kodi :

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

Here is why Spectrogram would be cool to have in Kodi ( ^◡^)っ

https://en.wikipedia.org/wiki/Spectrogram

I also can post logs or else if anyone want to give a hand Smile
Reply
#3
There are actually two different shadertoy add-ons, one for screensaver and one for music visualization. The music visualization add-on has some direct options to use custom presets via JSON or or a single custom .glsl file. The screensaver shadertoy also lets you use your own shader under settings and at least on Windows opens a file explorer to let you pick a file.

If you play around with that please post your experiences.
Reply
#4
Hello.  Shadertoy seems to be my favorite one as well.  I can't say how much time I spent scrolling through each of the presets, but it's time well spent instead of watching cable tv commercials, I will tell you that.

I have trouble with lots of things, the resolution, screen sizes, etc..  Have a 1920 screen and some of these seem like they only appear in maybe 800x600 or 1024.  Others like "circuits" have a black border on the left and bottom, as if it was designed only to be used on a cell phone, maybe.

I found little information on the Shadertoy project, and what I found is upsetting.  Seems like major IOS support as if it's made for Apple products (which usually or never plays nice with the rest of the 90% of all other technologies).  I was hoping to find the code, go in there and made tweaks myself but it does not appear really openly friendly.  They want me to get an API license key that uploads and does some not friendly server side things.

I think it might be possible for me to manually compile the shadertoy, so I could go into the code, find whats wrong and fix.  But I haven't mastered compiling Kodi in Linux yet, which I need to do to compile these visualizations.  And looks like Kodi v20 isn't nice with the visualization supporting either, which makes it more difficult.

If anyone has advice or information to help, it would be greatly appreciated.
Reply
#5
Hi,

You don't need to compile anything, assuming you know where the files are, those editable files are sent straight to the graphics card, you can change whatever you like and start the shader, done. Beware, though it is a different way of thinking. Unless you know exactly what is going on you would run into trouble. The Shadertoys (pixel shaders) are, in fact half of a shader, the other half, the geometry part is about five lines long and all it does is draw two triangles that fill the whole screen, that is done for you. What the pixel shader (Shadertoy) does is run its content on every pixel of those triangles, so in this case, EVERY pixel. One by one, these pixels will now want to know which color they should be. So where you would normally, intuitively draw those pixels yourself and you pick where and which color, now all you get is the xy coordinate from every pixel, and one at a time they willl ask from the (pixel/fragment/Shadertoy) shader how you want it to be.

So if you want the right side of the screen red at 1920x1080, then you could code something like :         if (glFragCoord.x > 960) { fragColor = { 1.0, 0.0, 0.0, 0.0}; }.    I forgot if the range is 0..1920 or 0..1 or -1 to 1 (one of them, sorry, it's been about 2 years). Every pixel sees that line and sees if you want it to be red or not.

If I explained this well enough you can start tinkering, if not I would refer you to the Grand Master of Pixel Shaders Inigo Quilez aka IQ. Or go to shadertoy dot com. Shaders are fun. But unintuitive when starting out. Some people write whole ray tracing landscapes with them. In theory you could have a whole world bouncing along on the beat of your music, all 100% on the GPU.
Reply

Logout Mark Read Team Forum Stats Members Help
Custom shadertoys.0