Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearing a texture used as render target: issue on iOS with active anti-aliasing #28

Open
PrimaryFeather opened this issue Nov 28, 2017 · 0 comments

Comments

@PrimaryFeather
Copy link
Contributor

PrimaryFeather commented Nov 28, 2017

Problem Description

When activating anti-Aliasing on a Starling FragmentFilter on iOS, the filter contents accumulates in each frame, i.e. it seems as if context.clear (with a texture as render target) would not work any longer.

Background information:

Starlings FragmentFilters render objects into a texture so that they can then be processed by subsequent shaders. When you assign a vanilla FragmentFilter to a display object, it just displays that texture.

On iOS, it seems as if the texture (render target) wasn't cleared correctly as soon as antiAliasing is activated on the filter (which is forwarded to context.setRenderTexture).

Steps to Reproduce

Run the following code as part of a Starling root object:

var quad:Quad = new Quad(100, 100, 0xff0000);
quad.alignPivot();
quad.x = quad.y = 100;
quad.filter = new FragmentFilter();
quad.filter.antiAliasing = 2;
addChild(quad);

Starling.juggler.tween(quad, 3, { rotation: Math.PI * 2, repeatCount: 0 });

The result, which should be a red rotating quad, looks like this:

img_1394

Remarks:

  • This does work fine on macOS and the AIR iOS emulator.
  • I tried to reproduce the issue with pure Stage3D code, without Starling, but I could not do it. It must be some combination of settings Starling is using.

Known Workarounds

Starling's filters also support a resolution property that works similar to anti-aliasing, but doesn't rely on Stage3D features. That seems to work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant