[util] shadertoy shader effect viewer

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Alexar
Party member
Posts: 174
Joined: Thu Feb 05, 2015 1:57 am
Location: Chengdu,China

[util] shadertoy shader effect viewer

Post 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 20396 times
raycast.png
raycast.png (208.46 KiB) Viewed 20396 times
here is the .love file, with all the buildin images and some downloaded examples.
shadertoy.love
(1.81 MiB) Downloaded 1477 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.
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: [util] shadertoy shader effect viewer

Post 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!
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
User avatar
bakpakin
Party member
Posts: 114
Joined: Sun Mar 15, 2015 9:29 am
Location: Boston

Re: [util] shadertoy shader effect viewer

Post by bakpakin »

This is quite awesome and useful.
((_((_CRAYOLA_((_((_> GitHub <_((_((_CRAYOLA_((_(()
User avatar
Alexar
Party member
Posts: 174
Joined: Thu Feb 05, 2015 1:57 am
Location: Chengdu,China

Re: [util] shadertoy shader effect viewer

Post 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.
User avatar
AntonioModer
Party member
Posts: 202
Joined: Fri Jun 15, 2012 5:31 pm
Location: Belarus
Contact:

Re: [util] shadertoy shader effect viewer

Post 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.
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: [util] shadertoy shader effect viewer

Post 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
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
Alexar
Party member
Posts: 174
Joined: Thu Feb 05, 2015 1:57 am
Location: Chengdu,China

Re: [util] shadertoy shader effect viewer

Post 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]
User avatar
Alexar
Party member
Posts: 174
Joined: Thu Feb 05, 2015 1:57 am
Location: Chengdu,China

Re: [util] shadertoy shader effect viewer

Post 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.
DoctorEnder
Prole
Posts: 4
Joined: Thu Sep 27, 2018 10:07 am

Re: [util] shadertoy shader effect viewer

Post 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 637 times
DoctorEnder
Prole
Posts: 4
Joined: Thu Sep 27, 2018 10:07 am

Re: [util] shadertoy shader effect viewer

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests