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; }
brightPass.setThreshold(threshold); brightPass.prepare(supervisor); 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); }
/** * Run a bloom effect on the texture. * * @param threshold Luminance threshold. * @param blurSize Size of the blur. * @param sigma Sigma of the blur. * @return Builder object. */ public PostFXBuilder bloom(float threshold, int blurSize, float sigma) { BloomPass pass = getPass(BloomPass.class); pass.setThreshold(threshold); pass.setBlurSize(blurSize); pass.setSigma(sigma); supervisor.pass(pass); return this; }
/** * Run a vignette pass on the texture. * * @param amount Amount of the vignette effect. * @param falloff Fall off of the vignette effect. * @return Builder object. */ public PostFXBuilder vignette(float amount, float falloff) { VignettePass pass = getPass(VignettePass.class); pass.setAmount(amount); pass.setFalloff(falloff); supervisor.pass(pass); return this; }
/** * Run a brightness and contrast correction pass on the texture. * * @param brightness Amount of brightness to add to the picture (default 0.0). * @param contrast Contrast of the image (default 1.0). * @return Builder object. */ public PostFXBuilder brightnessContrast(float brightness, float contrast) { BrightnessContrastPass pass = getPass(BrightnessContrastPass.class); pass.setBrightness(brightness); pass.setContrast(contrast); supervisor.pass(pass); return this; }
/** * Run a noise pass on the texture. * * @param amount Amount of the noise effect. * @param speed Speed of the noise effect. * @return Builder object. */ public PostFXBuilder noise(float amount, float speed) { NoisePass pass = getPass(NoisePass.class); pass.setAmount(amount); pass.setSpeed(speed); supervisor.pass(pass); return this; }
/** * Run a saturation and vibrance correction pass on the texture. * * @param saturation Amount of saturation to add to the picture (default 0.0). * @param vibrance Vibrance of the colors (default 0.0). * @return Builder object. */ public PostFXBuilder saturationVibrance(float saturation, float vibrance) { SaturationVibrancePass pass = getPass(SaturationVibrancePass.class); pass.setSaturation(saturation); pass.setVibrance(vibrance); supervisor.pass(pass); return this; }
public BasePass(PApplet sketch, String passName) { this.sketch = sketch; shader = sketch.loadShader(Paths.get(getLibPath(), "shader", passName + ".glsl").toString()); }
/** * Run a RGB split pass on the texture. * * @param delta Delta of the rgb split effect. * @return Builder object. */ public PostFXBuilder rgbSplit(float delta) { RGBSplitPass pass = getPass(RGBSplitPass.class); pass.setDelta(delta); supervisor.pass(pass); return this; }
/** * Run an exposure pass on the texture. * * @return Builder object. */ public PostFXBuilder exposure(float exposure) { ExposurePass pass = getPass(ExposurePass.class); pass.setExposure(exposure); supervisor.pass(pass); return this; }
/** * Run an tone mapping pass on the texture. * * @return Builder object. */ public PostFXBuilder toneMapping(float gamma) { ToneMappingPass pass = getPass(ToneMappingPass.class); pass.setGamma(gamma); supervisor.pass(pass); return this; }
/** * Run a bright pass pass on the texture. * * @param threshold Threshold of the brightness. * @return Builder object. */ public PostFXBuilder brightPass(float threshold) { BrightPass pass = getPass(BrightPass.class); pass.setThreshold(threshold); supervisor.pass(pass); return this; }
/** * Run a pixel effect pass on the texture. * * @param amount Amount of the pixel effect. * @return Builder object. */ public PostFXBuilder pixelate(float amount) { PixelatePass pass = getPass(PixelatePass.class); pass.setAmount(amount); supervisor.pass(pass); return this; }
/** * Run a denoise pass on the texture. * * @param exponent Exponent of the denoise effect. * @return Builder object. */ public PostFXBuilder denoise(float exponent) { DenoisePass pass = getPass(DenoisePass.class); pass.setExponent(exponent); supervisor.pass(pass); return this; }
/** * Run a binary glitch pass on the texture. * * @param strength Size of the binary glitch windows. * @return Builder object. */ public PostFXBuilder binaryGlitch(float strength) { BinaryGlitchPass pass = getPass(BinaryGlitchPass.class); pass.setStrength(strength); supervisor.pass(pass); return this; } }