Page 1 of 1

issue of iphone 4 high-resolution (640 x 960) [Solved]

Posted: Thu Sep 16, 2010 1:02 pm
by kalashni7
Hi,

I am using Ogre3D engine, and have an issue of iphone 4 high-resolution (640 x 960).

---------------------------------------------------------------------------------------------------------
* Development enviroment
- Ogre for iOS (1.7 version + iPhoneDependencies )
- Mac OS
- Xcode
- Target platform : iPhone4 (iOS 4.1)

---------------------------------------------------------------------------------------------------------
* Issue
I modified Video Mode ogre.cfg in the templete as below, and build / run.

Render System=OpenGL ES 1.x Rendering Subsystem
[OpenGL ES 1.x Rendering Subsystem]
FSAA=4
Full Screen=Yes
RTT Preferred Mode=Copy
Video Mode=640 x 960
#Video Mode=960 x 640
Orientation=Portrait

But I noticed that only left-down quater of the screen.
I debug the code, and found bool EAGLESContext::createFramebuffer() function in OgreEAGLESContext.mm file has the code of getting size of render buffer, and they are getting mBackingWidth as 320, mBackingHeight 480

glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &mBackingWidth);
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &mBackingHeight);
< The code of getting size of render buffer >

How could I solve this issue to render with iPhone 4 high-resolution (640 x 960 or 960 x 640 with landscape)?

Looking foward to your answer.

Best regards,
Jackie
----------------------------------------

Re: issue of iphone 4 high-resolution (640 x 960)

Posted: Thu Sep 16, 2010 2:16 pm
by masterfalcon
On the iPhone 4, the window size is always 320x480 so that's fine. But there is a content scaling factor that you can use to affect the size of the render buffer.

So to get a resolution of 640 x 960 you'll want to add:

Content Scaling Factor=2.0

This can be a number anywhere between 1 and 2

Re: issue of iphone 4 high-resolution (640 x 960)

Posted: Fri Sep 17, 2010 3:39 am
by kalashni7
I tried to apply "Content Scaling Factor=2.0" on our project as you answered to me.
So I input "Content Scaling Factor=2.0" into ogre.cfg and ran, but an error occurred like this:

An exception has occurred: OGRE EXCEPTION(2:InvalidParametersException): Option named Content Scaling Factor does not exist. in GLESSupport::setConfigOption at /Users/console_02/ogre/RenderSystems/GLES/src/OgreGLESSupport.cpp (line 44)

Now. I can't be sure where I have to set "Content Scaling Factor=2.0", doesn't this for ogre.cfg?
How should I solve this issue? Especially where I should set "Content Scaling Factor=2.0" ?

Looking forward to your answer.

Re: issue of iphone 4 high-resolution (640 x 960)

Posted: Fri Sep 17, 2010 5:32 am
by masterfalcon
Are you using the prebuilt SDK? The high resolution code is in the 1.7 branch but was added after the 1.7.1 release so you'll have to build it from source.

Re: issue of iphone 4 high-resolution (640 x 960)

Posted: Fri Sep 17, 2010 6:38 am
by kalashni7
I was been using 1.7.1 relase from this url: http://www.ogre3d.org/forums/viewtopic.php?f=4&t=59155

but it seems like old version since I got this @ July.
So I gonna get lastest release today and re-build this from now.

After this all this done, What should i do for render high resolution?
Please help me more detail way to do this. :)

Re: issue of iphone 4 high-resolution (640 x 960)

Posted: Fri Sep 17, 2010 7:36 am
by masterfalcon
The default behavior is to use the highest resolution available so there's nothing that you will need to do. It wouldn't hurt to delete your app from the device or simulator first just to make sure that a new ogre.cfg is generated.

Re: issue of iphone 4 high-resolution (640 x 960)

Posted: Mon Sep 27, 2010 10:45 am
by kalashni7
It is well.
Thanks for the quick reply. :)