Page 2 of 2
Re: [util] shadertoy shader effect viewer
Posted: Tue Jun 09, 2020 10:44 am
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?
Re: [util] shadertoy shader effect viewer
Posted: Wed Jun 10, 2020 2:55 pm
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)
Re: [util] shadertoy shader effect viewer
Posted: Thu Jun 11, 2020 12:21 am
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.
Re: [util] shadertoy shader effect viewer
Posted: Thu Jun 11, 2020 3:29 pm
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.
Re: [util] shadertoy shader effect viewer
Posted: Sun Jun 14, 2020 7:56 am
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
I hope I didn't miss anything important this time