Question

I am working with OpenGL ES 2.0 and GLKit for iOS.

My app only needs to run at a resolution of 480 by 320 just like the pre iPhone 4 displays as it is using retro style graphics.

The texture graphics are made according to this resolution and a GLKit projection matrix of (0, 480, 0, 320).

This all looks fine on the 3GS but on later models OpenGL (understandably) does some sort of resizing in order to stretch the scene. This resizing results in an undesirable blurring/smoothing of the graphics - probably using some sort of default interpolation scheme.

Is it possible to affect the way this resizing is done by OpenGL? Preferably setting it to no interpolation where the pixels are just directly enlarged.

Was it helpful?

Solution

You need to set the scaling filters on the view like this.

self.layer.magnificationFilter = kCAFilterNearest;
self.layer.minificationFilter = kCAFilterNearest;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top