Some ShaderToy shaders converted for Processing

Hi all

Sharing some of the shaders I have converted from ShaderToy to work with Processing 3... Will be adding more as I do them.

Currently there is:

  • 3 types of VHS effect
  • Glitch
  • Sobel edge detection with neon outline
  • Convert different colours to different ASCII characters

https://github.com/georgehenryrowe/ShadersForProcessing3

:)

Tagged:

Comments

  • Thxs for sharing. Tagging @nabr.

    Kf

  • edited January 2018

    Yeah, nice!

    You could teak it a bit, if you like to.
    Shadertoy using WebGL 2.0 means #version 300 es.
    Default in processing OpenGL version 120 or #version 100 es.

    Means gl_Fragcolor is deprecated. It works in Java, and this is great. I don't think this is a performance lost. But you know, just to be nice to the compiler ... So the best way would be if you copy +paste a String befor every shader, like shadertoy. with the version and the main function.

    Second if you not going to use a 3D Shape like a cube, sphere -
    you don't really need to do a Post Processing step like processing's filter() method. This will read all pixels form the Framebuffer -->make a rect -->send it to the shaders -->Colorbuffer, calling shader() and rect() directly will be a performance boost.

    @cansik have a nice lib for this kind of stuff, make a pull
    https://github.com/cansik/processing-postfx

  • @nabr Great idea to PL these shaders into the library. I've added the binary glitch as example:

    BinaryGlitchPass

    binaryGlitchFrag.glsl

    I've taken a look over the shaders you converted and it seems that you have a lot of unused variables declared. And as @nabr already mentioned, it is necessary to run the shaders with GLSL v120, because of compatibility.

  • @kfrajer no worries, thought I should share rather than just being a lurker.

    @nabr thanks for the info, I didn't know either of those things. I'm pretty new to GLSL - what I was using these for did use 3D shapes, but I'll try on 2d and see if I get a performance increase.

    @cansik Yeah I was being lazy and copy-pasting a chunk which covered all the variables used in the most complex examples as I was part way through delivering something :) Will tidy them up.

    Thanks for the feedback y'all.

  • edited April 2018

    Great work. Would be great to see examples of the shaders being used on a gif hosting website like gyfcat, or even some example sketches. Also, do you know any resources for how to learn how to port shaders?

Sign In or Register to comment.