libnui / nui3

libnui v3
http://libnui.net
Mozilla Public License 2.0
163 stars 31 forks source link

Rendering is broken on iPad 3 (retina) w/ iOS 5.1 SDK #29

Open WhiteNoise opened 12 years ago

WhiteNoise commented 12 years ago

Display is corrupted on the new iPad - probably something is using the wrong screen size somewhere.

meeloo commented 12 years ago

ah shit. I don't have one :/. Can you send me a screenshot?

Thx!

Sebastien Metrot Yasound - CTO - Cofounder sebastien@yasound.com

On Mar 16, 2012, at 7:19 PM, WhiteNoise wrote:

Display is corrupted on the new iPad - probably something is using the wrong screen size somewhere.


Reply to this email directly or view it on GitHub: https://github.com/libnui/nui3/issues/29

meeloo commented 12 years ago

Wow. Seriously broken indeed.

I need to find some time to check it out.

S.

On Mar 16, 2012, at 7:22 PM, Sebastien Metrot wrote:

ah shit. I don't have one :/. Can you send me a screenshot?

Thx!

Sebastien Metrot Yasound - CTO - Cofounder sebastien@yasound.com

On Mar 16, 2012, at 7:19 PM, WhiteNoise wrote:

Display is corrupted on the new iPad - probably something is using the wrong screen size somewhere.


Reply to this email directly or view it on GitHub: https://github.com/libnui/nui3/issues/29

WhiteNoise commented 12 years ago

