Skip to content
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

Swing charts with a translucent surface let the previous view content appear under the surface #293

Closed
jzy3d opened this issue Jul 28, 2022 · 0 comments · Fixed by #295
Closed
Labels
Milestone

Comments

@jzy3d
Copy link
Owner

jzy3d commented Jul 28, 2022

Version : jzy3d-2.1.1-SNAPSHOT
Date : 2022-07-28
Factory : SwingChartFactory (does not occur on AWT)

Reproduce

Only happens with SwingChartFactory.

  • Display a surface with alpha < 1
  • Enable view3d() then render()
  • Enable view2d() then render()

image

  • Then resize() to let a colorbar glitch appear

image

Workaround

Workaround 1 : render multiple time

Call chart.render(2); after chart.view2d(...)
Rendering only once still let use see a bit of the previous image (!?).

Workaround 2 : disable alpha

Alpha is not useful when viewing a surface on top if the chart has no other element inside.

Investigated

The following have been investigated but are NOT the reason of the bug :

  • Changing GLCapabilities.setBackgroundOpaque(true/false) in NativePainterFactory
  • Changing GLCapabilities.setDoubledBuffer(true/false) in NativePainterFactory
  • Changing setAutoSwapBuffer(true/false) in CanvasSwing
  • Changing the depth buffer clear value in View.clear
  • Changing the static White Color set to View.setBackground in the Chart constructor to a copy of the color won't change anything

Other thoughts

  • The fact that AWT works proves that there is no OpenGL misconfiguration (e.g. no reason to think that the depth buffer is not cleared)

Links

@jzy3d jzy3d added the bug label Jul 28, 2022
@jzy3d jzy3d added this to the 2.2.0 milestone Jul 28, 2022
@jzy3d jzy3d linked a pull request Jul 28, 2022 that will close this issue
@jzy3d jzy3d changed the title Enabling 2D views of Swing charts with a translucent surface let the previous 3D view content appear under the surface Swing charts with a translucent surface let the previous view content appear under the surface Jul 30, 2022
@jzy3d jzy3d modified the milestones: 2.2.0, 2.3.0 Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant