Thanks for the reply, but the problem hasn't gone away. When loading a save in a new game session, the shader does not work.
messages.log with edited script:
22:49:19.213:Engine Version: 5.1.8.1 (Build 1226 from Build date: Feb 14 2022)
22:49:19.213:Time needed for preloading game: 3 msec
22:49:19.213:Loading from C:\Users\Simith\AppData\Local/123/Tartarus//config.ini
22:49:19.213:config.ini: Unknown Field: Subtitles
22:49:19.213:config.ini: Unknown Field: TextLanguage
22:49:19.213:config.ini: Unknown Field: SpeechLanguage
22:49:19.213:config.ini: Unknown Field: FxQuality
22:49:19.213:config.ini: Unknown Field: ColorBlindMode
22:49:19.214:Using DX11 Subsystem
22:49:19.351:Initializing graphics interface. Surface size: 1920x1080, render size: 1920x1080
22:49:19.361:Serialization finished. Needed time: 8 ms
22:49:19.361:SetupParents finished. Needed time: 0 ms
22:49:19.361:SortLinks finished. Needed time: 0 ms
22:49:19.362:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:19.362:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:19.363:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:19.363:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:19.364:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:19.364:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:19.364:Interfaces loaded. Needed time: 3 ms
22:49:19.368:[string "(30,6)"]:1161: attempt to concatenate a nil value (global 'basic_fsh')
22:49:19.368:stack traceback:
[C]: in function 'debugerror'
[string "function debugfunc(err) debugerror(err) end"]:1: in function 'debugfunc'
[string "(30,6)"]:1161: in main chunk
22:49:19.368:Failed to run string in Lua:
22:49:19.368:String content: --[VISMODULE,id,version,chksum]
--
-- Shader Toolkit Hue, Saturation, Luminance, Blur, Noise, Camera Control, Bloom, Random Effects
-- (c) 2015 Simon Scheckel, Visionaire Studio Engine - with edits by AFRLme
-- Version 0.96
-- updated 29/09/2014 for 4.1
-- added some save functionality 9/10
-- bugfix version 16/10
-- update 10/6/15 radial glow, use per object matrices
-- update 3/2/16 cross platform shaders requires 4.3
-- update 28/9/18 lua 5.3
--
--
-- Usage:
--
-- all factors like zoom, scale are normally 1 to have no change
-- delay in ms
-- hue in 0-1 (0 = red, 0.5 = cyan, 1 = red again)
--
-- easing functions: Back, Bounce, Circ, Cubic, Elastic, Linear, None, Quad, Quint, Sine, all In/Out/InOut
-- examples: easeBackOut, easeLinearIn, easeElasticInOut etc
--
-- shaderZoomCharacter(name, c_scale, delay, easing)
-- shaderZoomObject(object, c_scale, delay, easing)
-- shaderFollowCharacter(name, c_scale, delay)
-- shaderStopFollow()
-- shaderViewportInterpolationPoint(x,y)
-- shaderViewport(zoom, x, y, rotation, delay, easing) rotation in 0-2Pi (full turn)
-- shaderPan(offset, delay, easing, axis)
-- shaderRotate(degree, delay, easing) -- degree values 0 to 359 (automatically converts value to Pi)
-- shaderZoom(zoom, delay, easing)
-- on: 1 = on, 0 = off
--
-- shaderNoise(on, strength, delay) -- strength * noise + color, so strength 0 white
-- shaderBlur(radius, delay)
-- shaderSaturation(factor, delay)
-- shaderLightness(offset, delay)
-- shaderContrast(contrast, delay)
-- shaderHue(target, delay)
-- shaderColorize(hue, strength, delay)
--
-- shaderActivate()
-- shaderDeactivate()
--
-- shaderGlow(on, radius, exposure)
-- shaderAddEffect(name)
-- shaderRemoveEffect(name)
-- shaderEffectParam(shader, name, value)
-- shaderLamp(index, type, position, targetpos, falloff, ambient, diffuse, diffusefactor, exponent, cutoff)
--
-- Effects at the time:
--[[
warp1
tv1
ripple1
ripple2
ascii
edgeglow
chroma
ripple3
warp2
ripple4
pearls
highlight
fourbit
tv2
tv3
tv4
--
-- Read no further if the word matrix multiplication frightens you
--]]
game.GameShaderExclude = eShaderExcludeInterfaces
local matrix = {_TYPE='module', _NAME='matrix', _VERSION='0.2.11.20120416'}
local matrix_meta = { }
function matrix:new( rows, columns, value )
if type( rows ) == "table" then
if type(rows[1]) ~= "table" then
return setmetatable( {{rows[1]},{rows[2]},{rows[3]}},matrix_meta )
end
return setmetatable( rows,matrix_meta )
end
local mtx = {}
local value = value or 0
if columns == "I" then
for i = 1,rows do
mtx = {}
for j = 1,rows do
if i == j then
mtx[j] = 1
else
mtx[j] = 0
end
end
end
else
for i = 1,rows do
mtx = {}
for j = 1,columns do
mtx[j] = value
end
end
end
return setmetatable( mtx,matrix_meta )
end
function matrix.mul( m1, m2 )
local mtx = {}
for i = 1,#m1 do
mtx = {}
for j = 1,#m2[1] do
local num = m1[1] * m2[1][j]
for n = 2,#m1[1] do
num = num + m1[n] * m2[n][j]
end
mtx[j] = num
end
end
return setmetatable( mtx, matrix_meta )
end
function matrix.type( mtx )
local e = mtx[1][1]
if type(e) == "table" then
if e.type then
return e:type()
end
return "tensor"
end
return "number"
end
local num_copy = function( num )
return num
end
local t_copy = function( t )
local newt = setmetatable( {}, getmetatable( t ) )
for i,v in ipairs( t ) do
newt = v
end
return newt
end
function matrix.transpose( m1 )
local docopy = matrix.type( m1 ) == "number" and num_copy or t_copy
local mtx = {}
for i = 1,#m1[1] do
mtx = {}
for j = 1,#m1 do
mtx[j] = docopy( m1[j] )
end
end
return setmetatable( mtx, matrix_meta )
end
function matrix.tofloat( m1 )
local mtx = {}
local pos = 1
for i = 1,#m1 do
for j = 1,#m1[1] do
mtx[pos] = m1[j]
pos=pos+1
end
end
return mtx
end
matrix_meta.__mul = matrix.mul
matrix_meta.__index = {tofloat = matrix.tofloat, transpose = matrix.transpose}
setmetatable( matrix, { __call = function( ... ) return matrix.new( ... ) end } )
-- End of matrix functions
function string.fromhex(str)
return (str:gsub('..', function (cc)
return string.char(tonumber(cc, 16))
end))
end
function string.tohex(str)
return (str:gsub('.', function (c)
return string.format('%02X', string.byte(c))
end))
end
--
--[[ DataDumper.lua
Copyright (c) 2007 Olivetti-Engineering SA
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
]]
local dumplua_closure = [[
local closures = {}
local function closure(t)
closures[#closures+1] = t
t[1] = assert(load(t[1]))
return t[1]
end
for _,t in pairs(closures) do
for i = 2,#t do
debug.setupvalue(t[1], i-1, t)
end
end
]]
local lua_reserved_keywords = {
'and', 'break', 'do', 'else', 'elseif', 'end', 'false', 'for',
'function', 'if', 'in', 'local', 'nil', 'not', 'or', 'repeat',
'return', 'then', 'true', 'until', 'while' }
local function keys(t)
local res = {}
local oktypes = { stringstring = true, numbernumber = true }
local function cmpfct(a,b)
if oktypes[type(a)..type(b)] then
return a 80 then
sep = "\n" .. string_rep(" ", ident+1)
end
str = "{"..sep..table_concat(str, ","..sep).." "..sep:sub(1,-3).."}"
if meta then
sep = sep:sub(1,-3)
return "setmetatable("..sep..str..","..sep..metastr..sep:sub(1,-3)..")"
end
return str
end
fcts['function'] = function (value, ident, path)
if test_defined(value, path) then return "nil" end
if c_functions[value] then
return c_functions[value]
elseif debug == nil or debug.getupvalue(value, 1) == nil then
return string_format("load(%q)", string_dump(value))
end
closure_cnt = closure_cnt + 1
local res = {string.dump(value)}
for i = 1,math.huge do
local name, v = debug.getupvalue(value,i)
if name == nil then break end
res[i+1] = v
end
print(res)
return "closure " .. dumplua(res, ident, "closures["..closure_cnt.."]")
end
end
function dumplua(value, ident, path)
return fcts[type(value)](value, ident, path)
end
if varname == nil then
varname = "return "
elseif varname:match("^[%a_][%w_]*$") then
varname = varname .. " = "
end
if fastmode then
setmetatable(keycache, {__index = make_key })
out[1] = varname
table.insert(out,dumplua(value, 0))
return table.concat(out)
else
setmetatable(keycache, {__index = make_key })
local items = {}
for i=1,10 do items = '' end
items[3] = dumplua(value, ident or 0, "t")
if closure_cnt > 0 then
items[1], items[6] = dumplua_closure:match("(.*\n)\n(.*)")
out[#out+1] = ""
end
if #out > 0 then
items[2], items[4] = "local t = ", "\n"
items[5] = table.concat(out)
items[7] = varname .. "t"
else
items[2] = varname
end
return table.concat(items)
end
end
-- End of DataDumper
--
-- Shader Metatable
shaders_compiled = {}
local shader_meta = {}
local shader = {}
function shader:new (this, id, file)
local shader = {}
shader.num = shaderCompile(file)
shader.id = id
if shaders_compiled[id] == nil then
shaders_compiled[id] = {}
end
return setmetatable( shader, shader_meta )
end
shader_meta.__call = function(this)
return this.num
end
shader_meta.__newindex = function(this, field, value)
shaders_compiled[this.id][field] = value
graphics.shaderUniform(this.num, field, value)
end
setmetatable( shader, { __call = function( ... ) return shader:new( ... ) end } )
function tween(val,newval,delay,ease)
startTween(val, _G[val], newval, delay,ease)
end
shaders = {
_temporary_=0, c_scene = game.CurrentScene,
glownum = shader("glow","sht_glow.bin"),
rglownum = shader("rglow","sht_glowradial.bin"),
bnum = shader("blur","sht_blur.bin"),
num = shader("num","sht_color.bin")
}
shader_coeff0=0
shader_coeff1=1
shader_coeff2=1
shader_coeff3=0
shader_blur=0
shader_downsize=1
shader_colorize=0
shader_color=0
shader_iTime = 0
shader_noise=0
shader_noiseStrength=0.0
shader_passes=2
shader_active = true
shader_glow = 0
shader_glowradius = 0
shader_glowexp = 1
shader_rotate=0.0
shader_scale = 1.0
shader_offsetx = 0.0
shader_offsety = 0.0
shader_follow = {on=0, name="", c_scale=1, easing = easeQuintOut, delay = 0}
c_res=game.WindowResolution
shaders.num.weights = {shader_colorize,shader_color}
shaders.num.shader_coeff = {shader_coeff0,shader_coeff1,shader_coeff2,shader_coeff3}
shaders.glownum.resolution = {c_res.x,c_res.y}
if graphics.isUpsideDown() then
shaders.bnum.upsideDown = 1.0
shaders.rglownum.upsideDown = 1.0
shaders.glownum.upsideDown = 1.0
else
shaders.glownum.upsideDown = 0.0
shaders.bnum.upsideDown = 0.0
shaders.rglownum.upsideDown = 0.0
end
shaders.bnum.resolution = {c_res.x,c_res.y}
-- * function that stops following specified character & resets camera back to default * --
function shaderStopFollow(easing)
shader_follow.on = 0
shaderViewport(1, 0, 0, 0, shader_follow.delay, easing)
unregisterEventHandler("mainLoop", "followCharacter")
end
-- * function that smoothly follows specified character * --
function shaderFollowCharacter(name, c_scale, delay, easing)
if name == "" then name = game.CurrentCharacter:getName() end
if shader_follow.on == 0 then registerEventHandler("mainLoop", "followCharacter") end
shader_follow.on = 1
shader_follow.name = name
shader_follow.c_scale = c_scale
shader_follow.delay = delay
shader_follow.easing = easing or easeQuintOut
end
function shaderZoomCharacter(name, c_scale, delay, easing)
local c_position={}
if(name=="")then
c_position=game.CurrentCharacter.Position
else
c_position=Characters[name].Position
end
local c_scroll=game.ScrollPosition
c_position.x=c_position.x-c_scroll.x
c_position.y=c_position.y-c_scroll.y
c_position.x=c_position.x-(c_res.x/c_scale/2)
c_position.y=c_position.y-(c_res.y/c_scale/1.2)
c_position.x = math.min(math.max(0,c_position.x), game.CurrentScene.Sprite:getSize().x - c_res.x/c_scale)
c_position.y = math.min(math.max(0,c_position.y), game.CurrentScene.Sprite:getSize().y - c_res.y/c_scale)
shaderViewport(c_scale, c_position.x, c_position.y, 0, delay, easing)
end
function shaderZoomObject(object, c_scale, delay, easing)
local c_position=object.Position
local c_scroll=game.ScrollPosition
c_position.x=c_position.x-c_scroll.x
c_position.y=c_position.y-c_scroll.y
c_position.x=c_position.x-(c_res.x/c_scale/2)
c_position.y=c_position.y-(c_res.y/c_scale/1.2)
c_position.x = math.min(math.max(0,c_position.x), game.CurrentScene.Sprite:getSize().x - c_res.x/c_scale)
c_position.y = math.min(math.max(0,c_position.y), game.CurrentScene.Sprite:getSize().y - c_res.y/c_scale)
shaderViewport(c_scale, c_position.x, c_position.y, 0, delay, easing)
end
function shaderNoise(on, strength,delay)
shaders.num.noise = on
startTween("shader_noiseStrength", shader_noiseStrength, strength, delay,easeLinearInOut)
shader_noise=on
end
function shaderSaturation(factor, delay)
startTween("shader_coeff1",shader_coeff1,factor,delay,easeLinearInOut)
end
function shaderLightness(offset, delay)
startTween("shader_coeff3",shader_coeff3,offset,delay,easeLinearInOut)
end
function shaderContrast(contrast, delay)
startTween("shader_coeff2",shader_coeff2,contrast,delay,easeLinearInOut)
end
function shaderHue(target, delay)
startTween("shader_coeff0",shader_coeff0,target,delay,easeLinearInOut)
end
function shaderColorize(hue, strength, delay)
startTween("shader_colorize",shader_colorize,strength,delay,easeLinearIn)
shader_color=hue
end
shader_viewportTransition = 1.0
shader_oldViewport = { x = 0.0, y=0.0, scale = 1.0, rotate = 0.0}
shader_newViewport = { x = 0.0, y=0.0, scale = 1.0, rotate = 0.0}
shader_interpolationPoint = {x=0.0, y=0.0}
function shaderViewportInterpolationPoint(x,y)
shader_interpolationPoint = {x=x, y=y}
end
function shaderViewport(zoom, x, y, rotation, delay, easing)
shader_viewportTransition = 0.0
shader_oldViewport.x = shader_offsetx
shader_oldViewport.y = shader_offsety
shader_oldViewport.scale = shader_scale
shader_oldViewport.rotate = shader_rotate
shader_newViewport.x = x
shader_newViewport.y = y
shader_newViewport.scale = zoom
shader_newViewport.rotate = rotation
startTween("shader_viewportTransition", 0.0, 1.0, delay,easing)
currentlyZoomedParameters = { zoomFactor = zoom, x = x, y = y, rotationFactor = rotation }
if delay == 0 then return end
end
-- * allows you to pan the camera left or right * --
function shaderPan(offset, delay, easing, axis)
if axis then
startTween("shader_offsety", shader_offsety, offset, delay, easing)
else
startTween("shader_offsetx", shader_offsetx, offset, delay, easing)
end
end
-- * allows you to zoom the camera in or out * --
function shaderZoom(zoom, delay, easing)
startTween("shader_scale", shader_scale, zoom, delay, easing)
end
-- * allows you to rotate the screen (w/ degree instead of pi) * --
function shaderRotate(degree, delay, easing)
degree = (degree / 360 * 2 * 3.14) -- convert degree to pi
startTween("shader_rotate", shader_rotate, degree, delay, easing)
end
-- * function that follows character; only active when loop enabled * --
function followCharacter()
shaderZoomCharacter(shader_follow.name, shader_follow.c_scale, shader_follow.delay, shader_follow.easing)
end
shader_effects = {_temporary_=0,
transition={shader= "sht_transition.bin"} ,
warp1={shader= "sht_warp1.bin"} ,
light1={shader="sht_light.bin"},
tv1 = {shader = "sht_tv1.bin"},
ripple1 = {shader = "sht_ripple1.bin", vars={speed=0.2, speed_x=0.3, speed_y=0.3, intensity=0.0, frequency=6.0}},
ripple2 = {shader = "sht_ripple2.bin"},
ascii = {shader = "sht_ascii.bin"},
edgeglow = {shader = "sht_edgeglow.bin"},
chroma = {shader = "sht_chroma.bin"},
ripple3 = {shader = "sht_ripple3.bin"},
warp2 = {shader = "sht_warp2.bin"},
ripple4 = {shader = "sht_ripple4.bin"},
pearls={shader="sht_pearls.bin"},
highlight={shader="sht_hightlight.bin"},
fourbit={shader="sht_fourbit.bin"},
tv2={shader="sht_tv2.bin"},
tv3={shader="sht_tv3.bin"},
tv4={shader="sht_tv4.bin"}
}
function clamp(a,b,c)
return math.min(math.max(a,b),c)
end
function modf(a)
local a,b = math.modf(a)
return b
end
--[[vector =
{
add = function(a,b) return {a[1]+b[1],a[2]+b[2],a[3]+b[3]} end,
sub = function(a,b) return {a[1]-b[1],a[2]-b[2],a[3]-b[3]} end,
mult = function(a,b) return {a*b[1],a*b[2],a*b[3]} end,
abs = function(a) return {math.abs(a[1]),math.abs(a[2]),math.abs(a[3])} end,
modf = function(a) return {modf(a[1]),modf(a[2]),modf(a[3])} end,
mix = function(a,b,c) return {a[1]*(1-c)+b[1]*c,a[2]*(1-c)+b[2]*c,a[3]*(1-c)+b[3]*c} end,
clamp = function(a,b,c) return {clamp(a[1],b,c),clamp(a[2],b,c),clamp(a[3],b,c)} end
}
function fromHSV(h, s, v)
local K = {1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0}
local p = vector.abs(vector.sub(vector.mult(6.0,vector.modf(vector.add({h,h,h},{K[1],K[2],K[3]}))), {K[4],K[4],K[4]}))
return vector.mult(v, vector.mix({K[1],K[1],K[1]}, vector.clamp(vector.sub(p,{K[1],K[1],K[1]}), 0.0, 1.0), s))
end]]
function standardparam(param, standard)
if param==nil then
return standard
else
return param
end
end
function shaderGlow(on, blurradius, alpha)
if on == 0 then
passesRemove(5,"glow")
shader_glow = on
shader_glowradius = blurradius
shader_glowexp = alpha
else
passesAdd(5,"glow",{{ shader = shaders.glownum(), source=1, target = 2, clear = 0, variable = "shaders.glownum._i_firstpass" },
{ shader = shaders.glownum(), source=2, target = 1, clear = 0 },
{ shader = shaders.glownum(), source=1, target = 2, clear = 0 },
{ shader = shaders.glownum(), source=2, target = 1, clear = 0 },
{ shader = shaders.glownum(), source=1, target = 2, clear = 0 },
{ shader = shaders.glownum(), source=2, target = 1, clear = 0 },
{ shader = shaders.glownum(), source=1, target = 0, clear = 0, comp_dst=1, comp_src=1, variable = "shaders.glownum._i_lastpass" }}) -- 5 4 for cutout
shader_glow = on
shader_glowradius = blurradius
shader_glowexp = alpha
end
end
function shaderRadialGlow(on, blurradius, alpha)
if on == 0 then
passesRemove(6,"rglow")
shader_rglow = on
shader_rglowradius = blurradius
shader_rglowexp = alpha
else
passesAdd(6,"rglow",{{ shader = shaders.rglownum(), source=1, target = 2, clear = 0, variable = "shaders.rglownum._i_firstpass" },
{ shader = shaders.rglownum(), source=2, target = 1, clear = 0 },
{ shader = shaders.rglownum(), source=1, target = 2, clear = 0 },
{ shader = shaders.rglownum(), source=2, target = 0, clear = 0, comp_dst=1, comp_src=1, variable = "shaders.rglownum._i_lastpass" }})
shader_rglow = on
shader_rglowradius = blurradius
shader_rglowexp = alpha
end
end
function shaderActivateLighting(lights)
if(shader_effects.light1.num==nil)then
shader_effects.light1.num = shader("light1", shader_effects.light1.shader)
end
shader_effects.light1.num.resolution = {game.WindowResolution.x, game.WindowResolution.y}
passesAdd(2,"light1",{ { shader = shader_effects.light1.num(), source=1, target = 2, clear = 0 } })
local sh = shader_effects.light1.num
sh.lights_count = lights
end
function shaderDeactivateLighting()
passesRemove(2,"light1")
end
function table.join(t1, t2)
local t3 = {}
local offset = #t1
for k,v in pairs(t1) do
t3[k] = v
end
for k,v in pairs(t2) do
if(type(k)=="string")then
t3[k] = v
else
t3[offset + k] = v
end
end
return t3
end
function shaderLamp(index, type, position, targetpos, falloff, ambient, diffuse, diffusefactor, exponent, cutoff)
local l = "lights["..index.."]."
position[3]=standardparam(position[3],1.0)
targetpos[3]=standardparam(targetpos[3],10.0)
local sh = shader_effects["light1"].num
sh[l.."position"] = position
sh[l.."targetpos"] = targetpos
sh["_i_"..l.."type"] = type
sh[l.."lightfalloff"] = standardparam(falloff,{0.01,0.0001,0.0})
sh[l.."ambient"] = standardparam(ambient,{0,0,0})
sh[l.."diffuse"] = standardparam(diffuse,{1,1,1})
sh[l.."diffusefactor"] = standardparam(diffusefactor,1)
if type==0 then --point light
sh[l.."exponent"] = standardparam(exponent,90)
sh[l.."cutoff"] = standardparam(cutoff,0)
end
end
-- * function that blurs the screen * --
function shaderBlur(strength, delay)
passesAdd(2, "blur", {
{ shader = shaders.bnum(), source=1, target = 2, clear = 0, variable = "shaders.bnum._i_firstpass" },
{ shader = shaders.bnum(), source=2, target = 1, clear = 0},
{ shader = shaders.bnum(), source=1, target = 2, clear = 0 },
{ shader = shaders.bnum(), source=2, target = 1, clear = 0 },
{ shader = shaders.bnum(), source=1, target = 2, clear = 0 },
{ shader = shaders.bnum(), source=2, target = 0, clear = 0, comp_dst=0, variable = "shaders.bnum._i_lastpass" }})
startTween("shader_blur",shader_blur,strength, delay,easeBackInOut)
end
function shaderActivate()
shader_active = true
passesUpdate()
end
function shaderDeactivate()
shader_active = false
passesUpdate()
end
-- Passes
shader_passes = {
{"basic",{renderbuffers = 2, { shader = shaders.num(), source=0, target = 1 }}}, -- basic slot, hue, sat, lightness
{}, -- slot 2 takes many effects
{}, -- slot 3 takes blur
{"composite", {{source = 1, target = 0 }}}, -- slot 4 takes compositing everything
{}, -- slot 5 is for glow
{} -- slot 6 is for radial glow
}
shader_slots = {
{shader = 0, comp_src = 5, comp_dst = 4}
}
function passesRemove(position, id)
if position==2 then -- effects slot
for k,v in pairs(shader_passes[2]) do
if(v[1]==id)then
table.remove(shader_passes[2], k)
break
end
end
else
if shader_passes[position][1]==id then
shader_passes[position]={}
end
end
passesUpdate()
end
function passesAdd(position, id, passes)
if position==2 then -- effects slot
local found = false
for k,v in pairs(shader_passes[2]) do
if(v[1]==id)then
found = true
end
end
if not found then
table.insert(shader_passes[2], {id, passes})
end
else
if(shader_passes[position][1]==nil)then
shader_passes[position]={id, passes}
end
end
passesUpdate()
end
function passesUpdate()
for k,v in pairs(shaders_compiled) do
if(k~="glow" and k~="num" and k~="blur" and k~="rglow" and shader_effects[k].num==nil)then
shader_effects[k].num = shader(k, "", shader_effects[k].shader)
end
end
if shader_active == false then
shaderSetOptions({ { shader = shaders.num(), source=0, target = 0, clear = 0 } })
else
-- composite passes
local worktable = {}
local lastpass = 0
for k,v in pairs(shader_passes) do
if(k==2)then
for k,v in pairs(shader_passes[2]) do
for i,v in pairs(shader_passes[2][k][2]) do
v.source = lastpass + 1
lastpass = (lastpass + 1) % 2
v.target = lastpass + 1
end
worktable = table.join(worktable,v[2])
end
elseif v[2] ~= nil then
if k~=1 then
if k==5 or k==6 then
lastpass = (lastpass + 1) % 2
end
for i,v in pairs(shader_passes[k][2]) do
if type(v)=="table" then
v.source = lastpass + 1
lastpass = (lastpass + 1) % 2
v.target = lastpass + 1
if (k==4 or k==5 or k==6) and i==#shader_passes[k][2] then
v.target = 0
end
end
end
end
worktable = table.join(worktable,v[2])
end
end
for k,v in pairs(worktable) do
if type(v) == "table" and v.variable ~= nil then
load(v.variable.."="..(k-1))()
end
end
shaderSetOptions(worktable)
end
end
function shaderAddEffect(name, _table)
if(shader_effects[name].num==nil)then
shader_effects[name].num = shader(name, shader_effects[name].shader)
if shader_effects[name].vars~=nil then
for k,v in pairs(shader_effects[name].vars) do
shader_effects[name].num[k] = v
end
end
end
passesAdd(2,name,{ { shader = shader_effects[name].num(), source=0, target = 0, clear = 0 } })
local sh = shader_effects[name].num
sh.resolution = {game.WindowResolution.x, game.WindowResolution.y}
bind(name, "time", field("shader_iTime"))
sh.strength=1
if _table~=nil then
for k,v in pairs(_table) do
sh[k] = v
end
end
end
function shaderRemoveEffect(name)
passesRemove(2,name)
unbind(name, "time")
end
function shaderEffectParam(name, param, value)
shader_effects[name].num[param] = value
end
function matrixFastInverse(mat)
local invers = mat * matrix:new({{1,0,0},{0,1,0},{0,0,1}})
invers[1][3], invers[2][3] = invers[3][1], invers[3][2]
invers[3][1], invers[3][2] = 0,0
invers[1][1] = 1 / invers[1][1]
invers[2][2] = 1 / invers[2][2]
invers[1][3] = - invers[1][3] * invers[1][1]
invers[2][3] = - invers[2][3] * invers[2][2]
return invers:transpose()
end
local binding = {active=false, binding = {}}
function shaderMain()
if shaders.c_scene:getId().id~=game.CurrentScene:getId().id then
shaders.c_scene = game.CurrentScene
passesUpdate()
for k,v in pairs(shaders_compiled) do
local sh = shader_effects[k]
if sh ~= nil then
sh = sh.num
elseif k=="glow" then
sh = shaders.glownum
elseif k=="rglow" then
sh = shaders.rglownum
elseif k=="num" then
sh = shaders.num
elseif k=="blur" then
sh = shaders.bnum
end
for k,f in pairs(v) do
sh[k] = f
end
end
end
shader_iTime=shader_iTime+0.0166
if(shader_iTime>2000)then
shader_iTime=0
end
shaders.num.iTime = shader_iTime*0.1
shaders.num.noiseFactor=shader_noiseStrength
shaders.num.weights ={shader_colorize,shader_color}
shaders.num.shader_coeff={shader_coeff0,shader_coeff1,shader_coeff2,shader_coeff3}
if shader_blur==0 and #(shader_passes[3])==1 then
passesRemove(2, "blur")
else
local streng = math.max(shader_blur,0)
shaders.bnum.down = math.max(streng,1)
shaders.bnum.weights={math.min(streng,1)*0.15,1-math.min(streng,1)*(1-0.4)}
shaders.bnum.exposure = 1
end
if shader_glow == 1 then
local streng = math.max(shader_glowradius,0)
shaders.glownum.down = math.max(streng,1)
shaders.glownum.weights={math.min(streng,1)*0.15,1-math.min(streng,1)*(1-0.4)}
shaders.glownum.exposure = shader_glowexp
end
if shader_rglow == 1 then
local streng = math.max(shader_rglowradius,0)
shaders.rglownum.down = math.max(streng,1)
shaders.rglownum.weights={math.min(streng,1)*0.15,1-math.min(streng,1)*(1-0.4)}
shaders.rglownum.exposure = shader_rglowexp
end
if shader_viewportTransition > 0.0 and shader_viewportTransition 0.0) bind = sqrt(dot(m, m));//stick to corners
else {if (prop 0.0)//fisheye
uv = m + normalize(d) * tan(r * power) * bind / tan( bind * power);
else if (power < 0.0)//antifisheye
uv = m + normalize(d) * atan(r * -power * 10.0) * bind / atan(-power * bind * 10.0);
else uv = p;//no effect for power = 1.0
vec3 col = texture2D(iChannel0, vec2(uv.x, uv.y * prop)).xyz;//Second part of cheat
//for round effect, not elliptical
fragColor = vec4(col, 1.0);
}
void main()
{
vec4 color;
mainImage(color, texcoord.xy*iResolution.xy);
gl_FragColor = color;
}
]]}
22:49:19.369:Scripts loaded. Needed time: 5 ms
22:49:19.369:Time needed for loading game: 157 msec
22:49:19.369:-- * --
22:49:19.369:config.ini exists
22:49:19.369:retrieving settings from config.ini
22:49:19.369:file is currently linked to Data.vis
22:49:19.369:window mode is currently set to Windowed
22:49:19.369:resolution is currently set to Auto
22:49:19.369:subtitles are currently set to On
22:49:19.369:text language is currently set to Russian
22:49:19.369:spoken language is currently set to Russian
22:49:19.369:fx quality is currently set to High
22:49:19.369:color blind mode is currently set to Off
22:49:19.369:log level is currently set to Error
22:49:19.369:music volume = 100
22:49:19.369:sound volume = 100
22:49:19.369:speech volume = 100
22:49:19.369:movie volume = 100
22:49:19.369:global volume = 100
22:49:19.369:successfully retrieved settings from config.ini
22:49:24.398:Failed to initialize the composed file 'Scene002.vs'. Could not open.
22:49:29.933:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.975:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.976:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.976:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.002:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.003:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.003:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.005:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.005:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.005:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.014:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.015:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.015:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.016:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.017:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.017:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.037:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.038:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.041:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.046:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.070:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.071:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.076:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.098:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.099:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:29.105:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:30.953:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:31.231:Failed to initialize the composed file 'Scene045.vs'. Could not open.
22:49:31.234:Serialization finished. Needed time: 1 ms
22:49:31.234:SetupParents finished. Needed time: 0 ms
22:49:31.234:SortLinks finished. Needed time: 0 ms
22:49:31.236:Serialization finished. Needed time: 0 ms
22:49:31.236:SetupParents finished. Needed time: 0 ms
22:49:31.236:SortLinks finished. Needed time: 0 ms
22:49:31.237:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.238:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.238:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.238:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.239:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.239:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.239:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.239:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.240:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.240:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.240:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.240:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.241:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.241:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.241:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.242:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.242:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.242:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.242:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.243:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.243:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.243:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.243:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.244:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.244:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.244:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.245:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.245:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.245:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.245:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.246:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.246:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.246:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.246:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.247:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.247:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.247:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.247:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.248:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.248:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.248:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.248:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.249:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.249:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.249:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.249:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.250:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.250:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.250:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.250:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:31.250:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:32.739:Failed to initialize the composed file 'Scene014.vs'. Could not open.
22:49:32.786:Failed to initialize the composed file 'Character000.vc'. Could not open.
22:49:32.786:Failed to initialize the composed file 'Scene014.vs'. Could not open.
22:49:32.787:Failed to initialize the composed file 'Scene012.vs'. Could not open.
22:49:32.795:Failed to initialize the composed file 'Scene012.vs'. Could not open.
22:49:32.308:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:32.308:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:32.309:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:32.309:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:32.309:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:32.310:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:32.310:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:32.311:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:32.311:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:32.311:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:33.871:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:33.225:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:33.350:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:33.350:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:33.350:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:33.351:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:33.351:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:33.352:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:33.352:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:33.352:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:33.353:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:33.353:Failed to initialize the composed file 'Interfaces.vi'. Could not open.
22:49:34.142:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.174:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:34.174:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:34.175:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:34.199:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.200:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.200:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.200:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:34.201:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.201:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:34.201:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.202:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:34.210:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.211:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.212:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.213:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.214:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.215:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.216:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.216:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.217:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.218:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.218:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.219:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.235:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.235:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:34.238:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.238:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:34.238:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.239:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:34.266:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.266:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:34.266:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:34.267:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:34.272:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:34.293:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:34.299:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:34.301:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:35.759:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:35.808:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:35.884:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:35.044:Failed to initialize the composed file 'Scene005.vs'. Could not open.
22:49:36.738:-- * --
22:49:36.738:writing new settings to config.ini
22:49:36.739:new settings successfully written to config.ini
22:49:36.739:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.776:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.776:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.777:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.801:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.802:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.802:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.804:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.804:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.804:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.812:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.812:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.813:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.814:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.814:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.816:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.818:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.837:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.838:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.849:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.866:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.869:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.875:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.896:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.896:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.901:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:36.502:Failed to initialize the composed file 'Scene004.vs'. Could not open.
22:49:37.725:Failed to initialize the composed file 'Scene006.vs'. Could not open.
22:49:37.756:Failed to initialize the composed file 'Scene006.vs'. Could not open.
22:49:37.756:Failed to initialize the composed file 'Scene045.vs'. Could not open.
22:49:37.756:Failed to initialize the composed file 'Scene006.vs'. Could not open.
22:49:37.127:Failed to initialize the composed file 'Scene006.vs'. Could not open.
22:49:37.128:Failed to initialize the composed file 'Scene006.vs'. Could not open.