piccolo2d / piccolo2d.java

Structured 2D Graphics Framework
http://piccolo2d.org
Other
51 stars 14 forks source link

visual artifacts when rendering (node disapearance, ghosts, etc) #184

Closed mro closed 9 years ago

mro commented 9 years ago

Originally reported on Google Code with ID 184

I was a great fan of Piccolo... I'm still running a custom version of the original framework
from the university of Maryland.

I have tried to switch to Piccolo 2D, but the rendering quality is simply catastrophic
to a point where it is not usable at all. The major issues are
- Nodes that disapear without apparent reason and
- Ghosts lines and shapes left on the canvas while moving around.

I have searched in my code without success until I decided to start from scratch again
to find where run the samples (kind of like going back to school) This is where I found
that even the exemples were not working !

What steps will reproduce the problem?
1. try the OffsetVsTranslateExample (that is only one sample among others)
2. remove all activities. only keep the following code:
        offset.addActivity(new PActivity(-1L) {
            double speed = 3.0d;
            /** {@inheritDoc} */
            protected void activityStep(final long elapsedTime) {
                offset.offset(speed, 0.0d);
                if (offset.getOffset().getX() >= 282) {
                    speed = 0.01f;
                }
                System.out.println("offset " + offset.getOffset());
            }
        });

What is the expected output? What do you see instead?
I expect to see the node moving from left to right endlessly
What happens is that when offset == 285.0d the node disappears !!!
Plus at the begining of the 'translation' the offset of 3.0d leaves ghosts on the canvas
! (see http://lionel.victor.free.fr/Capture-OffsetVsTranslateExample.png)

What version of the product are you using? On what operating system?
I have just compiled from trunk (rev 1031)
I already had the problem with older versions but I thought it was comming from my
coded (being ported from Piccolo to Piccolo2D). Now I know it was not.

Please provide any additional information below.
Linux 2.6.32 x86_64 GNU/Linux
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)

I know that Java 1.6 is not 'supported' but I require it for some drag and drop features.
Besides these visual artifacts have never been visible with Piccolo so I'm not sure
it comes from the JDK version?

As most examples share the same behaviour/problem, I assume it is a bug.

A quick search on the issues list with keywords like "rendering" "render" "visual artifact",
"draw", "paint" etc... did not report anything similar.

am I the only one having the problem ?

Reported by lionel.victor on 2010-07-26 20:43:23


mro commented 9 years ago
Thank you for submitting this issue -- it is a duplicate of Issue 180.

Reported by heuermh on 2010-08-02 14:22:01

mro commented 9 years ago
I'm not 100% sure that the problem in Issue 184 is the same as the one in Issue 180.
 For example, the problem indicated in Issue 184's screenshot suggests a bounding problem
caused by Piccolo not accounting for antialiasing in computing PNode bounds:
http://lionel.victor.free.fr/Capture-OffsetVsTranslateExample.png

The problem in Issue 180 looks like it may have a different cause.

Reported by samrreid on 2010-08-02 17:00:26

mro commented 9 years ago
Fair enough, I'll move it back to New.

Reported by heuermh on 2010-08-02 17:25:55

mro commented 9 years ago
Sorry about the duplicate. I searched for "ghost", "cheese", rendering, etc... I should
have spotted it...

In Issue 180 you say that Issue 184 (this issue) may be related to Piccolo "not accounting
for antialiasing in computing PNode bounds". I have taken the liberty to attach another
screenshot taken with the same modifications above to the sample code.
I juste changed the offset to "double speed = 6.0d;" so the node offsets faster...
As you can see, the remaining chuncks are pretty large... not sure it just leaves the
antialiasing marks... it really lokks like it istn't cleaned at all. ?? strange...

Further more, I insist on the fact that the code offsets forever while in the screenshot
I've just added, we can clearly see that the moving node just disapears without trace
when the offset >= 282 ??? Which is indeed even stranger... Maybe... There are two
bugs in one here... One could be a dupplicate of Issue 180, I'm not sure for the other
...

The same sample code linked with Piccolo1.2 from the university of maryland works as
expected on the same platform... so I do not know if it is related to java6 or to the
64 bits linux host.

hope it helps.

Reported by lionel.victor on 2010-08-02 18:11:34


mro commented 9 years ago
Please check if r1040 also happens to fix this issue.

Reported by heuermh on 2010-08-06 16:04:13

mro commented 9 years ago
Yes indeed, I have updated to r1042 and ran the same code.

Damaged areas are redrawn, cheese is gone.

Plus, the node no longer disapears when the offset gets larger than 282.

Everything works as expected and the bug seems fixed.

Thanx for that.

Reported by lionel.victor on 2010-08-06 22:04:48

mro commented 9 years ago
Thank you for your review.  Closed as duplicate of issue 180.

Reported by heuermh on 2010-08-24 02:46:08