PostFX - Shader based post processing library

PostFX is a simple post effects library for processing. Post effects are applied to the whole scene after it was rendered, to enhance the scene with some special effects. For example the bloom effect helps to simulate the light diffusion to be more realistic.

PostFX

For more information on how the library works and how to use it, check the github page of it:

github.com/cansik/processing-postfx

Comments

  • At the moment (v1.0), only a few shaders are implemented. For the next release I am planning to add much more effects and shaders, from color correction to pixel effects.

    If you have an idea for an interesting shader just write a request here and I will check if I can add it to the library. Currently planned are the following:

    Color

    • Brightness and Contrast Shader
    • Invert Shader
    • Grayscale Shader
    • LUT Shader (nice to have)

    Reconstruction

    • Denoise Shader

    Effects

    • Bloom Shader
    • Pixelate Shader by prince_polka
    • Chromatic aberration shader
    • Noise Shader
    • Vignette Shader
    • RGB Split Shader

    An actual list of the new shaders can be found here:

    github.com/cansik/processing-postfx/issues/3

    Also, I know that there is a bug in some shaders which causes OpenGL to output following message:

    OpenGL error 1282 at bot endDraw(): invalid operation

    As far as I know this is related to the graphic card driver, but I am currently working on it.

  • There was a shader provided by @quark that might interest you as well: https://forum.processing.org/two/discussion/comment/81167/#Comment_81167

    Kf

  • edited May 2017

    I am happy to announce that I released version 1.1 today!

    Version 1.1 brings a lot of new features to post processing library. First of all a bunch of new shaders have been added to the library, which are useful for 3D and 2D scenes. Here is a list of the new shaders:

    Color

    • Brightness and Contrast Shader
    • Saturation and Vibrance Shader
    • Invert Shader
    • Grayscale Shader

    Reconstruction

    • Denoise Shader

    Effects

    • Bloom Shader
    • Pixelate Shader
    • Chromatic aberration shader
    • Noise Shader
    • Vignette Shader
    • RGB Split Shader

    Effects

    The second new thing is, that the library now works on the default graphics object (onscreen buffer g with P2D and P3D). So now it is not needed to draw your scene onto a canvas anymore. Just run following code:

    // in setup
    PostFX fx = new PostFX(this);
    
    // in draw
    fx.render()
      .invert()
      .compose();
    

    It is also possible now to preload shaders, to run initialisation in the setup method:

    fx.preload(InvertPass.class);

    And I also implemented a way to simply run your own custom passes:

    // in draw
    fx.render()
      .custom(myCustomPass)
      .compose();
    

    I hope the library works as expected! If you have any suggestion just write me here or leave a new issue in github!

  • Congrats on this work. A major contribution! And just a reminder to all, PostFX is on the libraries page under utilities:

    ...and can be found in the PDE Contributions Manager (although that version number isn't always up-to-the-minute -- and you may need to restart PDE).

  • edited May 2017

    Hi @cansik is this the right place to post about issues using PostFX?

    I'm having some problems implementing texture feedback in a custom pass (more details in this thread https://forum.processing.org/two/discussion/22508/chaining-shaders-and-feedback#latest ).

    a|x

  • edited May 2017

    @cansik Hi, hope you don't mind me cross-posting, but is this the best (fastest) way to implement texture feedback in a custom PostFX pass definition?

            pass.loadPixels();
            previousTexture.loadPixels();
            arrayCopy(pass.pixels, previousTexture.pixels);
            pass.updatePixels();
            previousTexture.updatePixels();
    

    a|x

  • edited May 2017

    @cansik incidentally, I get an error

    OpenGL error 1282 at top endDraw(): invalid operation

    every time I run my sketch, when using PostFX passes.

    a|x

  • @toneburst Yes the OpenGL error is a bit annoying. It happens only with some shaders, but I did not have time to investigate it. But as far as I know it's more a warning then a real error. I have it on track here (it was the first issue I added ;) ):

    https://github.com/cansik/processing-postfx/issues/1

    Copying pixels around (loadpixels / updatepixels) is very slow. Try to avoid it. It simpler to draw the texture on to the other with the image(img, x, y) method:

    pass.beginDraw();
    // also apply shader if you want to process the drawn texture
    // pass.shader(myShader);
    pass.image(previewsTexture, 0, 0);
    pass.endDraw();
    

    I hope that helps :) This does the same as the filter() method with a shader.

  • There is an error in running the example codes of PostFX library, the error is: InvalidPathException: Illegal char <:> Please help me how to resolve this???????! processing1 AdvancedEffect, CustomShaderEffect, OffScreenEffect, ReadMeRendering, and SimpleEffect are not running.

  • @first Would be nice if you could add more information and maybe open an issue for that on github. You are working on Windows right?

    I can not test it at the moment on a windows machine. I will do it if I have the possibility.

  • @koogs thank you for the link.

Sign In or Register to comment.