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

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
Post Reply
kalashni7
Gnoblar
Posts: 8
Joined: Mon Jul 19, 2010 7:38 am
Location: seoul, korea
Contact:

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

Post 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
----------------------------------------
Last edited by kalashni7 on Mon Sep 27, 2010 10:46 am, edited 1 time in total.
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

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

Post 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
kalashni7
Gnoblar
Posts: 8
Joined: Mon Jul 19, 2010 7:38 am
Location: seoul, korea
Contact:

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

Post 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.
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

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

Post 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.
kalashni7
Gnoblar
Posts: 8
Joined: Mon Jul 19, 2010 7:38 am
Location: seoul, korea
Contact:

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

Post 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. :)
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

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

Post 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.
kalashni7
Gnoblar
Posts: 8
Joined: Mon Jul 19, 2010 7:38 am
Location: seoul, korea
Contact:

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

Post by kalashni7 »

It is well.
Thanks for the quick reply. :)
Post Reply