Where is the multipass effect shader Tutorial ?

Thank you Fendrick, this is exactly what I was looking for.

However, after testing this example and looking at Corona doc, it seems that there is no support for  kernel.graph feature.

Corona, can you confirm this is not possible anymore or there is another way ?

kernel.graph = { nodes = { horizontal = { effect="filter.blurHorizontal", input1="paint1" }, vertical = { effect="filter.blurVertical", input1="horizontal" }, }, output = "vertical", }

thanks

You can look at this sample:

https://github.com/coronalabs/samples-coronasdk/tree/master/Graphics/FilterGraphDemo

And see if that will help you.

Rob

Hi.

I’m using multi-pass with the kernel.graph machinery and all. Did you do the rest of the shader boilerplate as well, along with graphics.defineEffect ()?

My second example here runs through the gamut of built-ins that have some effect with their default parameters: postprocessing Do those work on your end?

One thing that stands out in the old link is that the name being assigned to the effect doesn’t include a group, i.e. it’s “filter.X” rather than “filter.group.X”.

Thanks both of you, its now working perfectly, indeed the bug was filter.group… 

Glad you figured it out. I made small demo project to show it works

https://gist.github.com/Shchvova/068e64f84671a5ab9ee28aedf53c290e

[lua]

display.setStatusBar( display.HiddenStatusBar )

local effect = {

    language = “glsl”,

    category = “filter”,

    name = “graphDemo”,

    graph = 

    {

        nodes = {

            dotted  =   { effect=“filter.polkaDots”, input1=“paint1” },

            dotted2 =   { effect=“filter.blur”, input1=“dotted” },

            bulged  =   { effect=“filter.bulge”, input1=“dotted2” },

        },

        output = “bulged”,

    },

}

display.loadRemoteImage( “https://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png”, “GET”, function( event )

    if ( event.isError ) then

        print ( “Network error - download failed” )

        return

    end

    local image = event.target

    local r = image.width/image.height

    if display.contentWidth/display.contentHeight > r then

        image.height = display.contentHeight*0.8

        image.width = image.height*r

    else

        image.width = display.contentWidth*0.8

        image.height = image.width/r

    end

    graphics.defineEffect( effect )

    image.fill.effect = “filter.custom.graphDemo”

    image.fill.effect.bulged.intensity = 0.85

    image.fill.effect.dotted.numPixels = 8

    image.fill.effect.dotted.dotRadius = 1

    image.fill.effect.dotted.aspectRatio = ( image.width / image.height )

    timer.performWithDelay( 2000, function(  )

        Runtime:addEventListener( “enterFrame”, function( e )

            image.fill.effect.bulged.intensity = 0.85 + math.abs(math.sin(e.time*0.001)*0.2)

        end )

    end )

    

end, “lenna.png”, display.contentCenterX, display.contentCenterY )

[/lua]