Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Post Processing Effects to the Language #19

Open
darrenmothersele opened this issue Sep 12, 2014 · 10 comments
Open

Add support for Post Processing Effects to the Language #19

darrenmothersele opened this issue Sep 12, 2014 · 10 comments

Comments

@darrenmothersele
Copy link
Member

This commit includes an attempt to add basic support for post processing FX to the language. Needs a lot of refactoring, and I think there's still a memory leak due to the post processing object being in the state object and not cleaned up correctly. I think need to introduce a global state singleton.

Not ready for release, but if you want to test build from this commit:
a8697e8

Added to the language:

fxK 3

This enables the Kaleidoscope effect, takes 1 argument which is the number of segments.

fxNW 0.4, 0.4, 0.4

This enables the noise warp effect and takes 3 arguments: Speed, amplitude and frequency.

FX are on by default, Turn them on and off with CMD + z

Also still need to look at why ofxPostProcessing inverts the output when enabled.

@danhett
Copy link

danhett commented Sep 14, 2014

There's a "flip" toggle inside PostProcessing.cpp, which I manually changed in my local copy. Not sure if it has any other ramifications, or if it was set to default to that for a good reason, but it didn't seem to cause any issue.

@darrenmothersele
Copy link
Member Author

I've added call to setFlip() when initialising ofxPostProcessing...

_state.post.setFlip(false);

@darrenmothersele
Copy link
Member Author

PixelatePass doesn't have a setResolution() method, as I would expect. Other FX have methods to get/set the parameters of the FX.

@darrenmothersele
Copy link
Member Author

Created a fork of ofxPostProcessing that allows the resolution of Pixelate filter to be changed via getter/setter and allows width/height of output to be set without having to reinitialise the ofxPostProcessing object.
https://github.com/darrenmothersele/ofxPostProcessing

@darrenmothersele
Copy link
Member Author

Created pull request in original ofxPostProcessing repo
neilmendoza/ofxPostProcessing#12

@darrenmothersele
Copy link
Member Author

Just committed this: 4d439fa

Added parameter to bloom (glow) post processing effect, which also required extra addition of setter methods to BloomPass and ConvolutionPass in ofxPostProcessing - best to use my fork of ofxPostProcessing

@darrenmothersele
Copy link
Member Author

so, the effects now supported are:

Kaleidoscope

fxK
fxK [segments]

NoiseWarp

fxNW
fxNW [speed], [amplitude], [frequency]

Pixelate

fxP 
fxP [resolution]
fxP [resX], [resY]

Bloom (glow)

fxB
fxB [amount]

Note each fx command has version without params for default values.

@darrenmothersele
Copy link
Member Author

cmd + z turns ofxPostProcessing on and off.

When post processing effects are enabled the output quality is reduced. This is more noticeable when you have it enabled (as per default settings when loading) but not FX are enabled in the code.

@darrenmothersele
Copy link
Member Author

Had a suggestion to move the shaders out to data files and reference them from settings file. Will require a more abstracted way of loading shaders than ofxPostProcessing.

@danhett
Copy link

danhett commented Mar 14, 2015

Massively late to the party on this one, but the inlined commands are really good - being able to switch up on the fly is really really useful. Last time I used Cyril in a live setting I ended up having multiple copies running with different effects running, as everything was external. This is infinitely better.

The others I use a lot are tilt-shift and the toon shader, I might see if I can patch those into my fork for now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants