Multipass Shader Example

edited December 2016 in GLSL / Shaders

Is there somewhere a multipass rendering example for processing 3.0? Like a bloom effect or something like that. I tried now for a long time with the processing advanced GL example using PJOGL but I think I need maybe an example to continue.

Best regards Florian


  • I implemented now my own bloom effect. It uses multiple PGraphics and PTextures objects. With these I can make something like a multipass shader.

    The only thing which is not performant at the moment is the blur, but I am working on it (I just have to convert the color shader into a texture shader).

    Check it out here:

  • Great, thxs for sharing. Quick question, what is the learning curve implementing this type of shaders in Processing considering also the learning curve associated to create shader glsl files?


  • Now it is running smooth with 60 FPS. I will create a simple class which applies the post fx after the content creation.

    Shader programming is the same in processing / opengl. The difficulty depends on the problem you would like to solve. Check out the book of shaders! It's a great tutorial.

  • @cansik Thank you for the link to the book!

  • You're welcome!

    I've now added an example which shows how to use the effect very easy in your sketch. The only thing you have to do is to use a new PGraphics3D.

    PostFX fx = new PostFX(width, height);
    // bloom filter
    PGraphics result = fx.filter(canvas)
        .blur(20, 50, false)
        .blur(20, 50, true)
  • Might you be knowing when the book will get furthered? I wish to read the rest of it.

  • I'm sorry I don't know it. But I finally had some time to write a real processing library for the post effects, with multi pass rendering.

    Check it out here:

  • Good job. While the advanced effects part of it only barely reduces our work, the "basic" alone is superb.

    P.S. Write to Elie Zananiri to add your library to the list. But check out this page and do what it tells you to.

  • @Lord_of_the_Galaxy Contributing the library is a good idea, thank you, but I think I will need to setup a more stable test system first, because I did not have to time to do that during development.

    And I would like to support more effects, like all the basic shader effects.

    So is it working on your system?

  • Not tested yet. In one week's time, I'll give you a detailed report. Till then, @kfrajer may be able to help you.

Sign In or Register to comment.