Last active
March 14, 2018 08:07
-
-
Save sgnm/4b1deff864506cb40fc7dd8181f8233a to your computer and use it in GitHub Desktop.
Easy bloom effect using ofxBlur
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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