Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top