Skip to content

Commit

Permalink
have upscaled the FBOs as far as i can push them
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaBatty committed Apr 23, 2018
1 parent e465474 commit 617ba51
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
2 changes: 2 additions & 0 deletions addons/ofxPiMapper/src/Sources/FboSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ void FboSource::drawFbo(){
}

fbo->begin();
ofClear(0);
draw();
fbo->end();
}
Expand All @@ -49,6 +50,7 @@ void FboSource::setDisableDraw(bool b){
}

void FboSource::allocate(int width, int height){
ofDisableArbTex();
clear();
fbo = new ofFbo();
fbo->allocate(width, height);
Expand Down
10 changes: 7 additions & 3 deletions addons/ofxPiMapper/src/Surfaces/SurfaceStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ void SurfaceStack::swap(int a, int b){
std::swap(_surfaces[a], _surfaces[b]);
}

void SurfaceStack::draw(){
ofEnableAlphaBlending();

void SurfaceStack::draw(){
for(int i = 0; i < _surfaces.size(); ++i){
if(_surfaces[i]->getSource()->getType() == SourceType::SOURCE_TYPE_FBO){
glEnable(GL_BLEND);
glBlendFuncSeparate(GL_ONE, GL_ZERO, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
}else{
ofEnableAlphaBlending();
}
_surfaces[i]->draw();
}
ofDisableAlphaBlending();
Expand Down
2 changes: 1 addition & 1 deletion src/Graphics_Tools/RenderFbo.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class RenderFbo{
renderFboSettings.width = width;
renderFboSettings.height = height;
renderFboSettings.internalformat = GL_RGBA;
renderFboSettings.numSamples = 1;
renderFboSettings.numSamples = 8;
renderFboSettings.useDepth = false;
renderFboSettings.useStencil = false;
renderFboSettings.textureTarget = GL_TEXTURE_2D;
Expand Down
6 changes: 3 additions & 3 deletions src/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#pragma once

#define LAYER_RENDER_SIZE_X 500
#define LAYER_RENDER_SIZE_Y 500
//#define PORTRAIT_MODE
#define LAYER_RENDER_SIZE_X 1000
#define LAYER_RENDER_SIZE_Y 1000
#define PORTRAIT_MODE
#define WINDOWS_TOUCH
#define OSC_PORT 9002
4 changes: 2 additions & 2 deletions src/VisualLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ VisualLayer::VisualLayer(){
void VisualLayer::setup(string name, int scene_num){
this->name = name; // Give our source a decent name
scene_select = scene_num;

allocate(LAYER_RENDER_SIZE_X, LAYER_RENDER_SIZE_Y); // Allocate our FBO source, decide how big it should be
allocate(LAYER_RENDER_SIZE_X,LAYER_RENDER_SIZE_Y); // Allocate our FBO source, decide how big it should be
render_fbo.init(LAYER_RENDER_SIZE_X, LAYER_RENDER_SIZE_Y);

use_shader = true;
Expand Down
2 changes: 0 additions & 2 deletions src/ofApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ void ofApp::drawProjections(ofEventArgs & args){
ofShowCursor();

if (projection_fbo.isAllocated()) {
//projection_fbo.getTexture().draw(rect.x,rect.y,rect.width,rect.height);

surface_mask.set_source_texture(projection_fbo);
surface_mask.update();
surface_mask.draw();
Expand Down

0 comments on commit 617ba51

Please sign in to comment.