Re: Antialiassing in an FxPlug
site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com Pete On Jan 31, 2008, at 5:56 AM, Gary Fielke wrote: Thanks again Gary 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. Is that any help? Pete ------------------------------ _______________________________________________ Pro-apps-dev mailing list Pro-apps-dev@lists.apple.com 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 (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/site_archiver%40lists.ap... 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. 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. 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. 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. _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/pwarden %40apple.com This email sent to pwarden@apple.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Pete Warden