neilmendoza / ofxPostProcessing

This openFrameworks addon gives you an easy way of putting together a chain of GLSL post-processing effects.
www.neilmendoza.com/ofxpostprocessing
346 stars 84 forks source link

NoiseWarp parameters #3

Closed vibber closed 11 years ago

vibber commented 11 years ago

Hi there, I'd love to use the noiseWarpPass and be able to tweak the parameters. Everything seems to be there in the class but I can't seem to figure out how to access e.g. setFrequency and getFrequency. I tried to call them statically and I tried new'ing an object but no luck. If you could write an example including how to use createPass the parameters of noiseWarpPass I would be very grateful...

vibber commented 11 years ago

And thank you for this library :-)

vibber commented 11 years ago

OK I got a little closer I think. I am tinkering with your example code. Did this:

noise = post.createPass<NoiseWarpPass>();
noise->setSpeed(10.f);
noise->setEnabled(false);

But it doesn't seem to have any effect on the speed.

vibber commented 11 years ago

OK consider this a bug report :-)

inside NoiseWarpPass.cpp

    shader.setUniform1f("frequency", 4);
    shader.setUniform1f("amplitude", 0.1);
    shader.setUniform1f("speed", 0.1);

should be

    shader.setUniform1f("frequency", this->frequency);
    shader.setUniform1f("amplitude", this->amplitude);
    shader.setUniform1f("speed", this->speed);
neilmendoza commented 11 years ago

Thanks for pointing that out.