openFrameworks-RaspberryPi / openFrameworks

This repo has migrated into the openFramworks core! Please go to http://github.com/openFrameworks/openFrameworks for the latest!
http://github.com/openFrameworks/openFrameworks
Other
104 stars 11 forks source link

ofFbo compiles and runs, but produces error when 1920x1080 #41

Closed bakercp closed 11 years ago

bakercp commented 11 years ago

When using larger screens (such as 1920x1080) with the jvc_fboTest example, the following error is presented:

[ofFbo:error] FRAMEBUFFER_INCOMPLETE_ATTACHMENT

How big can FBOS be on the RPI? Perhaps build in a hard limit or warning?

arturoc commented 11 years ago

i'm pretty sure you can check the size with some openGL extension, might be good to check when the fbo is created not only for arm but for every platform

bakercp commented 11 years ago
int max;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max);
cout << "GL_MAX_TEXTURE_SIZE=" << max << endl;

Is this the same thing? Or is it different with fbos?

arturoc commented 11 years ago

i think that should work, perhaps there's something different for renderbuffers that we use for depth and stencil but for the color attachment being a texture that should do

bakercp commented 11 years ago

related: http://stackoverflow.com/questions/6655943/maximum-opengl-framebuffer-object-size-limit

danzeeeman commented 11 years ago

Interesting. I've been looking into setting up the Pi to split the memory 50/50 with the GPU. It might just be running out of memory with the default firmware setup.

On Sun, Dec 23, 2012 at 12:32 PM, Christopher Baker < notifications@github.com> wrote:

related: http://stackoverflow.com/questions/6655943/maximum-opengl-framebuffer-object-size-limit

— Reply to this email directly or view it on GitHubhttps://github.com/openFrameworks-RaspberryPi/openFrameworks/issues/41#issuecomment-11648332.

"I believe in science. Unlike mathematical theorems, scientific results can't be proved. They can only be tested again and again, until only a fool would not believe them.

I cannot prove that electrons exist, but I believe fervently in their existence. And if you don't believe in them, I have a high voltage cattle prod I'm willing to apply as an argument on their behalf. Electrons speak for themselves."

-- Seth Lloyd: Quantum Mechanical Engineer, MIT

/.

bakercp commented 11 years ago

@kalwalt Can you test this to see if you get errors with large FBO sizes on the Pandaboard?

kalwalt commented 11 years ago

it is on my to do list!

kalwalt commented 11 years ago

@bakercp i have done a little test with framebuffere of 1920x1080 with PandaBoard. it is a very simple test (just some circles that random appear..) but works fine for me . it run without any errors. I reserve to do one more expensive test in the next time.

bakercp commented 11 years ago

Well, sometime since I last checked, this was fixed -- most likely with some of the EGL config upgrades (perhaps the same one that fixed gles2 on pandaboard). For reference, here is my test file:

#include "ofMain.h"

class testApp : public ofBaseApp{
    public:
        void setup() {
            int max;
            glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max);
            cout << "GL_MAX_TEXTURE_SIZE=" << max << endl;

            rgbaFbo.allocate(max, max, GL_RGBA); // with alpha, 8 bits red, 8 bits green, 8 bits blue, 8 bits alpha, from 0 to 255 in 256 steps 
            rgbaFbo.begin();
            ofClear(255,255,255, 0);
            rgbaFbo.end();          
        }

        void draw() {
            rgbaFbo.begin();
                ofBackground(0);
                ofFill();
                ofSetColor(255);
                for(int i = 0; i < 100; i++) {
                    ofCircle(ofRandom(ofGetWidth()),ofRandom(ofGetHeight()),ofRandom(10,30));
                }

            rgbaFbo.end();

            ofSetColor(255);    
            rgbaFbo.draw(0,0);  
        }

        void keyPressed(int key) {
            ofToggleFullscreen();
        }

        ofFbo rgbaFbo; // with alpha

};

//========================================================================
int main( ){

    ofSetupOpenGL(810,530, OF_WINDOW);          // <-------- setup the GL context

    // this kicks off the running of my app
    // can be OF_WINDOW or OF_FULLSCREEN
    // pass in width and height too:
    ofRunApp( new testApp());

}

Happily closing!

bakercp commented 11 years ago

(By the way, I didn't state it explicitly, but this seems to be fixed on RPi now).