Is it possible to use an image captured with the iPhone's camera as a texture that is then manipulated in OpenGL ES (flag wave effect, etc.)? The main problem being the size of the iPhone screen being 320x480 (no status bar) and thus the image won't have dimensions that are power-of-2. Is the main option copying it into a 512x512 texture and adjusting the vertices?
+4
A:
Yes, that's the way to do it.
Just use a larger texture. It's a waste of memory but unfortunately there is no way around this problem.
Nils Pipenbrinck
2009-01-30 18:34:18
Thanks for the confirmation.
abraginsky
2009-01-30 20:12:11
Does the iPhone OpenGL ES standard allow for the GL_ARB_texture_non_power_of_two extension? This may be worth looking into.
sludge
2009-07-05 06:35:07
It does not @sludge
Till
2009-11-05 15:41:40
A:
An alternative would be deviding the picture into squares with a length and height of 32 pixels (aka tiling), resulting into 15x8 tiles. Displaying it would however involve many texture switches while drawing which might become a bottleneck. On the other hand you would save a lot of memory using a tiled approach.
Till
2009-11-05 15:47:17
A:
I am looking for using camera for iphone, and manipulate the image. However, using UIImagePickerController is very slow in grabbing and showing the image.
I am a beginner in usage of openGL. If I convert the image to a texture, how can i get a pointer to the image pixels and manipulate them?
Thanks,
Pannag
2009-11-29 17:59:52