New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop libGDX: solved flickering problem by changing OpenGL settings #257

Closed
wolfgang-ch opened this Issue Nov 26, 2016 · 21 comments

Comments

Projects
None yet
4 participants
@wolfgang-ch

wolfgang-ch commented Nov 26, 2016

I had these problems when running GdxMapApp in the desktop

These two problems were solved after setting Buffer-flipping mode to Use block transfer
nvidia-set-buffer-flipping-mode

Tiles which are not displayed
vtm-tiles-not-displayed-1

vtm-tiles-not-displayed-2

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Nov 26, 2016

Collaborator

Related to #149?

Regarding missed tiles, OpenScienceMap tile server lately does not provide always all the requested tiles.
Are you sure you don't have missed tiles now?

Collaborator

devemux86 commented Nov 26, 2016

Related to #149?

Regarding missed tiles, OpenScienceMap tile server lately does not provide always all the requested tiles.
Are you sure you don't have missed tiles now?

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Nov 26, 2016

Collaborator

Note that we can use also other libGDX backends.
I just chose LWJGL for its fine Java integration.

There are alternatives like LWJGL3, JGLFW, JOGL which I tested in the past.

If there is interest, I could implement the GL translators and add them in separate modules.

Collaborator

devemux86 commented Nov 26, 2016

Note that we can use also other libGDX backends.
I just chose LWJGL for its fine Java integration.

There are alternatives like LWJGL3, JGLFW, JOGL which I tested in the past.

If there is interest, I could implement the GL translators and add them in separate modules.

@wolfgang-ch

This comment has been minimized.

Show comment
Hide comment
@wolfgang-ch

wolfgang-ch Nov 26, 2016

It's difficult to get the map at the same position but as you can see in the image, the tiles are now displayed correctly.

I also increased MAX_TILT https://github.com/mapsforge/vtm/blob/master/vtm/src/org/oscim/map/Viewport.java#L42, then it is possible that tiles are not displayed

vtm-tiles-not-displayed-3

wolfgang-ch commented Nov 26, 2016

It's difficult to get the map at the same position but as you can see in the image, the tiles are now displayed correctly.

I also increased MAX_TILT https://github.com/mapsforge/vtm/blob/master/vtm/src/org/oscim/map/Viewport.java#L42, then it is possible that tiles are not displayed

vtm-tiles-not-displayed-3

@wolfgang-ch wolfgang-ch reopened this Nov 26, 2016

@wolfgang-ch

This comment has been minimized.

Show comment
Hide comment
@wolfgang-ch

wolfgang-ch Nov 26, 2016

I would like to integrate the VTM map in an Eclipse RCP application but currently I'm not sure which could be the best GL framework.

I already integrated https://goworldwind.org/ in my RCP app https://github.com/wolfgang-ch/mytourbook which is using JOGL but this map seems to be currently in maintainance mode for the desktop

wolfgang-ch commented Nov 26, 2016

I would like to integrate the VTM map in an Eclipse RCP application but currently I'm not sure which could be the best GL framework.

I already integrated https://goworldwind.org/ in my RCP app https://github.com/wolfgang-ch/mytourbook which is using JOGL but this map seems to be currently in maintainance mode for the desktop

@wolfgang-ch

This comment has been minimized.

Show comment
Hide comment
@wolfgang-ch

wolfgang-ch Nov 26, 2016

WorldWindJava has not much changes compared to HTML/Android versions
https://github.com/NASAWorldWind

wolfgang-ch commented Nov 26, 2016

WorldWindJava has not much changes compared to HTML/Android versions
https://github.com/NASAWorldWind

@wolfgang-ch

This comment has been minimized.

Show comment
Hide comment
@wolfgang-ch

wolfgang-ch Nov 27, 2016

GL translators

There are alternatives like LWJGL3, JGLFW, JOGL which I tested in the past.

If there is interest, I could implement the GL translators and add them in separate modules.

I'm be interested in a LWJGL3 GL translator, would be cool you can implement it.

swapBuffers Problem

Instead of setting Buffer-flipping mode to Use block transfer this problem may propably also be solved when both buffers have the same conent but with my current OpenGL skills I'm not able to fix this problem.

wolfgang-ch commented Nov 27, 2016

GL translators

There are alternatives like LWJGL3, JGLFW, JOGL which I tested in the past.

If there is interest, I could implement the GL translators and add them in separate modules.

