Advertisement

Rendering issue (tearing?)

Started by January 26, 2016 11:52 AM
5 comments, last by Draika the Dragon 8 years, 10 months ago

Hello all,

I have noticed this weird issue i have in my rendering where pixels are being misaligned when I'm drawing things that are moving around, like screen tearing or something even though i have setDoubleBuffered(true) on all my components. In fact, I don't see any difference between setDoubleBuffered(true) and setDoubleBuffered(false) so i feel like it could be something else.

It is extremely crazy when i unlock my logic and rendering loops. As a test I tried drawing a rectangle moving back and forth at around 9000 FPS and it looks like a noodle flopping around and it looked like this (tried to screencap but the screencap shows nothing unusual even though i see the misalignements):

[EDIT: dropbox links removed - see attachments instead]

It goes for up, left, and down as well.

Can anyone explain to me what's going on? It is noticeable even at 60 FPS however it only tears like once every 1/3 of a second

I do believe this is what vsync is supposed to solve.

Interested in Fractals? Check out my App, Fractal Scout, free on the Google Play store.

Advertisement

This is off topic but: be careful about giving out Dropbox links. Once you're over bandwidth limit you get banned. First time it's 1 day ban, then 7 days, then probably longer (haven't experienced that yet). Not to mention there's no transparency on bandwidth usage.

This is off topic but: be careful about giving out Dropbox links. Once you're over bandwidth limit you get banned. First time it's 1 day ban, then 7 days, then probably longer (haven't experienced that yet). Not to mention there's no transparency on bandwidth usage.

Also off topic, this forum let's you add attachments to your posts which then show up in the post so you can show images hassle free which is great.

Interested in Fractals? Check out my App, Fractal Scout, free on the Google Play store.


like screen tearing or something even though i have setDoubleBuffered(true)
Vsync solves screen tearing. Vsync requires double buffering, but you can enable double buffering without enabling vsync.

Vsync causes the renderer to wait for a signal from the display before swapping buffers so that the buffer swaps are synchronized with the monitor refresh.

If you're interested in a general purpose image host, I recommend puush, which allows you to upload any image via r-click or to take various forms of screen capture and immediately get a link to the hosted image.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.
Advertisement

Thanks for the help guys. Unfortunately it doesn't seem like there is any way to mitigate tearing in Java2D. Guess I'll live with it for now and maybe look into some libraries later to deal with this issue.

This topic is closed to new replies.

Advertisement