After some serious debugging it seems that you cannot adjust a filter parameter in a multi-pass filter unless all are adjusted together.
The code:
[lua]
local function setUpFilter()
local kernal = {}
kernal.language = “glsl”
kernal.category = “filter”
kernal.name = “blurFx”
kernal.graph = {}
kernal.graph.nodes =
{
horizontal = { effect = “filter.blurHorizontal”, input1 = “paint1” },
vertical = { effect = “filter.blurVertical”, input1=“horizontal” },
}
kernal.graph.output = “vertical”
graphics.defineEffect( kernal )
local photo = display.newImage( “photobig.jpg” )
photo.x = display.contentCenterX
photo.y = display.contentCenterY
photo.fill.effect = “filter.blurFx”
photo.fill.effect.horizontal.blurSize = 200
photo.fill.effect.vertical.blurSize = 0
--after brief delay, update the parameters
local function onChangeParameter()
photo.fill.effect.horizontal.blurSize = 0
photo.fill.effect.vertical.blurSize = 0
end
timer.performWithDelay( 1000, onChangeParameter )
end
setUpFilter()
[/lua]
The code above works as one would expect. After a second delay, the horizontal blurSize is set to 0, and is visually updated.
Now, if you comment out the second line in the onChangeParameter method, the first line seems to no longer trigger an update on the parameter.
[lua]
--after brief delay, update the parameters
local function onChangeParameter()
photo.fill.effect.horizontal.blurSize = 0
--photo.fill.effect.vertical.blurSize = 0
end
timer.performWithDelay( 1000, onChangeParameter )
[/lua]
In the above example, the horizontal blurSize is never updated visually. The results are the same when trying other filter combinations as well as different parameter values.
You can view a screencast here.
Is this the way this functionality is supposed to operate? Or am I doing something incorrectly?
Best.
Build 2047 - Windows 8.1