Gamua / Starling-Framework

The Cross Platform Game Engine
http://www.starling-framework.org
Other
2.85k stars 819 forks source link

Changing properties of ColorMatrixFilter temporarily resets position of Image #875

Closed kevinfoley closed 8 years ago

kevinfoley commented 8 years ago

Starling 2.0.1, Feathers 3.0.0-beta2

On one of my screens in a Feathers app, I have a panel (sprite) containing a control (sprite) that contains an Image (in reverse, an Image inside a Sprite inside a Sprite inside a Screen).

There is a colorMatrixFilter applied to the Image:

filter = new ColorMatrixFilter();
image.filter = new FilterChain(filter);

I am using a slider to control the saturation of the colorMatrixFilter:

private function sliderChange(e:Event):void {
    filter.reset();
    filter.adjustSaturation(saturationSlider.value);
}

Every time I adjust the slider, the Image temporarily moves into the upper-left corner of the screen for a frame or two before returning to its proper position. If I drag the slider continuously, the image stays in the upper-left corner until a few frames after I release it. If I minimize and re-open the app, the Image likewise appears in the upper left corner for a few frames before returning to its proper position. Clicking the image also causes its position to temporarily reset.

I admittedly am not certain whether this bug is caused by Starling or Feathers.

kevinfoley commented 8 years ago

Actually, on further testing, it seems like interacting with any interactive object on the screen causes the Image's position to temporarily reset. This behavior occurs regardless of whether the new skipUnchangedFrames property of Starling is set to true or false.

PrimaryFeather commented 8 years ago

Hm, I can't reproduce this. To me, it sounds as if the filter would (for whatever reason) render its intermediate steps directly on the back buffer instead of the internal filter texture.

If you set starling.enableErrorChecking = true, do you get any trace output? Furthermore, on which platform are you experiencing this? Flash / AIR, mobile / desktop, which device? Have you tried others?

kevinfoley commented 8 years ago

I don't get any error messages when I set enableErrorChecking = true; This problem occurs on Android and in the AIR Mobile simulator on Windows; doesn't seem to be device specific

PrimaryFeather commented 8 years ago

Thanks for the update! Do you think you can reproduce this in a small sample, ideally without Feathers? That would help a lot.

kevinfoley commented 8 years ago

Sure. I'll try to get that together in the next few days.

kevinfoley commented 8 years ago

Completely forgot I had older versions of some of the Starling 2.0 classes in the source folder, which it turns out were overriding the versions in the 2.0.1 SWC; I removed those and updated to Feathers 3.0.1 and between those two changes the issue got fixed. Sorry for the confusion!

PrimaryFeather commented 8 years ago

No worries, I'm just glad to hear the problem is solved! Thanks for the update. :smile: