views:

2722

answers:

5

I would like to achieve FSAA on my OpenGL ES app on the iPhone.

Currently I do this by rendering the scene to a texture that is twice the width and height of the screen. I then use the nice function:

void glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height);

to draw the image resized to the screen resolution.

Is there a better way to do this?

Update Bounty Added I was wondering, given that its now Jan 2010, whether there is a better way to do this on v3.1 3GS phones, etc.

+1  A: 

What you're doing is essentially manual full scene anti-aliasing. Ideally, if you could render to a buffer and resize the buffer it could be made faster. I'm not sure if there are built in functions for this, since I doubt the GL capabilities of the phone include FSAA.

Soviut
+3  A: 

Technically iPhone's GPU (PowerVR MBX Lite) should support anti-aliasing. However, it seems that current Apple's OpenGL ES drivers (as of Jan 2009) don't expose this capability. So doing "manual AA" just like you do is pretty much the only way.

NeARAZ
+2  A: 

http://iphonedevelopment.blogspot.com/2009/06/opengl-es-2-shaders.html?showComment=1245770504079#c6001476340022842908

http://stackoverflow.com/questions/1021878/iphone-os-3-0-opengl-es-2-0-is-anyone-seeing-better-anti-aliasing/1024193#1024193

Sounds like you can't do it in hardware since you don't render to the framebuffer, only a texture that the iPhone composites for you.

MSN
I really like that blog-link. The explanation on why the AA-feature is not exposed by the driver does make total sense and helped me to understand the reasoning. Thank you for posting it.
Till
+4  A: 

For Gran Turismo on the PSP, the developers achieved an effect similar to anti-aliasing by moving the image back and forth one pixel per frame (demonstration can be found here: http://www.gtplanet.net/why-gran-turismo-psp-looks-so-good/) so if the iPhone doesn't support what you're looking for that's an option.

ehdv
Only problem is you need to achieve 60 fps :-)
Frank Krueger