Page 1 of 1

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

Posted: Sat Dec 29, 2012 3:55 am
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.

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

Posted: Sat Dec 29, 2012 9:11 am
by masterfalcon
Is this with GLES 1 or 2?

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

Posted: Sat Dec 29, 2012 10:19 am
by DanielSefton
It's GLES 2.

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

Posted: Sat Dec 29, 2012 6:54 pm
by masterfalcon
Weird. I can't reproduce it here.

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

Posted: Mon Dec 31, 2012 9:22 am
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...

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

Posted: Mon Dec 31, 2012 9:47 am
by masterfalcon
I'm super tired right now, but I did notice that your miscParams include a 2 contentScalingFactor. Maybe that's related?

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

Posted: Mon Dec 31, 2012 9:49 am
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 :)

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

Posted: Wed Jan 02, 2013 4:35 am
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*

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

Posted: Wed Jan 02, 2013 7:56 am
by masterfalcon
Hmm, I'll have to try creating the window manually. I've been relying on the auto created window setup.

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

Posted: Sun Jan 06, 2013 6:38 am
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);