I'm be interested in a LWJGL3 GL translator, would be cool you can implement it.

swapBuffers Problem

Instead of setting Buffer-flipping mode to Use block transfer this problem may propably also be solved when both buffers have the same conent but with my current OpenGL skills I'm not able to fix this problem.

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Nov 27, 2016

Collaborator

I'm be interested in a LWJGL3 GL translator, would be cool you can implement it.

I created #258 for that.
We need better organization of vtm-desktop first in #259, as it's integrated with LWJGL.

Collaborator

devemux86 commented Nov 27, 2016

I'm be interested in a LWJGL3 GL translator, would be cool you can implement it.

I created #258 for that.
We need better organization of vtm-desktop first in #259, as it's integrated with LWJGL.

@xamix

This comment has been minimized.

Show comment
Hide comment
@xamix

xamix Feb 15, 2017

To complete on this issue:

Have the same exact problem, the FIX in Nvidia settings seem to work also for me.

Here is my current hardware and software (Windows 7 + Nvidia Quadro):

setup

Please note that after this change, some tile seem to not display correctly:

bug

Don't know if it's related but before this change all tile seem to display correctly.

xamix commented Feb 15, 2017

To complete on this issue:

Have the same exact problem, the FIX in Nvidia settings seem to work also for me.

Here is my current hardware and software (Windows 7 + Nvidia Quadro):

setup

Please note that after this change, some tile seem to not display correctly:

bug

Don't know if it's related but before this change all tile seem to display correctly.

@devemux86 devemux86 added the question label Sep 21, 2017

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Sep 21, 2017

Collaborator

Closing, please reopen if needed.

Collaborator

devemux86 commented Sep 21, 2017

Closing, please reopen if needed.

@devemux86 devemux86 closed this Sep 21, 2017

@wolfgang-ch

This comment has been minimized.

Show comment
Hide comment
@wolfgang-ch

wolfgang-ch Sep 22, 2017

I updated vtm to the current version and it is still flickering when Buffer-flipping mode is not set to Use block transfer

This problem occures also by other users of my app

I run MT on a Dell Precision 7710 with a professional Nvidia Quadro M3000M GPU and often there is a flickering effect on the 2.5D map.

This was also solved by setting the buffer flipping mode

I attached a video which shows the flickering but I had to put it into a zip file, mp4 cannot be attached

Video_2017-09-22_143124.zip

wolfgang-ch commented Sep 22, 2017

I updated vtm to the current version and it is still flickering when Buffer-flipping mode is not set to Use block transfer

This problem occures also by other users of my app

I run MT on a Dell Precision 7710 with a professional Nvidia Quadro M3000M GPU and often there is a flickering effect on the 2.5D map.

This was also solved by setting the buffer flipping mode

I attached a video which shows the flickering but I had to put it into a zip file, mp4 cannot be attached

Video_2017-09-22_143124.zip

@devemux86 devemux86 added bug and removed question labels Sep 22, 2017

@devemux86 devemux86 reopened this Sep 22, 2017

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Sep 22, 2017

Collaborator
  • Do you see this behaviour also with vtm-playground samples?
    (to separate from any app custom implementation)

  • Have you tried changing the various parameters in used LwjglApplicationConfiguration, to see if something improves the situation?

Collaborator

devemux86 commented Sep 22, 2017

  • Do you see this behaviour also with vtm-playground samples?
    (to separate from any app custom implementation)

  • Have you tried changing the various parameters in used LwjglApplicationConfiguration, to see if something improves the situation?

@xamix

This comment has been minimized.

Show comment
Hide comment
@xamix

xamix Sep 22, 2017

xamix commented Sep 22, 2017

@wolfgang-ch

This comment has been minimized.

Show comment
Hide comment
@wolfgang-ch

wolfgang-ch Sep 23, 2017

I have the same issue with the vtm-gdx sample, see video

Video_2017-09-23_065619.zip

Have you tried changing the various parameters in used LwjglApplicationConfiguration, to see if something improves the situation?

Not yet, which properties should I test?

I've not very much OpenGL skills but I discovered this problem in the swapBuffer method in https://github.com/LWJGL/lwjgl/blob/lwjgl2.9.2/src/java/org/lwjgl/opengl/Display.java#L646 as pointed out in my first comment and I'm wondering why the buffers are swapped only when moving the mouse and doing nothing else.

