For some reason, my FBO is rendering, but it’s in black and white. Any ideas?
_// in setup()
//Fbo
frontalHazardElements.allocate(ofGetWidth(), ofGetHeight(), GL_RGBA32F_ARB);
frontalHazardElements.begin();
ofClear(255,255,255, 0);
frontalHazardElements.end();
// in update()
frontalHazardElements.begin();
drawElementsIntoFBO();
frontalHazardElements.end();
// in draw()
frontalHazardElements.getTextureReference().bind();
for (int i = 0; i < hudBoundaryPoints.size(); i++) {
glBegin(GL_TRIANGLES);
glNormal3f(0.0f,0.0f,1.0f);
glTexCoord2f(hudBoundaryPoints[i].x + ofGetWidth()/2.0,
hudBoundaryPoints[i].y + ofGetHeight()/2.0);
glVertex3f(hudBoundaryPoints[i].x + ofGetWidth()/2.0,
hudBoundaryPoints[i].y + ofGetHeight()/2.0,
hudBoundaryPoints[i].z);
glTexCoord2f(ofGetWidth()/2.0, ofGetHeight()/2.0);
glVertex3f(ofGetWidth()/2.0, ofGetHeight()/2.0, 0);
glTexCoord2f(hudBoundaryPoints[i+1].x + ofGetWidth()/2.0,
hudBoundaryPoints[i+1].y + ofGetHeight()/2.0);
glVertex3f(hudBoundaryPoints[i+1].x + ofGetWidth()/2.0,
hudBoundaryPoints[i+1].y + ofGetHeight()/2.0,
hudBoundaryPoints[i+1].z);
//final triangle of the ellipse
if (i == (hudBoundaryPoints.size()-2)) {
glVertex3f(hudBoundaryPoints[i+1].x + ofGetWidth()/2.0,
hudBoundaryPoints[i+1].y + ofGetHeight()/2.0,
hudBoundaryPoints[i+1].z);
glTexCoord2f(ofGetWidth()/2.0, ofGetHeight()/2.0);
glVertex3f(ofGetWidth()/2.0, ofGetHeight()/2.0, 0);
glTexCoord2f(hudBoundaryPoints[0].x + ofGetWidth()/2.0,
hudBoundaryPoints[0].y + ofGetHeight()/2.0);
glVertex3f(hudBoundaryPoints[0].x + ofGetWidth()/2.0,
hudBoundaryPoints[0].y + ofGetHeight()/2.0,
hudBoundaryPoints[0].z);
}
glEnd();
}
frontalHazardElements.getTextureReference().unbind();
_