public BloomPass(PApplet sketch) { this.sketch = sketch; blurPass = new BlurPass(sketch); brightPass = new BrightPass(sketch); }
/** * Run a blur pass on the texture. * * @param blurSize Size of the blur. * @param sigma Sigma of the blur. * @param horizontal Indicates if the pass runs horizontal or vertical. * @return Builder object. */ public PostFXBuilder blur(int blurSize, float sigma, boolean horizontal) { BlurPass pass = getPass(BlurPass.class); pass.setBlurSize(blurSize); pass.setSigma(sigma); pass.setHorizontal(horizontal); supervisor.pass(pass); return this; }
blurPass.setBlurSize(blurSize); blurPass.setSigma(sigma); blurPass.setHorizontal(true); blurPass.prepare(supervisor); blurPass.setHorizontal(false); blurPass.prepare(supervisor);
public void setup() { frameRate(FRAME_RATE); supervisor = new PostFXSupervisor(this); brightPass = new BrightPass(this, 0.3f); blurPass = new BlurPass(this, 40, 12f, false); sobelPass = new SobelPass(this); fx = new PostFX(this); fx.preload(VignettePass.class); canvas = createGraphics(width, height, P3D); // load test image lenna = this.loadImage("data/Lenna.png"); hdrImage = this.loadImage("data/hdr.jpg"); // initialise pass results passResult = createGraphics(width, height, P2D); }