ofxPostProcessing
ofxPostProcessing copied to clipboard
Upside-down video with ofVideoGrabber
I'm attempting to use an unmodified fork for your ofxPostProcessing addon with video and for some reason when I add the post-processing transformation the video is vertically mirrored. Here's the code I'm using in my testApp.cpp.
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
camWidth = ofGetWidth(); // try to grab at this size.
camHeight = ofGetHeight();
// set up video grabber
vidGrabber.setDeviceID(0);
vidGrabber.setDesiredFrameRate(24);
vidGrabber.initGrabber(camWidth,camHeight);
// set up shader post-processing
post.init(camWidth, camHeight);
post.createPass<RimHighlightingPass>()->setEnabled(true);
}
//--------------------------------------------------------------
void testApp::update(){
ofBackground(100,100,100);
vidGrabber.update();
}
//--------------------------------------------------------------
void testApp::draw(){
// copy enable part of gl state
glPushAttrib(GL_ENABLE_BIT);
// setup gl state
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
// begin scene to post process
post.begin();
vidGrabber.draw(0,0);
// end scene and draw
post.end();
// set gl state back to original
glPopAttrib();
}
I was going to open another issue but I think it is the same. Everything is flipped vertically when using ofxPostProcessing here. Thanks
Just after post.init() put post.setFlip(false); This solved problem for me.
That is great, thank you @darekzak
calling post.setFlip(false) after init just draws a black screen for me..... ?
this works as a temp work around for the time being
post.draw(0,ofGetHeight(),ofGetWidth(),0-ofGetHeight());