Page 1 of 1

iOS - Custom RenderWindow/EAGLView size

Posted: Fri Feb 01, 2013 10:48 am
by Carlyone
Hello,
I've been tasked with getting the image output in Ogre as good as possible on the iPad3 and above (not worried about iPad2).

By image output I mean on screen and capture.

At the moment we have a basic render system configuration:

Code: Select all

GLES2RenderSystem::_createRenderWindow "OgreWindow", 768x1024 fullscreen  miscParams: FSAA=0 contentScalingFactor=1 displayFrequency=0 
iOS: Window created 1024 x 768 with backing store size 2048 x 1536 using content scaling factor 2.0
The rendering looks good but the output is quite poor, I guessed that the reason for this is that the image is 2048x1536 and Ogre renders at 1024x768 so everything is stretched.

Attachment 1 - Snapshot
Image

Attachment 2 - Screen Capture (power+home button)
Image

The image sizes are different but scaling up the snapshot doesn't make a difference.

Now this might be due to the capture code for the EAGL Layer but the capture code is pretty standard.

----

As an attempt to solve this I played with the render window settings by upping the render window size to 2048x1536 (iPad3 resolution) but on startup the output was:

Code: Select all

GLES2RenderSystem::_createRenderWindow "OgreWindow", 1536x2048 fullscreen  miscParams: FSAA=0 contentScalingFactor=1 displayFrequency=0 
iOS: Window created 1024 x 768 with backing store size 2048 x 1536 using content scaling factor 2.0
So the render window is fine but not the iOS window meaning the render window extends out of the screen and the gui etc doesn't quite work.

I understand this may be a limitation due to the implementation of EaglView sitting onto of UIView but if not, how do I get Ogre to be in the native resolution without scaling?

Any information on this would be greatly appreciated

Carl

Re: iOS - Custom RenderWindow/EAGLView size

Posted: Fri Feb 01, 2013 3:20 pm
by masterfalcon
What version of Ogre is this? And how are you currently trying to set the scaling factor?

Re: iOS - Custom RenderWindow/EAGLView size

Posted: Fri Feb 01, 2013 3:26 pm
by Carlyone
Ogre version is 1.8.1

The code I'm using for the content scaling setting is below

Code: Select all

m_pRoot->initialise(false);
    
NameValuePairList misc;
misc["FSAA"] = "0";
misc["contentScalingFactor"] = "1";
misc["displayFrequency"] = "0";
m_pRenderWnd = m_pRoot->createRenderWindow("OgreWindow",1536,2048,true,&misc);

Re: iOS - Custom RenderWindow/EAGLView size

Posted: Fri Feb 01, 2013 6:14 pm
by masterfalcon
Ok that may be a bug with scaling factor not being applied when passed via miscParams. But also your window size should be 768x1024.

Re: iOS - Custom RenderWindow/EAGLView size

Posted: Mon Feb 04, 2013 10:01 am
by Carlyone
By your last post I gather the RenderWindow size always has to be 768x1024 (for landscape)?

Re: iOS - Custom RenderWindow/EAGLView size

Posted: Mon Feb 04, 2013 11:33 pm
by masterfalcon
Your window size should never include the scaling factor in it. Inside iOS the window is still 1024x768(or switched depending on orientation). But the buffer backing it has a different resolution.

Re: iOS - Custom RenderWindow/EAGLView size

Posted: Thu Mar 14, 2013 9:30 am
by Carlyone
Ok, I'm happy with that if that's the way it works.

Thanks for your time