wolfgang-ch commented Sep 23, 2017

I have the same issue with the vtm-gdx sample, see video

Video_2017-09-23_065619.zip

Have you tried changing the various parameters in used LwjglApplicationConfiguration, to see if something improves the situation?

Not yet, which properties should I test?

I've not very much OpenGL skills but I discovered this problem in the swapBuffer method in https://github.com/LWJGL/lwjgl/blob/lwjgl2.9.2/src/java/org/lwjgl/opengl/Display.java#L646 as pointed out in my first comment and I'm wondering why the buffers are swapped only when moving the mouse and doing nothing else.

@wolfgang-ch

This comment has been minimized.

Show comment
Hide comment
@wolfgang-ch

wolfgang-ch Sep 23, 2017

The solution which I found accidentally by setting Buffer-flipping mode to Use block transfer may propably solve only the symptoms and not the issue itself.

wolfgang-ch commented Sep 23, 2017

The solution which I found accidentally by setting Buffer-flipping mode to Use block transfer may propably solve only the symptoms and not the issue itself.

@devemux86 devemux86 added this to the 0.10.0 milestone Jan 4, 2018

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Jan 4, 2018

Collaborator

GdxMap.render has a check to skip renders. If we comment it, then works without flickering (no MSAA needed).
I pushed the changes in libGDX branch.
Tested on Android and Linux with rendering seems fine. More tests needed on Windows and macOS.
Can you also test in your environments?

Collaborator

devemux86 commented Jan 4, 2018

GdxMap.render has a check to skip renders. If we comment it, then works without flickering (no MSAA needed).
I pushed the changes in libGDX branch.
Tested on Android and Linux with rendering seems fine. More tests needed on Windows and macOS.
Can you also test in your environments?

@devemux86 devemux86 changed the title from Solved flickering problem by changing OpenGL settings to Desktop libGDX: solved flickering problem by changing OpenGL settings Jan 4, 2018

@wolfgang-ch

This comment has been minimized.

Show comment
Hide comment
@wolfgang-ch

wolfgang-ch Jan 6, 2018

Can you also test in your environments?

I'll test it in the next days, currently I'm struggling with the newest version and the gadle updates because my last VTM update is 6 months ago

wolfgang-ch commented Jan 6, 2018

Can you also test in your environments?

I'll test it in the next days, currently I'm struggling with the newest version and the gadle updates because my last VTM update is 6 months ago

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Jan 9, 2018

Collaborator

@wolfgang-ch did you have the chance to test the proposed flicker fix and on which platforms?

Collaborator

devemux86 commented Jan 9, 2018

@wolfgang-ch did you have the chance to test the proposed flicker fix and on which platforms?

@wolfgang-ch

This comment has been minimized.

Show comment
Hide comment
@wolfgang-ch

wolfgang-ch Jan 10, 2018

With the libGDX branch the flickering disappeared. I added some log statements to be shure that the correct code is used.

My platform is:

  • Win 10 1709
  • NVIDIA Quadro M1000M
    with "Buffer-flipping mode" reset to "Auto-select"

wolfgang-ch commented Jan 10, 2018

With the libGDX branch the flickering disappeared. I added some log statements to be shure that the correct code is used.

My platform is:

  • Win 10 1709
  • NVIDIA Quadro M1000M
    with "Buffer-flipping mode" reset to "Auto-select"
@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Jan 10, 2018

Collaborator

Thanks for the feedback!
That's great news, will probably merge the change in master.

@Longri can you test libGDX branch also on macOS?

Collaborator

devemux86 commented Jan 10, 2018

Thanks for the feedback!
That's great news, will probably merge the change in master.

@Longri can you test libGDX branch also on macOS?

@Longri

This comment has been minimized.

Show comment
Hide comment
@Longri

Longri Jan 13, 2018

I can confirm that I have no flickering effect with some tests on MacOS with LibGdx !

Longri commented Jan 13, 2018

I can confirm that I have no flickering effect with some tests on MacOS with LibGdx !

@devemux86

This comment has been minimized.

Show comment
Hide comment
@devemux86

devemux86 Jan 13, 2018

Collaborator

Thank you all for your feedback!
Fixed in #149.

Collaborator

devemux86 commented Jan 13, 2018

Thank you all for your feedback!
Fixed in #149.

@devemux86 devemux86 closed this Jan 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment