Giter Site home page Giter Site logo

pierrextardif / ofxavpostprocessing Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 111.31 MB

local addon of Post Processing effects to use on divers elements during post processing phase

License: MIT License

Makefile 7.91% C 0.68% C++ 85.93% GLSL 5.24% QML 0.24%

ofxavpostprocessing's Introduction

ofxShaderGltich

Glitch Shader generator In Openframeworks.


The goal is to easily create glitch effects in OF // use this as a starting point to customise glitch effects. It uses a set of masks, and image processing effects to create glitchy effects.
The result is a mix of effects applied to an image / Fbo, which is my take on how to create glitchy effects for real time use.


.


Getting Started

Installs

1)Installing OpenFrameworks

Get the latest OpenFrameworks version from here(0.11.0).

2) Installing

Add this repository to your addons folder, or to the local_addons folder.
If using the local_addons folder, make sure the pre processing #define LOCALADDON is present in the constants.h and in main.frag.
If using the addons folder, make sure the pre processing #define LOCALADDON is commented in the constants.h and in main.frag.


The only dependecy is [ofxAutoReloadedShader](https://github.com/andreasmuller/ofxAutoReloadedShader) from [Andreas Muller](https://github.com/andreasmuller), used to reload shader on the fly to help compiling only shaders.

The addon works by treating the texture the way OF does it : rectangular textures processed from 0 -> size of the texture in OF, rather than normalised textures coordinates.

Example

Just try running the example.

Press g to show/hidde the gui. Press i to change the type of input - webcam or image. There is 2 main sections in the gui : Type of Tyling and Type of Effect.

Effects

The glitches are created with 2 sections : tiling and effects. The tiling create patterns on which to apply the effects.

There is 10 tiles and 10 effects.

Tiling :

1 - > 4 : divisions on screen controlled by the . .
4 : sections are controlled by the Cell -> offset x//y : .
5 - > 9 : patterns generation - parameters to control are : Mask Layers for tyling 5, thresholdNoise for tyling 6, continuous for 7->9.
Speed.y is controlling the speed of the effects for tyling 5 -> 9.
RectangleSize controls the gradiant rect boundaries, and gradiantColor controls its color.

10 : makes the effect apply to the whole screen.
Tyling is processed in the main.frag by setting up the prop variable.

Effects :

0 : glitch
1 : texture Shift - works best withj tyling 7.
2 : texture shift prop - shift on texture proportional to prop. Works best with tyling 8.
3 : lateral shift : shift the texture horizontally following the amnt of lines // columns, to change the direction to horizontal, change the last argument of lateralSlider to true.
4 : shift with noise per cell direction change controlled by continuous. 5 & 6 : grad center + inner flip coords - rect boundaries are controlled by the rectangle size, and the amount of sections by amnt of lines // columns. The functions texFlipV in main.frag are used here, with the last 2 arguments adding a flip on the section coordinate, and a gradiant on the rectangle ( in this case true and true, therefore grad + flip is processed on the image).

7 : bright lines sections of lines of different colors. the first argument gives the direction of the lines - in this case y -. The parameter continuous de activates the thresholding on gb, if ON, which makes it go less flashy. The Mask Layers control the amount of colors layers added. Works best with 2 layers.
8 : background color // invert background color - outside pattern detection.
9 : gradiant color controlled by rectangle size and gradiant color, and alphaGradiant.
10 : gradiant color + invert same as above with inverted color for inner rectangle section.



Feedback is used to create a feedback on the edges used in the edge detection:

.
This technic uses the strength and angle from the Cannny Edge detection seperatly implemented here, and returns an intensity of the edges which is processed in a feedback shader to get a trailing effect. works best with the webcam. The feedback turns the effects and tilying to -1, as to not interfer with the rest of the shader. There is also an Edge detection function (not used) which works with key c to control the non Maximum of the edge detection and continuity of the pixels value when in between threshold values by checking the neighboors values, when the nonMaxAndContinuity is turned ON ( initialised OFF).

Author

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments

ofxavpostprocessing's People

Contributors

pierrextardif avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.