Metal app on macOS lags when for example using the menu - macos

I'm playing around with Metal and MetalKit on macOS. It works fine for the most part, but in everything I've built so far the rendering will lag for a brief moment when I do things in the menu bar or hover my mouse over the dock. It's kind of annoying.
The easiest way to reproduce this effect is by trying Apple's own 'Device Selection and Fallback for Graphics Rendering' Sample. I've observed the issue on macOS 10.13 and 10.14.
Does anyone have an idea how to fix this issue?
Core Animation won't lag like that, but it's not suitable for what I would like to do. I believe it's built on top of Metal these days though, making me believe that it should be possible to get rid of the lag.

Related

Use RealityKit ARView on macOS

I'm trying to use an ARView in a macOS-only project. I can load a scene (tested with a Reality file from Reality Composer), and it renders fine.
But how do I control the camera with the mouse?
An example of this is Reality Composer, Reality Converter, and previewing a Reality file in Xcode where you can drag anywhere on the view and the camera pans, rotates, etc. In SceneKit the equivalent is allowsCameraControl
There's no cameraMode on the macOS ARView, probably because it only supports nonAR anyway.
I tried adding a PerspectiveCamera hoping it would unlock interactivity, but no luck.
I guess I could just implement all the gestures myself, but that's a lot of work, and Apple seems to be using a standard way to interact with the scene with a mouse - and also a standard grid, which I'd love to use, too.
I'm using macOS 12 beta 1, but it shouldn't make a big difference since ARView requires macOS 10.15
Neither in macOS nor in iOS, RealityKit has a property similar to SceneKit's .allowsCameraControl. However, using this code as a starting point, you can create your own camera control in RealityKit.
This post can also be helpful for you.

macOS Big Sur VMWare Horizon Client 8.1 laggy mouse

Has anyone dealt with an issue in VMWare Horizon on macOS Big Sur where the mouse is horrendously laggy? The lag is most noticeable when hovering over areas with text-input. This can be in my code editor, in a web browser search bar, sticky note, etc. Any and all text-input areas lag ridiculously. The mouse slows to a near stop and takes sometimes over a minute to drag across the screen. My mouse has different DPI toggles and I tried seeing if adjusting the DPI fixes it, and in some instances it made it worse. Using the trackpad on my laptop yields the same results so I don't believe its my mouse.
I researched the issue and people had similar problems, suggestions included enabling "Relative Mouse", toggling "Display Scaling" and "Use Full Resolution for Retina Display". None of them seem to be doing much of anything to remedy the lag. Anyone have suggestions on what to do? Thanks

On MacOS with Qt5.3.1 QToolBar is black when attached

I have a QMainWindow Application that uses several QToolBars. My program works on Linux, Windows and MacOS, however on MacOs the QToolbar behaves a little bit funky. When attached to the MainWindow it is just black as shown here
When I detach it it is grey as you would expect it to be
Also when I maximize to program the toolbar creates artifacts like this
Do I need any MacOS specific things for the QToolBar?
I'm hitting this bug too. I think it is linked to using non-alien widgets inside the toolbar or app wide.
Are you using setAttribute(Qt::AA_NativeWindows);? If so, try removing it.
Would you happen to have a QGLWidget-based UI element in your application? If so, apparently this is a known issue.
https://bugreports.qt.io/browse/QTBUG-41679
I am experiencing the "double-vision" aspect of this on a Qt 5.7.0-based app.

AS3 OSX's quirky scroll effect ruins mousewheel controls

I'm building a web app to design and animate simple 3d scenes using the Away3D library, but the design of the interface itself is built around a scrolling menu which takes up the whole height of the screen.
The problem is, on OSX browsers have a silly quirk where if the page is scrolled when it has already gone as far as it can, the page can be dragged slightly further, revealing a brushed metal background. This looks nice and whatnot, but it pretty much ruins scrolling in a swf object. I use flash builder and export to safari, which is just about useable, if pretty annoying (especially with a mac touchpad, which can give a much higher scroll delta than a mousewheel can), but when I open my app in firefox/chrome the same effect happens, and causes the app and browser to slow down drastically.
I've found code which uses ExternalInterface to stop the swf sending mouse events to the page, but they all seem to disable detection in the swf as well, and I can't find anything else which help. If anyone knows of a solution you'll be saving me from throwing a few months' work away for what seems like a suspiciously unnecessary drawback to Flash on OSX!
Thanks in advance if anyone can help
Figured it out, in case anyone else gets stuck with this:
The feature's called elastic scrolling, if you're running a flash/flex app which takes up all the browser space you can simply set body{overflow: hidden;} in page CSS and it'll work just fine. Obviously, this disables any kind of page-scrolling - I believe you can turn it back on inside nested elements though.
Hope this helps someone anyway!

keyboard splitting hangs in opengl app

I have OpenGL application with UITextField in the main menu. When I tap on the text field the keyboard appears and I can edit the text. But if I running under iOS 5 and if I try to split keyboard then the keyboard starts splitting (I mean animation) and then hangs when I release my fingers. I mean it hangs on half splitting - and does not responds more. But my app is still alive - and render is working well - background animation is still working.
I have just made a simple test - have disabled the render at all. And the problem has gone. So the problem is related to OpenGL.
I use OpenGL ES 1.1,
XCode 4.2 and iOS SDK 5.0.
Do somebody have similar problems? Any suggestions?
Please help.
UPDATE:
I have just tested two more games from AppStore - and in one I have found this problem too!
'Roads of Rome HD free' - iPad game.
I've encountered this problem too, but I was able to fix it due to previous experiences. In one application we found that if we keep our GL view active while playing video, the video playback position slider didn't behave smoothly. The same seems to happen with the keyboard split. If your problem is the same as mine, the issue is related to the keyboard split animation not finishing (and, in our case, the point where remained struck varied with each test)
We solved the issue stopping the animation on your GL view (I bet it's called EAGLView) when receiving a UIKeyboardWillChangeFrame notification and starting it again after UIKeyboardDidChangeFrame.
Old post, but I just came across this problem in ios 8 on an iPad3.
Running an OpenGL app at 60fps seems to throttle the keyboard update. Reducing your FPS while the keyboard overlay is active will fix the issue.
I'm using GLKViewController to manage the update and Draw callbacks with a 60fps refresh, but that was causing the keyboard split to lock up half completed.
I found the best solution for me was to set the view's preferredFramesPerSecond to 20 while receiving text input, and then set back to 60 after the textView is closed. As well as fixing the keyboard hang, it also just makes the keyboard generally more responsive.
myViewController.preferredFramesPerSecond = 20;

Resources