限制着色器们输入的时间范围防止精度问题导致掉帧(略暴力,会导致一个背景连续40分钟左右后会闪烁一次)
This commit is contained in:
@@ -5,7 +5,7 @@ local shader=SHADER.aura
|
|||||||
local t
|
local t
|
||||||
|
|
||||||
function back.init()
|
function back.init()
|
||||||
t=math.random()*2600
|
t=math.random()*260
|
||||||
BG.resize(SCR.w,SCR.h)
|
BG.resize(SCR.w,SCR.h)
|
||||||
end
|
end
|
||||||
function back.resize(_,h)
|
function back.resize(_,h)
|
||||||
@@ -13,7 +13,7 @@ function back.resize(_,h)
|
|||||||
shader:send('h',h*SCR.dpi)
|
shader:send('h',h*SCR.dpi)
|
||||||
end
|
end
|
||||||
function back.update(dt)
|
function back.update(dt)
|
||||||
t=t+dt
|
t=(t+dt)%2600
|
||||||
end
|
end
|
||||||
function back.draw()
|
function back.draw()
|
||||||
gc.clear(.08,.08,.084)
|
gc.clear(.08,.08,.084)
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ local shader=SHADER.grad1
|
|||||||
|
|
||||||
local t
|
local t
|
||||||
function back.init()
|
function back.init()
|
||||||
t=math.random()*2600
|
t=math.random()*260
|
||||||
back.resize()
|
back.resize()
|
||||||
end
|
end
|
||||||
function back.resize()
|
function back.resize()
|
||||||
shader:send('w',SCR.W)
|
shader:send('w',SCR.W)
|
||||||
end
|
end
|
||||||
function back.update(dt)
|
function back.update(dt)
|
||||||
t=t+dt
|
t=(t+dt)%2600
|
||||||
end
|
end
|
||||||
function back.draw()
|
function back.draw()
|
||||||
gc.clear(.08,.08,.084)
|
gc.clear(.08,.08,.084)
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ local shader=SHADER.grad2
|
|||||||
|
|
||||||
local t
|
local t
|
||||||
function back.init()
|
function back.init()
|
||||||
t=math.random()*2600
|
t=math.random()*260
|
||||||
BG.resize(nil,SCR.h)
|
BG.resize(nil,SCR.h)
|
||||||
end
|
end
|
||||||
function back.resize(_,h)
|
function back.resize(_,h)
|
||||||
shader:send('h',h*SCR.dpi)
|
shader:send('h',h*SCR.dpi)
|
||||||
end
|
end
|
||||||
function back.update(dt)
|
function back.update(dt)
|
||||||
t=t+dt
|
t=(t+dt)%2600
|
||||||
end
|
end
|
||||||
function back.draw()
|
function back.draw()
|
||||||
gc.clear(.08,.08,.084)
|
gc.clear(.08,.08,.084)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ local shader=SHADER.rgb1
|
|||||||
|
|
||||||
local t
|
local t
|
||||||
function back.init()
|
function back.init()
|
||||||
t=math.random()*2600
|
t=math.random()*260
|
||||||
BG.resize(SCR.w,SCR.h)
|
BG.resize(SCR.w,SCR.h)
|
||||||
end
|
end
|
||||||
function back.resize(_,h)
|
function back.resize(_,h)
|
||||||
@@ -13,7 +13,7 @@ function back.resize(_,h)
|
|||||||
shader:send('h',h*SCR.dpi)
|
shader:send('h',h*SCR.dpi)
|
||||||
end
|
end
|
||||||
function back.update(dt)
|
function back.update(dt)
|
||||||
t=t+dt
|
t=(t+dt)%2600
|
||||||
end
|
end
|
||||||
function back.draw()
|
function back.draw()
|
||||||
gc.clear(.08,.08,.084)
|
gc.clear(.08,.08,.084)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ local shader=SHADER.rgb2
|
|||||||
|
|
||||||
local t
|
local t
|
||||||
function back.init()
|
function back.init()
|
||||||
t=math.random()*2600
|
t=math.random()*260
|
||||||
BG.resize(SCR.w,SCR.h)
|
BG.resize(SCR.w,SCR.h)
|
||||||
end
|
end
|
||||||
function back.resize(_,h)
|
function back.resize(_,h)
|
||||||
@@ -13,7 +13,7 @@ function back.resize(_,h)
|
|||||||
shader:send('h',h*SCR.dpi)
|
shader:send('h',h*SCR.dpi)
|
||||||
end
|
end
|
||||||
function back.update(dt)
|
function back.update(dt)
|
||||||
t=t+dt
|
t=(t+dt)%2600
|
||||||
end
|
end
|
||||||
function back.draw()
|
function back.draw()
|
||||||
gc.clear(.08,.08,.084)
|
gc.clear(.08,.08,.084)
|
||||||
|
|||||||
Reference in New Issue
Block a user