• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Antialiassing in an FxPlug
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Antialiassing in an FxPlug


  • Subject: Re: Antialiassing in an FxPlug
  • From: Pete Warden <email@hidden>
  • Date: Thu, 31 Jan 2008 11:02:07 -0800

One trick you can use is to just use the default bilinear filtering to resample four pixels to one without a shader. You need to set up your texture coordinates so that the sample point is at the corner of four pixels when drawing to the final output, but it's an efficient way of using the hardware. Doing an extra pass is always costly though.

Back when I was coding plugins for another app that shall remain nameless, I used the same general over-sampling technique to reduce aliasing, and offered it as an extra user control, as a filter parameter. If you're worried about the performance hit, that might be an option.

Pete

On Jan 31, 2008, at 5:56 AM, Gary Fielke wrote:

Thanks Pete, just what I was after (the tiling tip will undoubtedly be useful also)

Re the "scale down and resample result into the output" stage is it preferable to use GLSL to average neighbour pixels in a frag shader? Or is there a better option?

Out of curiosity I just tested out CILanczosScaleTransform to scale down from a 2x2 FBO. It seemed to work well but a bit slow on my G4 PowerBook. This might be suitable for the rendering stage but I'm not sure yet how well it would play if tiling of image buffers was required.

Thanks again
Gary



Hi Gary,
you're right, there are a lot of mines to step on when
trying to get multisampling working in an FxPlug. Since as you
discovered PBuffers don't support them, and I'm not sure of the state
of FBO support, we've tended to do the same operations manually. I
don't have much information on the state of hidden windows, since it's
been a long time since we used them, but it's a pretty unusual path to
be using these days and I wouldn't recommend it.


Basically, allocate a pbuffer or FBO that's several times larger than
the final output, and draw into it scaled up. Then as a final pass,
scale down and resample the result into the output.

One thing to watch out for with this is that you may hit card limits
to the maximum texture size, or even how many textures will fit in
VRAM at 16 and 32 bit float bit depths. FCP and Motion have checks to
limit the output size they request to stay within those limits. Rather
than allocating one large buffer, you may instead want to allocate
several smaller buffers at the output size, draw separately into them
as tiles, and then join them together by rendering them into the final
output.


Is that any help?

Pete



------------------------------

_______________________________________________
Pro-apps-dev mailing list
email@hidden
http://lists.apple.com/mailman/listinfo/pro-apps-dev

End of Pro-apps-dev Digest, Vol 5, Issue 13
*******************************************

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
@apple.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: Antialiassing in an FxPlug (From: Gary Fielke <email@hidden>)

  • Prev by Date: Re: reset all controls and custom data
  • Next by Date: Sorry: Again another XML related question
  • Previous by thread: Re: Antialiassing in an FxPlug
  • Next by thread: Again a XML Question
  • Index(es):
    • Date
    • Thread