006 啟用/禁用EdgeAA的

Post date: 2012/11/22 上午 10:16:10

Rate this thread

Permlink of this thread Subscribe to this thread

avatar
  • Total Posts: 19
  • Joined: 01 August 2012 09:00 PM

I have noticed what appears to be a rendering bug when animating the scale of content. I have produced and attached extremely simplified test cases which clearly illustrate the issue, along with simple steps to replicate.

The gist of the issue is this: animating a black square from 50 pixels to 100 results in a square which appears to be ~100.1 pixels; a just-about noticeable outer grey line is visible, as though the content is rendering sub-pixel. The key point is this only happens when the SWF is run through GFxMediaPlayer, not Flash Player.

Please see the attached test cases. They’re super simple and demonstrate the issue better than I can articulate.

Attachment

First of all, thank you for the detailed test cases.

You are seeing Scaleform’s Edge AA in action. In GFxMediaPlayer, press F2 to toggle debug info. You will see Edge AA is enabled by default for AA Mode. press CTRL+A twice to turn it off.

In fact, to see what I’m talking about better in the player, first press CTRL+W to enable wireframe mode. You will see a sharp, crisp line when AA Mode is None, and a less crisp line when AA Mode is set to Edge AA.

So, turn off Edge AA, repeat your test, and you’ll see no gray border in Photoshop.

Author: MatthewDoyleArt

Replied: 2012-09-18 2:40 AM

/img/forum/dark/default_avatar.png

That makes sense Matthew, and thanks for getting back with such a detailed response, but I don’t get why AA needs to kick in at all if the square should be sitting exactly on pixel bounds? I would like AA when rotating content, for instance, but I don’t want AA when I have a square that should be exactly 100 pixels. And why is it AA only kicks in when animatedly scaling, and not when immediately scaling from one frame to the next?

Sorry for all the questions. I appreciate you must be being bombarded with them since opening Scaleform up to us pesky Unity crowd!

Author: David Foster

Replied: 2012-09-18 10:37 PM

/img/forum/dark/default_avatar.png

Sorry for double post, but it seems I’m unable to edit comments.

I checked the docs re: AA, but couldn’t find anything in the way of how to configure a .SWF to use a certain type of AA or another by default. Could you point me in the right direction?

EDIT: Oops! Just found the edit button!

Author: David Foster

Replied: 2012-09-18 10:54 PM

Hi David,

You can enable/disable EdgeAA on any display object using AS3 and a Scaleform extension like so:

import scaleform.gfx.Extensions;
Extensions.enabled = true;
Extensions.setEdgeAAMode( someDisplayObject, Extensions.EDGEAA_OFF );

Conversely, you can turn it back on with:

Extensions.setEdgeAAMode( someDisplayObject, Extensions.EDGEAA_ON );

Author: MatthewDoyleArt

Replied: 2012-09-19 1:22 AM

/img/forum/dark/default_avatar.png

Thanks. Can I set the AA mode globally in code? I.e., to HW FSAA or None? Finally, what are the performance trade-offs for using the different types of AA?

I tell you what… can you direct me to a doc re: Scaleform AA? I’m keen to read up on it and I don’t want to keep troubling you with these questions.

Author: David Foster

Replied: 2012-09-19 2:25 AM

You can set the entire movie with:

Extensions.setEdgeAAMode( this, Extensions.EDGEAA_OFF );

Author: MatthewDoyleArt

Replied: 2012-09-19 2:48 AM

EdgeAA is Scaleform’s patent pending AA algorithm for vector shapes - very fast and efficient, and produces very nice AA results. It is cheaper than using HWFSAA. I don’t know of any docs that discuss the details unfortunately. Perhaps that’s something we should include in the future.

Author: MatthewDoyleArt