JDK-8094313 : Overlapping 3D transformed 2D shapes have dirty edges in Scene with depth buffer
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8u40
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-11-20
  • Updated: 2016-04-15
  • Resolved: 2014-11-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8u40Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
This bug is the result (side-effect) of an intentional change in behavior to fix RT-5534. In the past 2D shapes with 3D transforms are rendered by tessellating the shapes. However when the tessellator was retired, we render this 3D transformed shape onto a texture with existing 2D AA shader and then 3D transform the texture. The dirty edges is the result of the blending an AA mask onto a RTT with depth buffer on. Attached is an image showing the dirty edges on overlapped 2D shapes.
Comments
Additional information: User can also make use of the new viewOrder property to control the rendering order of the children if smooth=true is preferred.
15-04-2016

Changeset: 438298641586 Author: Chien Yang <chien.yang@oracle.com> Date: 2014-11-21 14:08 -0800 URL: http://hg.openjdk.java.net/openjfx/8u-dev/rt/rev/438298641586
21-11-2014

Looks good. +1 with Jim's suggested change
21-11-2014

OK. I can confirm this change to the j2d pipe works on Windows. The rendering toggled between aliased and antialiased shape when I clicked on each shape using the test program. Sure, I can use the "?" switch statement too.
20-11-2014

I'm on Mac too right now, but that should work if it compiles (AA mode is well tested on J2D). Or you can just use a "?:" clause for the value. ;)
20-11-2014

Hi Jim, I can't test j2d pipe on Mac, so do you mean the following change on J2DPrismGraphics.java: public void setAntialiasedShape(boolean aa) { antialiasedShape = aa; if (antialiasedShape) { g2d.setRenderingHint(java.awt.RenderingHints.KEY_ANTIALIASING, java.awt.RenderingHints.VALUE_ANTIALIAS_ON); } else { g2d.setRenderingHint(java.awt.RenderingHints.KEY_ANTIALIASING, java.awt.RenderingHints.VALUE_ANTIALIAS_OFF); } } Yes, I intentionally left out the test program I originally wanted to put into toys. I decided that our team repo. (and attach the test in this JIRA) is a better place for keeping test program. I thought a better demo program can be added to toys later.
20-11-2014

It looks like the J2D graphics doesn't use the hint. You just need to make this call in the setAA() method with the appropriate ON vs OFF hint: g2d.setRenderingHint(java.awt.RenderingHints.KEY_ANTIALIASING, java.awt.RenderingHints.VALUE_ANTIALIAS_ON); or java.awt.RenderingHints.VALUE_ANTIALIAS_OFF); Everything looks fine, and the test case passes, but I notice the toy is missing in this webrev. Was that intentional?
20-11-2014

Hi Jim and Kevin, Please review this proposed fix which is a carryover work from RT-38063. You can use the attached test program to verify the fix. http://cr.openjdk.java.net/~ckyang/RT-39468/webrev.00/
20-11-2014

Attached is the test program that illustrate the rendering issue. Clicking each shape will toggle its smooth property. Current JavaFX implementation doesn't take into account of the smooth property for rendering hint. Our plan is to use this property to select between aliased and antialiased shape rendering.
20-11-2014