Yeah.. I'll take a look at it later tonight too. Apps compiled under the older 4.2 SDK don't have the problem (I'm guessing the retina display is disabled for those).

On Fri, Mar 16, 2012 at 2:28 PM, Sbastien Mtrot < reply@reply.github.com

wrote:

Wow. Seriously broken indeed.

I need to find some time to check it out.

S.

On Mar 16, 2012, at 7:22 PM, Sebastien Metrot wrote:

ah shit. I don't have one :/. Can you send me a screenshot?

Thx!

Sebastien Metrot Yasound - CTO - Cofounder sebastien@yasound.com

On Mar 16, 2012, at 7:19 PM, WhiteNoise wrote:

Display is corrupted on the new iPad - probably something is using the wrong screen size somewhere.


Reply to this email directly or view it on GitHub: https://github.com/libnui/nui3/issues/29


Reply to this email directly or view it on GitHub: https://github.com/libnui/nui3/issues/29#issuecomment-4545460

meeloo commented 12 years ago

can you check if there is the same pbm with the simulator in "retina display for new iPad mode"?

On Mar 16, 2012, at 7:22 PM, Sebastien Metrot wrote:

ah shit. I don't have one :/. Can you send me a screenshot?

Thx!

Sebastien Metrot Yasound - CTO - Cofounder sebastien@yasound.com

On Mar 16, 2012, at 7:19 PM, WhiteNoise wrote:

Display is corrupted on the new iPad - probably something is using the wrong screen size somewhere.


Reply to this email directly or view it on GitHub: https://github.com/libnui/nui3/issues/29

WhiteNoise commented 12 years ago

will do

On Fri, Mar 16, 2012 at 2:44 PM, Sbastien Mtrot < reply@reply.github.com

wrote:

can you check if there is the same pbm with the simulator in "retina display for new iPad mode"?

On Mar 16, 2012, at 7:22 PM, Sebastien Metrot wrote:

ah shit. I don't have one :/. Can you send me a screenshot?

Thx!

Sebastien Metrot Yasound - CTO - Cofounder sebastien@yasound.com

On Mar 16, 2012, at 7:19 PM, WhiteNoise wrote:

Display is corrupted on the new iPad - probably something is using the wrong screen size somewhere.


Reply to this email directly or view it on GitHub: https://github.com/libnui/nui3/issues/29


Reply to this email directly or view it on GitHub: https://github.com/libnui/nui3/issues/29#issuecomment-4545615

WhiteNoise commented 12 years ago

Unfortunately it does not happen in the simulator :/

What it looks like to me is that everything in the backing buffer (ie, everything that does not need to be redrawn) is getting scaled down and shifted to the right every frame. Like it if it was getting drawn into a rectangle that is 1,0,2047,1536 instead of 0,0,2048,1536

Setting EnablePartialRedraw(false) fixes the glitch so that may atleast be a temporary solution. I'm gonna keep digging around.

-Dave

On Fri, Mar 16, 2012 at 2:58 PM, David Wallin dwallin33@gmail.com wrote:

will do

On Fri, Mar 16, 2012 at 2:44 PM, Sbastien Mtrot < reply@reply.github.com

wrote:

can you check if there is the same pbm with the simulator in "retina display for new iPad mode"?

On Mar 16, 2012, at 7:22 PM, Sebastien Metrot wrote:

ah shit. I don't have one :/. Can you send me a screenshot?

Thx!

Sebastien Metrot Yasound - CTO - Cofounder sebastien@yasound.com

On Mar 16, 2012, at 7:19 PM, WhiteNoise wrote:

Display is corrupted on the new iPad - probably something is using the wrong screen size somewhere.


Reply to this email directly or view it on GitHub: https://github.com/libnui/nui3/issues/29


Reply to this email directly or view it on GitHub: https://github.com/libnui/nui3/issues/29#issuecomment-4545615

meeloo commented 12 years ago

Hey David,

I have just put my hands on the new iPad. I investigated the problem and found this: http://stackoverflow.com/questions/9753230/ipad-3-opengl-bug-with-keagldrawablepropertyretainedbacking-and-retina Which is exactly what we are seeing there. Among the solutions the first that came to my mind was to rewrite the rendering code so that it renders to an offline texture instead of the back buffer but doing this will take time (and I'm quite short on time right now). I have another possible solution which doesn't involve turning off partial redraw (which might kill you perfomance wise) but turning of retina support. You can check out how it would look by forcing it:

got to nui3/src/Window/iOS/nglVideoMode_UIKit.mm line 102 & replace

float nuiGetScaleFactor()
{
  if (gScaleFactor == 0)
  {
    gScaleFactor = [UIScreen mainScreen].scale; 
  }

  return gScaleFactor;
}

With:

float nuiGetScaleFactor()
{
  if (gScaleFactor == 0)
  {
//    gScaleFactor = [UIScreen mainScreen].scale; 
    gScaleFactor = 1.0f; 
  }

  return gScaleFactor;
}

We can wish that apple will fix this in the next OS update (and hope they don't wait too long...).

S.

WhiteNoise commented 12 years ago

Hi Sébastien, that definitely sounds like the bug.

Performance doesn't seem too bad, even with partial redraw off. I'm fine waiting for apple to (hopefully) fix the bug. I'd rather not disable retina mode, since it looks much better with retina display and I already created all the retina graphics.

-Dave

On Sun, Apr 15, 2012 at 5:37 PM, Sébastien Métrot < reply@reply.github.com

wrote:

Hey David,

I have just put my hands on the new iPad. I investigated the problem and found this: http://stackoverflow.com/questions/9753230/ipad-3-opengl-bug-with-keagldrawablepropertyretainedbacking-and-retina Which is exactly what we are seeing there. Among the solutions the first that came to my mind was to rewrite the rendering code so that it renders to an offline texture instead of the back buffer but doing this will take time (and I'm quite short on time right now). I have another possible solution which doesn't involve turning off partial redraw (which might kill you perfomance wise) but turning of retina support. You can check out how it would look by forcing it:

got to nui3/src/Window/iOS/nglVideoMode_UIKit.mm line 102 & replace float nuiGetScaleFactor() { if (gScaleFactor == 0) { gScaleFactor = [UIScreen mainScreen].scale; }

return gScaleFactor; }

With: float nuiGetScaleFactor() { if (gScaleFactor == 0) { // gScaleFactor = [UIScreen mainScreen].scale; gScaleFactor = 1.0f; }

return gScaleFactor; }

We can wish that apple will fix this in the next OS update (and hope they don't wait too long...).

S.


Reply to this email directly or view it on GitHub: https://github.com/libnui/nui3/issues/29#issuecomment-5142848

mathieugarcia commented 12 years ago

Still not fixed as of iOS 5.1.1, thank you Apple. Some official discussion here: https://devforums.apple.com/message/635463#635463