Any good workarounds for the openGL flicker bug?
in
Programming Questions
•
2 years ago
I am referring to the flicker that occurs when you do not clear the background each frame:
http://code.google.com/p/processing/issues/detail?id=146
This is something that does not affect every system,... I have several systems that work just fine, but I would like to provide a fix for those that are having the problem.
- The main problem system is using an nvidia Quadro FX 4600 video card, so it's not a cheap integrated card.
- I've tried disabling Aero (running vista x64 here)
- drivers have all been updated
- tried disabling smoothing
I really need to run this in OPENGL, because the other modes are too slow, or do not support what I am drawing. (specifically textured quad strips)
Any suggestions?
edit: These are not my actual code, but something I have broken down to the bare minimum to hopefully show the problems I am having.
First, the extremely basic code. This will flicker on machines that exhibit the bug.
second, this will fix (slowly) the issue by copying the buffer at the end of each draw cycle, and pasting it at the beginning. How can I speed this up?
edit: ok, this will work if I do the get() right after drawing the line inside mouseDragged(), but can anyone help speed this up at all?
http://code.google.com/p/processing/issues/detail?id=146
This is something that does not affect every system,... I have several systems that work just fine, but I would like to provide a fix for those that are having the problem.
- The main problem system is using an nvidia Quadro FX 4600 video card, so it's not a cheap integrated card.
- I've tried disabling Aero (running vista x64 here)
- drivers have all been updated
- tried disabling smoothing
I really need to run this in OPENGL, because the other modes are too slow, or do not support what I am drawing. (specifically textured quad strips)
Any suggestions?
edit: These are not my actual code, but something I have broken down to the bare minimum to hopefully show the problems I am having.
First, the extremely basic code. This will flicker on machines that exhibit the bug.
- // trying to get rid of the flicker caused by using OPENGL
// when you do not clear the screen each frame.
// this simple example will flicker on some machines
import processing.opengl.*;
void setup(){
size(500,500,OPENGL);
background(255);
}
void draw(){
line(mouseX,mouseY,pmouseX,pmouseY);
}
second, this will fix (slowly) the issue by copying the buffer at the end of each draw cycle, and pasting it at the beginning. How can I speed this up?
- // trying to get rid of the flicker caused by using OPENGL
// when you do not clear the screen each frame.
// this appears to fix the flicker, but is not very efficient
PImage buffer;
import processing.opengl.*;
void setup(){
size(500,500,OPENGL);
background(255);
buffer = get(); // grab frame for the first loop through
}
void draw(){
image(buffer,0,0); // start of draw cycle, draw last frame
line(mouseX,mouseY,pmouseX,pmouseY);
buffer = get(); // end of draw cycle, grab frame
}
edit: ok, this will work if I do the get() right after drawing the line inside mouseDragged(), but can anyone help speed this up at all?
- // trying to get rid of the flicker caused by using OPENGL
// when you do not clear the screen each frame.
// by moving the drawing into mouseMoved(),copying the buffer does not work,... why?
PImage buffer;
import processing.opengl.*;
void setup(){
size(500,500,OPENGL);
background(255);
buffer = get();
}
void draw(){
image(buffer,0,0); // start of draw cycle, draw last frame
buffer = get(); // end of draw cycle, grab frame
}
void mouseDragged(){
line(mouseX,mouseY,pmouseX,pmouseY);
}
1