deanm / plask

Plask is a multimedia programming environment.
www.plask.org
Other
443 stars 38 forks source link

3d window is flickering if multisampling is disabled #23

Open vorg opened 11 years ago

vorg commented 11 years ago

If you take the 500_triangle example with multisampling disabled

settings: {
    ...
    multisample: false
},

and disable clearing color buffer by changing

gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);

to

gl.clear(gl.DEPTH_BUFFER_BIT);

everything starts to flickr. Why? It's common technique for generative painting so I would expect it to work.

deanm commented 11 years ago

Because it's still double buffered?

vorg commented 11 years ago

So is this expected behavior?

On Wed, May 22, 2013 at 10:54 PM, Dean McNamee notifications@github.comwrote:

Because it's still double buffered?

— Reply to this email directly or view it on GitHubhttps://github.com/deanm/plask/issues/23#issuecomment-18310604 .

Marcin Ignac http://marcinignac.com @marcinignac

deanm commented 11 years ago

I mean, I haven't seen exactly what you are describing, and I don't understand what this has to do w/ multisampling. However if you keep drawing over a double buffered surface than for sure you will have flicker. You need to draw to another framebuffer and blit it to the back buffer every frame. I think this is pretty standard, I am not sure of a real way to do things w/o double buffering since you would be drawing to the current buffer otherwise which is pretty much guaranteed to cause tearing.

vorg commented 11 years ago

Yep but I would expect ping pong so you never see the drawing but it shouldn't flickr to black. Look at the video, it's pretty bad. Just tried similar thing in Cinder and it doesn't flickr. No idea... I'll just use multisampling for now..

On Thu, May 23, 2013 at 1:10 PM, Dean McNamee notifications@github.comwrote:

I mean, I haven't seen exactly what you are describing, and I don't understand what this has to do w/ multisampling. However if you keep drawing over a double buffered surface than for sure you will have flicker. You need to draw to another framebuffer and blit it to the back buffer every frame. I think this is pretty standard, I am not sure of a real way to do things w/o double buffering since you would be drawing to the current buffer otherwise which is pretty much guaranteed to cause tearing.

— Reply to this email directly or view it on GitHubhttps://github.com/deanm/plask/issues/23#issuecomment-18339165 .

Marcin Ignac http://marcinignac.com @marcinignac

deanm commented 11 years ago

Video? And could you send some code to reproduce it?

vorg commented 11 years ago

It's attached to the previous email

On Friday, May 24, 2013, Dean McNamee wrote:

Video?

— Reply to this email directly or view it on GitHubhttps://github.com/deanm/plask/issues/23#issuecomment-18433707 .

Marcin Ignac http://marcinignac.com @marcinignac