JDK-8108358 : Prism: no antialiasing when rendering shapes with a 3D transform
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: fx1.3
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2009-08-26
  • Updated: 2015-06-16
  • Resolved: 2013-07-18
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
8Fixed
Related Reports
Blocks :  
Blocks :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
For a given scene with shapes of same type, different rendering technique is used depending on the accumulated transformation above each shape. This is only true to Prism stack with es2 or d3d pipe. Shader is used to render shape with 2D transform, but it is replaced with tessellated shape rendering when the shape has a 3D transformation matrix applied to it. Shader produces better rendering quality than tessellated shape. 
Comments
Changeset: d74994a3705e Author: rbair Date: Thu Jul 18 12:07:11 2013 -0700 URL: http://jfxsrc.us.oracle.com/javafx/8.0/scrum/graphics/rt/rev/d74994a3705e Description: RT-5534: Prism: no antialiasing when rendering shapes with a 3D transform
18-07-2013

@Kevin -- yes, that is precisely what my patch is supposed to do. I see the bug, I didn't change the transform when rendering to image to be identity (possibly with scale). Thanks for the pointer, it helped me find the bug much quicker :)
15-07-2013

Thanks for pointing to those test apps! I will run through them. I found that CubicCurveT3D runs into ClassCastException on this line of code: //this is a safe cast as this ShapeRep is not 3d capable. // all 3d transformed shapes are thus rendered by different ShapeRep xformBounds = (RectBounds) xform.transform(shapeBounds, xformBounds); Doh!
15-07-2013

There is no disagreement that we need to nuke the shape tessellation. In addition to the cases Chien identified, we also need to test different paint types for basic shapes: ImagePattern and Gradient (both linear and radial). I'm almost certain the former will not render correctly under perspective. I suspect that the latter may not render correctly in all cases either. Anyway, the complete solution will need to be something like the following: if (canBeRenderedDirectly) { just render it } else { render the 2D shape into an image using the identity transform, possibly with scale (like effects do), and then render the image using the perspective transform }
15-07-2013

I just tested your patch on a bunch of 3D transformed shapes in toys/ShapeT3DTest. The patch works great on basic shapes such as Circle, Rectangle and Ellipse, but it breaks on Path (see PathT3D), Text (see TextT3D) , and Shape with stroke (see MixedShapesT3D).
14-07-2013

I don't know that worrying over what the ellipse looks like under perspective is worth the trade off. People aren't going to use this for cases where it would matter. On the other hand the tessellated shapes look bad and I don't think they're worth their weight. Somebody can use an external tessellation with MeshView and produce arbitrarily high (or low) quality shapes, which seems a better mechanism than us doing tessellation. That said, I'd be happy to try out any use cases of concern! I think defining the semantics for rotated 2D stuff as rotating a 2D representation is pretty nice.
13-07-2013

I will take a look at this when I get back into the office, but I don't think what you propose will work for complex shapes or for text. I'm not certain that it will work in all cases for other primitives either (e.g., a circle or an ellipse becomes a different shape under perspective) or for all paint types (e.g., ImagePaint). I would love to be proven wrong, but I don't think I am. :)
13-07-2013

I have a patch which seems to work. Basically I just pulled out all the tessellation code and everything seems to work great. 33 classes removed from the runtime and better rendering. What's not to like? :-)
12-07-2013

Currently 2D shapes with 3D transforms are rendered by tessellating the shapes. This approach tends to generate shapes with sharp aliased edges. Our plan is not to use the tessellator instead render the shapes onto a texture with existing 2D shader and then 3D transform the texture. We can look into retiring the tessellator as a code clean up process.
02-04-2013

Approved at deferral review meeting on 8/10/11
10-08-2011

SQE: ok to defer
04-08-2011

This isn't part of Presidio's PRD. We should go for a better fix that works well on Intel HD in post Presidio.
21-01-2011

Since non of the currently available Intel chipsets (as recently as GMA 4500 and HD) support multisample buffer, this implementon might not be as useful as we wanted. We might want to look into using shader if possible. Rescheduling to M4.
01-12-2010

Implemented multisample support in the d3d pipe. This feature is currently off by default, and it able by setting prism.multisample to (2|4|8) samples. We will evaluate the quality and performance impact of turning on multisample on various GPUs before wiring it up to switch on automatically. Changeset: c595282bb821 Author: Chien Yang <chien.yang@orcale.com> Date: Thu Nov 18 23:10:13 2010 -0800 URL: http://jfxsrc.sfbay.sun.com/javafx/presidio/scrum/graphics/runtime/rev/c595282bb821
19-11-2010

Loop-Blinn's curve rendering technique is likely out of scope for Presidio. We may look into using multisampling support in the HW. Reduce Origial Estimate from 4w to 1w.
29-09-2010

Since Prism will be the default pipe for Presidio we need to consider this issue.
08-09-2010

This feature requires investigation on implementation technique. Depending on our approach, this can possibly be a research project. May need to consider Loop-Blinn's curve rendering technique.
05-02-2010

Target for a post-soma release.
09-09-2009