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