Canvas rendering issues / Text Transition rendering issues
Jose Martinez
jmartine_1026 at yahoo.com
Wed Jan 2 18:42:21 PST 2013
Jim,
I suspect that the jittering is the bounds, as you also suggested. The jittering started when the electric lines were added. I been meaning to fix that and now that the holidays are over I will be working on that. My initial fix is also what you suggested... padding the Parent.
I do not follow when you speak about round or bevel join. Can you elaborate? Is this in regards to how the stroke is done or related to the algorithm for creating the electric lines?
I agree it is not optimized. It was more for testing performance with something over the top. For each of those lines multiple random calls are made... very inefficient. I imagine having a predefined set of points to avoid the random calls might improve perf.
thanks
jose
________________________________
From: Jim Graham <james.graham at oracle.com>
To: Daniel Zwolenski <zonski at gmail.com>
Cc: "openjfx-dev at openjdk.java.net" <openjfx-dev at openjdk.java.net>
Sent: Wednesday, January 2, 2013 9:07 PM
Subject: Re: Canvas rendering issues / Text Transition rendering issues
I noticed that the path-based Vector enemies jump around a bit. I'm wondering if this could be due to the bounds of the enemy shifting around as the electric lines are added. Note that you use a stroked Path with its default decorations which I believe means miter joins which can have spikes in their contributions to bounds when you turn tight corners, so as the last triangular segment is randomly generated the angle of that last corner to the end before the path is closed can shoot out a miter of arbitrary length.
Try using a round or bevel join instead - both of which will have faster and more stable bounds computations anyway which can avoid some per-frame overhead. Round would be the most stable choice for bounds, but bevel would be the fastest to render. Another technique for making the bounds stable is to include an element that pads the bounds of your group beyond the most outlying "jittery" element. For example, including a transparent rectangle whose bounds exceed the circle by enough to encompass the spiking of the miter joins or the tiny variations in the bevel joins would smooth out the stability of the bounds. The bounds with round joins will always be fairly stable since they always have a constant stroke extension distance from the outermost points of a path...
...jim
More information about the openjfx-dev
mailing list