Skip to content

Instantly share code, notes, and snippets.

@sgnm
Last active March 14, 2018 08:07
Show Gist options
  • Save sgnm/4b1deff864506cb40fc7dd8181f8233a to your computer and use it in GitHub Desktop.
Save sgnm/4b1deff864506cb40fc7dd8181f8233a to your computer and use it in GitHub Desktop.
Easy bloom effect using ofxBlur
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup()
{
ofBackground(0);
ofSetFrameRate(60);
ofDisableBlendMode();
blur.setup(ofGetWidth(), ofGetHeight(), 10, .2, 4);
fbo.allocate(ofGetWidth(), ofGetHeight(), GL_RGBA);
}
//--------------------------------------------------------------
void ofApp::draw()
{
fbo.begin();
{
ofClear(0);
ofDrawCircle(ofGetWidth()/2, ofGetHeight()/2, 100);
}
fbo.end();
blur.begin();
{
ofClear(0);
fbo.draw(0,0);
}
blur.end();
blur.draw();
ofPushStyle();
{
ofEnableBlendMode(OF_BLENDMODE_ADD);
fbo.draw(0,0);
}
ofPopStyle();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment