Page 1 of 2

[util] shadertoy shader effect viewer

Posted: Tue Sep 08, 2015 12:55 am
by Alexar
hi guys,
these days, i am very interested in playing with shaders. and i found the site http://www.shadertoy.com.
you can see these amazing effects 2d & 3d. the language in that site is a little different from love's, so i desided to do some conversion.
with this util, you can run the code copied from shadertoy directly, or you can output the converted code to love shader.
here are some screen shots.
fansy.png
fansy.png (529 KiB) Viewed 20403 times
raycast.png
raycast.png (208.46 KiB) Viewed 20403 times
here is the .love file, with all the buildin images and some downloaded examples.
shadertoy.love
(1.81 MiB) Downloaded 1478 times
for now, this util dont support the texturecube function and vr function, and the channel sources are limited to image files(shadertoy supports sound and video).
this util is for easy shader learning in love, you can use it freely, but all right of the oringal shaders reserve to the orignal shader coders. i will delete it if any infringement.

Re: [util] shadertoy shader effect viewer

Posted: Tue Sep 08, 2015 1:16 pm
by Davidobot
That's incredibly useful! I like checking out shadertoy too periodically, but was slightly disappointed at the lack of usage within Löve, but now that's been resolved! Thanks a bunch!

Re: [util] shadertoy shader effect viewer

Posted: Tue Sep 08, 2015 9:10 pm
by bakpakin
This is quite awesome and useful.

Re: [util] shadertoy shader effect viewer

Posted: Wed Sep 09, 2015 12:53 am
by Alexar
Davidobot wrote:That's incredibly useful! I like checking out shadertoy too periodically, but was slightly disappointed at the lack of usage within Löve, but now that's been resolved! Thanks a bunch!
bakpakin wrote:This is quite awesome and useful.
thanks for support, hope you enjoy it.

Re: [util] shadertoy shader effect viewer

Posted: Wed Sep 09, 2015 9:34 am
by AntonioModer
WOW! :awesome:
Alexar, this is awesome. shadertoy.com has a lot of good examples (2d shadows, gradients, fractals, ...)
Thanks!

mandelbrot "doubles", Simple path tracer run well on LOVE 0.9.2
Where you get raycast2d.glsl ? I can't find this on shadertoy.com.

Re: [util] shadertoy shader effect viewer

Posted: Wed Sep 09, 2015 3:13 pm
by zorg
Is it just me, or should the mouse-controlled light source in the raycasting example move with the mouse cursor, and not mirrored horizontally and vertically? Because it moves like that on my end :v

Re: [util] shadertoy shader effect viewer

Posted: Thu Sep 10, 2015 1:34 am
by Alexar
zorg wrote:Is it just me, or should the mouse-controlled light source in the raycasting example move with the mouse cursor, and not mirrored horizontally and vertically? Because it moves like that on my end :v
sorry,it's my mistake, and fix that by

Code: Select all

    iSystem.iMouse[1],iSystem.iMouse[2] = love.mouse.getPosition()
    iSystem.iMouse[1]=resolution[1]-iSystem.iMouse[1]
    iSystem.iMouse[2]=resolution[2]-iSystem.iMouse[2]

Re: [util] shadertoy shader effect viewer

Posted: Thu Sep 10, 2015 1:37 am
by Alexar
AntonioModer wrote:WOW! :awesome:
Alexar, this is awesome. shadertoy.com has a lot of good examples (2d shadows, gradients, fractals, ...)
Thanks!

mandelbrot "doubles", Simple path tracer run well on LOVE 0.9.2
Where you get raycast2d.glsl ? I can't find this on shadertoy.com.
i changed the file name, the origin name is something like "distance based 2d soft shadow", i forgot.

Re: [util] shadertoy shader effect viewer

Posted: Sun Jun 07, 2020 5:58 pm
by DoctorEnder
This was very broken when I tried it. I'm pretty sure a lot has changed since this version of love so now this code looks pretty bad.
I updated it to 11.3 and made it work with pre-converted glsl code.
You can also change the resolution by changing the window size now.
Arrow keys switch between shaders. It will skip any that can't compile (which is several).
Enjoy!
shadertoy fixed.love
(1.81 MiB) Downloaded 638 times

Re: [util] shadertoy shader effect viewer

Posted: Tue Jun 09, 2020 5:54 am
by DoctorEnder
I couldn't help it, I added a bunch more example shaders from shadertoy.com
Mouse inversion is fixed now 😜👌 forgot about that the first time lol
shadertoy more shaders.love
(1.84 MiB) Downloaded 749 times