1024x768 res is squashed (iPad 1, 2 and mini)

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10

1024x768 res is squashed (iPad 1, 2 and mini)

Post by DanielSefton »

Basically, for any 1024x768 device (iPad 1, 2, mini - retina iPads are no problem), it looks like the attached image. The viewport is squashed. The FOV also looks freaky when I rotate the camera.

I don't recall changing anything in my app that could have caused this (there might be), but I did also upgrade Ogre in the last couple of months or so (latest 1.8 branch) and it didn't happen prior to that.

Does anyone else have this issue? Or are there any suggestions as to what might be happening and how to work around it?

Thanks in advance.
You do not have the required permissions to view the files attached to this post.
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: 1024x768 res is squashed (iPad 1, 2 and mini)

Post by masterfalcon »

Is this with GLES 1 or 2?
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10

Re: 1024x768 res is squashed (iPad 1, 2 and mini)

Post by DanielSefton »

It's GLES 2.
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: 1024x768 res is squashed (iPad 1, 2 and mini)

Post by masterfalcon »

Weird. I can't reproduce it here.
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10

Re: 1024x768 res is squashed (iPad 1, 2 and mini)

Post by DanielSefton »

Just found out that it occurs if I create a render window at a non-retina size, regardless of the content scaling factor. So it happens on all non-retina devices, and retina devices if I provide a non-retina size.

What sizes do you pass to createRenderWindow()?

Pass size to createRenderWindow(): 320x480, CSF 1.0 (squashed)

Code: Select all

GLES2RenderSystem::_createRenderWindow "DefaultRenderWindow", 320x480 fullscreen  miscParams: contentScalingFactor=1 externalViewControllerHandle=496159184 
iOS: Using an external view controller handle
iOS: Window created 320 x 480 with backing store size 640 x 960 using content scaling factor 1.0

- 00:17:35.448 INFO: viewport->getWidth() x viewport->getHeight(): 1x1
- 00:17:35.448 INFO: renderWindow->getWidth() x renderWindow->getHeight(): 960x640
Pass size to createRenderWindow(): 640x960, CSF 2.0 (works)

Code: Select all

GLES2RenderSystem::_createRenderWindow "DefaultRenderWindow", 640x960 fullscreen  miscParams: contentScalingFactor=2 externalViewControllerHandle=529713520 
iOS: Using an external view controller handle
iOS: Window created 320 x 480 with backing store size 640 x 960 using content scaling factor 2.0

- 00:11:15.387 INFO: viewport->getWidth() x viewport->getHeight(): 1x1
- 00:11:15.387 INFO: renderWindow->getWidth() x renderWindow->getHeight(): 1920x1280
It doesn't seem related, but I find it odd that the viewport size is 1, and the render window width/height is 1920x1280 when passing a retina size...
Last edited by DanielSefton on Mon Dec 31, 2012 9:48 am, edited 1 time in total.
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: 1024x768 res is squashed (iPad 1, 2 and mini)

Post by masterfalcon »

I'm super tired right now, but I did notice that your miscParams include a 2 contentScalingFactor. Maybe that's related?
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10

Re: 1024x768 res is squashed (iPad 1, 2 and mini)

Post by DanielSefton »

Sorry I meant to edit that, the log is from when I tried it with CSF 2.0 as well, but exactly the same happens with 1.0.

Also: get some sleep :)
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10

Re: 1024x768 res is squashed (iPad 1, 2 and mini)

Post by DanielSefton »

So yeah, I managed to work around this by passing values to createWindow() as if it's a retina device regardless of whether it is or not.

*shrugs*
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: 1024x768 res is squashed (iPad 1, 2 and mini)

Post by masterfalcon »

Hmm, I'll have to try creating the window manually. I've been relying on the auto created window setup.
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: 1024x768 res is squashed (iPad 1, 2 and mini)

Post by masterfalcon »

I tried creating a window manually but it isn't squashed for me. My guess is that the external view controller is messing it up. Here's my creation code:

Code: Select all

			Ogre::NameValuePairList miscParams;
            miscParams["contentScalingFactor"] = Ogre::StringConverter::toString((unsigned long)1.0);
            res = mRoot->createRenderWindow("OGRE Sample Browser Window", 768, 1024, false, &miscParams);