[util] shadertoy shader effect viewer

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
pgimeno
Party member
Posts: 3550
Joined: Sun Oct 18, 2015 2:58 pm

Re: [util] shadertoy shader effect viewer

Post by pgimeno »

DoctorEnder wrote: Sun Jun 07, 2020 5:58 pm 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.
I missed this project, awesome, thanks for updating it!

I get X mirrored. Any idea if that's fixable?
Andlac028
Party member
Posts: 174
Joined: Fri Dec 14, 2018 2:27 pm
Location: Slovakia

Re: [util] shadertoy shader effect viewer

Post by Andlac028 »

You can increase performance by remove love.graphics.draw call in love.update because it has no effect and you are already calling it in love.draw (in my case, it doubles FPS)
User avatar
pgimeno
Party member
Posts: 3550
Joined: Sun Oct 18, 2015 2:58 pm

Re: [util] shadertoy shader effect viewer

Post by pgimeno »

pgimeno wrote: Tue Jun 09, 2020 10:44 am I get X mirrored. Any idea if that's fixable?
Well, I've fixed it with this:

Code: Select all

diff -ru a/main.lua b/main.lua
--- a/main.lua	2020-06-09 00:48:08.000000000 +0200
+++ b/main.lua	2020-06-11 02:29:18.696073441 +0200
@@ -123,7 +123,7 @@
   end
   if iSystem.iMouse then
     iSystem.iMouse[1],iSystem.iMouse[2] = love.mouse.getPosition()
-	iSystem.iMouse[1],iSystem.iMouse[2] = resolution[1]-iSystem.iMouse[1],resolution[2]-iSystem.iMouse[2]
+    iSystem.iMouse[1],iSystem.iMouse[2] = iSystem.iMouse[1],resolution[2]-iSystem.iMouse[2]
     if love.mouse.isDown(1) then
         if iSystem.iMouse[3]<0 then
           iSystem.iMouse[3],iSystem.iMouse[4] = love.mouse.getPosition()
@@ -139,5 +139,5 @@
 end
 
 function love.draw()
- love.graphics.draw(canvas,0,0,math.pi,1,1,resolution[1],resolution[2])
+  love.graphics.draw(canvas,0,0,0,1,-1,0,resolution[2])
 end
Also, I concur with Andlac028; I also get a 2x speedup when removing the love.graphics.draw line from love.update.
Andlac028
Party member
Posts: 174
Joined: Fri Dec 14, 2018 2:27 pm
Location: Slovakia

Re: [util] shadertoy shader effect viewer

Post by Andlac028 »

It happens only to me, that Löve simply crashes on love.graphics.newShader function runned in pcall with no message on shader "circle inversion laser.glsl"? (using LÖVE 11.3 on Windows 8.1, I can boot Ubuntu and try it on it too)

Update:
When I removed line 4:

Code: Select all

#define frame(u) camLens*(u-.5*iResolution.xy)/iResolution.y
Löve doesn't crash, only love.graphics.newShader returns error:

Code: Select all

Error: Error validating pixel shader code:
Line 121: ERROR: 'frame' : no matching overloaded function found 
Line 121: ERROR: '=' :  cannot convert from ' const float' to ' temp 2-component vector of float'
Line 121: ERROR: '' : compilation terminated 
ERROR: 3 compilation errors.  No code generated.
DoctorEnder
Prole
Posts: 4
Joined: Thu Sep 27, 2018 10:07 am

Re: [util] shadertoy shader effect viewer

Post by DoctorEnder »

I'm glad I restarted the hype. I added more features and fixed a major bug. The shader was being rendered twice.
Made some other nice changes and things, didn't make a list 😜

Now you can do more things
p = pause
v = toggle on/off vsync
f = toggle fullscreen
r = restart
1,2,3,... = switch monitors
shadertoy better.love
(1.84 MiB) Downloaded 375 times
I hope I didn't miss anything important this time 🤞
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 196 guests