Where is the multipass effect shader Tutorial ?

Hello all,

I’ve been trying to search for this turorial : https://coronalabs.com/blog/2013/10/17/tutorial-multi-pass-shaders-in-graphics-2-0/

But it return page not found.

I am trying to find how to apply multiple effect filters on the same image.

thanks
Nick

Corona decided to rework their website and apparently many older articles no longer work, for some technical reason.

It’s not optimal and perhaps your inquiry will lead to this particluar one being re-connected, but it’s 5 years old so, i dont know.

I’m not sure where that tutorial is on the list to bring back to life. We are moving our tutorials out of our blog and into our documentation system so they can be better supported. Our blog doesn’t handle code well and after several iterations of website-redo’s, the code formatting is bad. Also older tutorials are suspect to not be valid any more. This one probably should be retained, I just don’t know right away where it is in the queue.

Rob

Does this guide help you? It goes into considerable depth on shaders…

https://docs.coronalabs.com/guide/graphics/customEffects.html

Brent

I second what Rob says.

I find myself using Corona documentation all the time because it is well made, extensive and up to date, and easily accessible.

Internet search results are seldom any of those.

Improving it further with added depth is music to my ears (eyes?)

Hi Brent,

Unfortunately no, the documentation focus on writing shaders (which is great and I know how to), I was asking if there is a trick to chain a few default effects in a row to apply on an image.

For example, apply on my image object a filter.brightness, follow by a filter.hue and then with a filter.vignette to get a specific result ?

Thanks for you help,
Nick

there is always the apply, capture, apply, capture, apply method

crude and probably not for very time sensitive applications

easier and faster tho, if it give the result one is looking for.

There is Google and there is the Wayback Machine :

https://web.archive.org/web/20131022234343/http://coronalabs.com:80/blog/2013/10/17/tutorial-multi-pass-shaders-in-graphics-2-0/

I hope this is what you’ve been looking for. There are more examples on this topic in the forum. Best search via Google. :slight_smile:

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]

Corona decided to rework their website and apparently many older articles no longer work, for some technical reason.

It’s not optimal and perhaps your inquiry will lead to this particluar one being re-connected, but it’s 5 years old so, i dont know.

I’m not sure where that tutorial is on the list to bring back to life. We are moving our tutorials out of our blog and into our documentation system so they can be better supported. Our blog doesn’t handle code well and after several iterations of website-redo’s, the code formatting is bad. Also older tutorials are suspect to not be valid any more. This one probably should be retained, I just don’t know right away where it is in the queue.

Rob

Does this guide help you? It goes into considerable depth on shaders…

https://docs.coronalabs.com/guide/graphics/customEffects.html

Brent

I second what Rob says.

I find myself using Corona documentation all the time because it is well made, extensive and up to date, and easily accessible.

Internet search results are seldom any of those.

Improving it further with added depth is music to my ears (eyes?)

Hi Brent,

Unfortunately no, the documentation focus on writing shaders (which is great and I know how to), I was asking if there is a trick to chain a few default effects in a row to apply on an image.

For example, apply on my image object a filter.brightness, follow by a filter.hue and then with a filter.vignette to get a specific result ?

Thanks for you help,
Nick

there is always the apply, capture, apply, capture, apply method

crude and probably not for very time sensitive applications

easier and faster tho, if it give the result one is looking for.

There is Google and there is the Wayback Machine :

https://web.archive.org/web/20131022234343/http://coronalabs.com:80/blog/2013/10/17/tutorial-multi-pass-shaders-in-graphics-2-0/

I hope this is what you’ve been looking for. There are more examples on this topic in the forum. Best search via Google. :slight_smile: