[SOLVED] Problem with ofGLProgrammableRenderer when drawing Ellipse

Hi !

I’m trying to run this example (and others scenes) with the programmable renderer :

but when I enable the programmable renderer I get a weird thing, the screen is Blinking with the color of the image :

It seems like each line/particle is drawed in the whole screen…

Any ideas ?

Thanks !

EDIT : I don’t use anymore the programmable renderer because of Syphon, but I’m curious about the error.

Well, the same problem occurs when I activate the GUI of ofxOpenVJ… (and without the programmable renderer)

Cyril

try ofSetVerticalSync(false); in setup();

Yup Dorald,

just tried what you said, but it doesn’t work…

Cyril

Sorry @Cyril, I mistyped. ofSetVerticalSync must be ofSetVerticalSync(true);

I get the same result with the vertical sync on or off.
Really strange because it occurs only when I activate the GUI of openVJ. Could it be a problem of alphaBlending or something like this ?

Cyril

Have you tried to draw scene on FBO ? Try to draw on FBO and comment ofSetBackgroundAuto(false);

@Dorald : Yep, here is my code :

void crow::setup(){
    img.loadImage("crow/popart.jpg");
    img.resize(ofGetWidth(), ofGetHeight());
    //ofSetBackgroundAuto(false);
    //ofSetFrameRate(60);
    //ofEnableAlphaBlending();

    dt=0;

    myFbo.allocate(ofGetWidth(), ofGetHeight(), GL_RGBA);
    myFbo.begin();
    ofClear(255,255,255, 0);
    myFbo.end();
    nombreParticles=40;
 }

//--------------------------------------------------------------
void crow::update(){
    dt=scaledVol*15;

    for (int i=0; i<particles.size(); i++) {
        particles[i].update(dt);
    }
 
    BaseScene::update();
}

//--------------------------------------------------------------
void crow::draw(){
    myFbo.begin();

    //ofSetColor(255,255,255);
    //ofRect(0, 0, ofGetWidth(), ofGetHeight());

    glPushAttrib(GL_ALL_ATTRIB_BITS);
    glEnable(GL_BLEND);
    glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,GL_ONE,GL_ONE_MINUS_SRC_ALPHA);
     // glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); //OLD

    for (int i=0; i<particles.size(); i++) {
        ParticleCrow &p = particles[i];
        //p.color = img.getColor(p.pos.x,p.pos.y);
        p.draw();
    }

     for (int i=0; i<nombreParticles; i++) {
             createParticle(scaledVol*100);
    }

     while (particles.size()>1000) {
           particles.erase(particles.begin());
    }

    glDisable(GL_BLEND);
    glPopAttrib();

    myFbo.end();

    ofEnableAlphaBlending();
    myFbo.draw(0, 0);
    ofDisableAlphaBlending();
}

void crow::createParticle(float zPos) {
    ParticleCrow p;
    p.setup();
    p.pos.set(ofRandomWidth(), ofRandomHeight(), zPos);
    p.color = img.getColor(p.pos.x,p.pos.y);
    particles.push_back(p);
}

So, I don’t know if it’s really a solution, but I don’t use the Programmable Renderer anymore, and I added : ofSetColor(255, 255, 255); before the beginning of the fbo.

Cyril