Screen Garbage on OSX Cocoa Build
-
- Gnoblar
- Posts: 17
- Joined: Wed Nov 10, 2010 6:08 pm
Screen Garbage on OSX Cocoa Build
Hi!
When launching a Cocoa (32 and 64 bits) application that uses the latest Ogre 1.7.3 the Ogre window displays garbage for a while with the GPU buffer contents as in the screenshot attached. Tried calling Viewport->clear and RenderSystem->clearFrameBuffer without effect.
Since this doesn't happen with the Windows build, it doesn't seem "by design" and maybe it could be fixed in the future?
Best regards,
Jorge
When launching a Cocoa (32 and 64 bits) application that uses the latest Ogre 1.7.3 the Ogre window displays garbage for a while with the GPU buffer contents as in the screenshot attached. Tried calling Viewport->clear and RenderSystem->clearFrameBuffer without effect.
Since this doesn't happen with the Windows build, it doesn't seem "by design" and maybe it could be fixed in the future?
Best regards,
Jorge
- masterfalcon
- OGRE Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
- Contact:
Re: Screen Garbage on OSX Cocoa Build
Would you be able to try with the latest code in the 1.7 branch to see if the issue still exists? I suspect that it does, but I just want to be sure.
-
- Gnoblar
- Posts: 17
- Joined: Wed Nov 10, 2010 6:08 pm
Re: Screen Garbage on OSX Cocoa Build
It's been a while now - I've compiled 1.7.3 from source and the screen garbage magically went away.
Later on, updating to the 1.7.4 and 1.8.0 SDKs, garbage is back again. Just recently I learned that the 1.7.3 build I though was fine is also displaying garbage on other GPUs.
This is what I've been able to find:
1) It happens on renderOneFrame-style rendering to an external window in Cocoa.
2) A call to RenderWindow->windowMovedOrResized() is issued before rendering starts.
3) Garbage is displayed in the first call to root->renderOneFrame(), the next calls all render fine.
For now I'm calling renderOneFrame twice on the initial frame, in order for the garbage to show far as little time as possible but of course it's still somewhat noticeable.
Any suggestions on things I could try to make this go away?
Thanks and Best Regards,
Jorge
Later on, updating to the 1.7.4 and 1.8.0 SDKs, garbage is back again. Just recently I learned that the 1.7.3 build I though was fine is also displaying garbage on other GPUs.
This is what I've been able to find:
1) It happens on renderOneFrame-style rendering to an external window in Cocoa.
2) A call to RenderWindow->windowMovedOrResized() is issued before rendering starts.
3) Garbage is displayed in the first call to root->renderOneFrame(), the next calls all render fine.
For now I'm calling renderOneFrame twice on the initial frame, in order for the garbage to show far as little time as possible but of course it's still somewhat noticeable.
Any suggestions on things I could try to make this go away?
Thanks and Best Regards,
Jorge
- masterfalcon
- OGRE Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
- Contact:
Re: Screen Garbage on OSX Cocoa Build
A sample project to demonstrate the issue might be best.
-
- Gnoblar
- Posts: 17
- Joined: Wed Nov 10, 2010 6:08 pm
Re: Screen Garbage on OSX Cocoa Build
Hi!
I prepared an Xcode 4.3 sample project showing the problem, it's available here:
http://pixplant.com/lab/wxWidgetsAndOgre-local.zip
It uses wxWidgets - all the necessary libs and headers are inside the external/ sub-folder and set in the project.
You'll need however to add your Ogre.framework and the RenderSystem_GL.dylib to the project, and change the "Header Search Paths" in the Build Settings to your Ogre SDK.
Build and run it and press the button at the bottom to see the garbage displayed on the first call to renderOneFrame(). Press more times and it renders fine thereafter.
Thanks for looking into this - best regards,
Jorge
I prepared an Xcode 4.3 sample project showing the problem, it's available here:
http://pixplant.com/lab/wxWidgetsAndOgre-local.zip
It uses wxWidgets - all the necessary libs and headers are inside the external/ sub-folder and set in the project.
You'll need however to add your Ogre.framework and the RenderSystem_GL.dylib to the project, and change the "Header Search Paths" in the Build Settings to your Ogre SDK.
Build and run it and press the button at the bottom to see the garbage displayed on the first call to renderOneFrame(). Press more times and it renders fine thereafter.
Thanks for looking into this - best regards,
Jorge
- masterfalcon
- OGRE Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
- Contact:
Re: Screen Garbage on OSX Cocoa Build
Thanks for your test program. It made testing this very easy. I've found a fix and I'll commit it to the 1.8 branch soon. This is actually a bug that I've been chasing for a while.
-
- Gnoblar
- Posts: 17
- Joined: Wed Nov 10, 2010 6:08 pm
Re: Screen Garbage on OSX Cocoa Build
Great to know that! Could you kindly post here when you submit the fix?
Hopefully this bug is the same as another one which I haven't been able to reproduce so far and have only learned from user reports: visually-similar garbage randomly appears on the 3D rendering area and in one case it even appears outside the rendering area in the surrounding UI. But I could never reproduce this problem in the hardware I have access to - fingers crossed that it could be the one you are now fixing!
Best Regards,
Jorge
Hopefully this bug is the same as another one which I haven't been able to reproduce so far and have only learned from user reports: visually-similar garbage randomly appears on the 3D rendering area and in one case it even appears outside the rendering area in the surrounding UI. But I could never reproduce this problem in the hardware I have access to - fingers crossed that it could be the one you are now fixing!
Best Regards,
Jorge
- masterfalcon
- OGRE Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
- Contact:
Re: Screen Garbage on OSX Cocoa Build
Sure thing! I pushed the change last night.
-
- Gnoblar
- Posts: 17
- Joined: Wed Nov 10, 2010 6:08 pm
Re: Screen Garbage on OSX Cocoa Build
Hi!
I pulled the 1.8 branch after your submission ( https://bitbucket.org/sinbad/ogre/chang ... 9ac107878a ) and built from there, however the problem still occurs as before in the project I've sent.
I've double-checked that the downloaded OgreOSXCocoaWindow.mm contains your changes and that there no confusions with old libs being linked and did a clean build - but garbage is still displayed...
Best Regards,
Jorge
I pulled the 1.8 branch after your submission ( https://bitbucket.org/sinbad/ogre/chang ... 9ac107878a ) and built from there, however the problem still occurs as before in the project I've sent.
I've double-checked that the downloaded OgreOSXCocoaWindow.mm contains your changes and that there no confusions with old libs being linked and did a clean build - but garbage is still displayed...
Best Regards,
Jorge
- masterfalcon
- OGRE Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
- Contact:
Re: Screen Garbage on OSX Cocoa Build
Hmm, it worked for me. I'll have to check it out again.
- masterfalcon
- OGRE Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
- Contact:
Re: Screen Garbage on OSX Cocoa Build
Ok, I think I've got it for real this time.
-
- Gnoblar
- Posts: 17
- Joined: Wed Nov 10, 2010 6:08 pm
Re: Screen Garbage on OSX Cocoa Build
Hi masterfalcon,
I'm sorry for bringing bad news but after downloading the v1-8 branch with your latest changes, it's still displaying garbage in the first frame, tested in a GeForce 9400M.
I compiled the above example project with this latest v1-8 branch, maybe it helps:
http://www.pixplant.com/lab/App.app.zip
Regards,
Jorge
I'm sorry for bringing bad news but after downloading the v1-8 branch with your latest changes, it's still displaying garbage in the first frame, tested in a GeForce 9400M.
I compiled the above example project with this latest v1-8 branch, maybe it helps:
http://www.pixplant.com/lab/App.app.zip
Regards,
Jorge
-
- Kobold
- Posts: 35
- Joined: Sun Jul 26, 2009 10:19 am
Re: Screen Garbage on OSX Cocoa Build
i get around this issue by issuing a call to 'windowMovedOrResized' on the window the cocoa setup code creates - here ov is my OgreView subclass that I have setup in a NIB file. Possibly this will help?
Code: Select all
// Ask for a new window passing in the ogreView in our nib file
Ogre::NameValuePairList misc;
misc["macAPI"]="cocoa";
Ogre::String windowHandle=Ogre::StringConverter::toString((size_t)ov);
misc["externalWindowHandle"]=windowHandle;
ogreRoot->createRenderWindow("3D View", 0, 0, false, &misc);
mWindow = [ov ogreWindow];
mWindow->windowMovedOrResized();
-
- Gnoblar
- Posts: 17
- Joined: Wed Nov 10, 2010 6:08 pm
Re: Screen Garbage on OSX Cocoa Build
Thanks for the suggestion. I tried in the example above, adding the call to windowMovedOrResized() immediately after calling createRenderWindow() but the behavior is the same: garbage is always displayed in the first frame. Possibly it doesn't work here because the context is different: the external window is not created via a NIB but by wxWidgets...
Best regards,
Jorge
Best regards,
Jorge
- Wolfmanfx
- OGRE Team Member
- Posts: 1525
- Joined: Fri Feb 03, 2006 10:37 pm
- Location: Austria - Leoben
- x 99
- Contact: