I am making an orthographic projection for a fullscreen quad for post processing.
On the desktop I do the usual projection matrix using my favourite math library, but on the ipad only the top function would work. I still cant quite understand why, I obtained the iPad value through trial and error. Those values are left, right, bottom, top.
#ifdef IPAD
GLGXMatrixOrthoOffCenter2D(&Ortho, 0.5, 1.0, 0.5, 1.0); //iPad ortho matrix
#else
GLGXMatrixOrthoOffCenter2D(&Ortho, -1.0, 1.0, -1.0, 1.0); //Desktop ortho matrix
#endif
Why is this like this? (ipad/desktop) difference
Started by wildboar, Jun 21 2012 10:15 PM
1 reply to this topic
Sponsor:
#2 Crossbones+ - Reputation: 5345
Posted 22 June 2012 - 08:06 AM
If all else is equal, this is equal too. In other words, you have just swept a bug under the carpet by using a hack to get the desired result. There is something else wrong somewhere else in your code. An incorrect viewport, transform matrix, or vertex positions, for example. My engine runs on Windows, Macintosh OS X, and iOS devices using OpenGL or OpenGL ES 2, and in these cases there is no difference in the results if all of the same matrices, shaders, viewports, etc. are used.
It is also possible that the library you are using changes for each platform.
If you can verify this is not the case, then you should start looking elsewhere for differences between the environments.
Although if this is just for post-processing, it would be more efficient to simply make a quad with vertices at [-1, -1], [1, -1], [-1, 1], and [1, 1] and perform no matrix transform on them. Not only is it faster (avoids matrix multiply, which does nothing but put the vertices into those positions anyway), it also guarantees the same result on all platforms.
L. Spiro
It is also possible that the library you are using changes for each platform.
If you can verify this is not the case, then you should start looking elsewhere for differences between the environments.
Although if this is just for post-processing, it would be more efficient to simply make a quad with vertices at [-1, -1], [1, -1], [-1, 1], and [1, 1] and perform no matrix transform on them. Not only is it faster (avoids matrix multiply, which does nothing but put the vertices into those positions anyway), it also guarantees the same result on all platforms.
L. Spiro
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums






