iOS - Custom RenderWindow/EAGLView size

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
Post Reply
Carlyone
Kobold
Posts: 38
Joined: Thu Jul 05, 2012 3:51 pm

iOS - Custom RenderWindow/EAGLView size

Post by Carlyone » Fri Feb 01, 2013 10:48 am

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
0 x

User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
Contact:

Re: iOS - Custom RenderWindow/EAGLView size

Post by masterfalcon » Fri Feb 01, 2013 3:20 pm

What version of Ogre is this? And how are you currently trying to set the scaling factor?
0 x

Carlyone
Kobold
Posts: 38
Joined: Thu Jul 05, 2012 3:51 pm

Re: iOS - Custom RenderWindow/EAGLView size

Post by Carlyone » Fri Feb 01, 2013 3:26 pm

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);
0 x

User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
Contact:

Re: iOS - Custom RenderWindow/EAGLView size

Post by masterfalcon » Fri Feb 01, 2013 6:14 pm

Ok that may be a bug with scaling factor not being applied when passed via miscParams. But also your window size should be 768x1024.
0 x

Carlyone
Kobold
Posts: 38
Joined: Thu Jul 05, 2012 3:51 pm

Re: iOS - Custom RenderWindow/EAGLView size

Post by Carlyone » Mon Feb 04, 2013 10:01 am

By your last post I gather the RenderWindow size always has to be 768x1024 (for landscape)?
0 x

User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
Contact:

Re: iOS - Custom RenderWindow/EAGLView size

Post by masterfalcon » Mon Feb 04, 2013 11:33 pm

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.
0 x

Carlyone
Kobold
Posts: 38
Joined: Thu Jul 05, 2012 3:51 pm

Re: iOS - Custom RenderWindow/EAGLView size

Post by Carlyone » Thu Mar 14, 2013 9:30 am

Ok, I'm happy with that if that's the way it works.

Thanks for your time
0 x

Post Reply