Jump to content
  • Advertisement
Sign in to follow this  
Draika the Dragon

Rendering issue (tearing?)

This topic is 969 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Edited by draika

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites


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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!