Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No 3D rendering(black area) on macOS #155

Open
HuguesDelorme opened this issue Sep 19, 2022 · 13 comments
Open

No 3D rendering(black area) on macOS #155

HuguesDelorme opened this issue Sep 19, 2022 · 13 comments
Assignees
Labels

Comments

@HuguesDelorme
Copy link
Member

Reported by @grexe in issue #151

However when trying to load a sample STEP file from nist.gov, namely this one, and opening nist_ftc_06_asme1_rd.stp, I only get a black canvas. The same file opens fine with e.g. CAD Assistant, which also uses OpenCascade.

Notice that some other user(@livigni) mentionned Mayo to run correctly on macOS(see #67 (comment))

@HuguesDelorme
Copy link
Member Author

@grexe
Is there any OpenGL error prompted in the terminal when running Mayo ?
Can you please post here Mayo's console output on your machine ?

As a workaround you can comment the if() block between lines 350-363 in src/app/main.cpp :

#if OCC_VERSION_HEX >= 0x070600 && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)

Build and run again

@grexe
Copy link

grexe commented Sep 19, 2022

This is the output I get (using MacOS 12.6 (21G115)):

gregor@Gregors-MacBook-Pro mayo.app % ./Contents/MacOS/mayo
DEBUG: OpenCascade settings file doesn't exist or is not readable [path=opencascade.conf]
INFO: OpenGL v2.1
WARNING: Back buffer dpr of 2 doesn't match <_NSViewBackingLayer: 0x60000170cb40> contents scale of 1 - updating layer to match.
WARNING: Back buffer dpr of 2 doesn't match <_NSViewBackingLayer: 0x60000170c270> contents scale of 1 - updating layer to match.
WARNING: Back buffer dpr of 2 doesn't match <_NSViewBackingLayer: 0x60000171a820> contents scale of 1 - updating layer to match.
WARNING: Back buffer dpr of 2 doesn't match <_NSViewBackingLayer: 0x600001718120> contents scale of 1 - updating layer to match.

will try the code change later.

@HuguesDelorme HuguesDelorme added this to the version/future milestone Jan 12, 2023
@zambetti
Copy link

zambetti commented Feb 2, 2023

Hello @HuguesDelorme & @grexe

I was experiencing this same issue on MacOS 13.0.1 (22A400), I followed your advice to comment out the block in main.cpp under the comment "// Use QOpenGLWidget if possible"

All is working fine now. Looking good.

@jhillhouse92
Copy link

jhillhouse92 commented Mar 7, 2023

@HuguesDelorme comment fixed it, on OS X Big Sur. Thanks!

@HuguesDelorme
Copy link
Member Author

@zambetti and @grexe
Please try new option Force OpenGL fallback widget to tweak OpenGL support.

@zambetti
Copy link

zambetti commented Mar 7, 2023

@HuguesDelorme I have just downloaded and built the latest version, and I can confirm the fallback widget works on my machine. Compliments on this nice application.

@andrsd
Copy link
Contributor

andrsd commented Mar 30, 2023

Hi!

I had the same issue with the black screen. I tried the fallback widget option (i.e. I turned it off and restarted mayo), but that did not work for me. Commenting out the whole block in src/app/main.cpp, i.e.:

#if OCC_VERSION_HEX >= 0x070600
...
#endif

(roughly lines 392-408) fixed my problem. Now, I can see the model.

I am on Ventura 13.1, Apple M1 chip, built mayo against Qt 6.2.4 (IDK if that matters).

@HuguesDelorme
Copy link
Member Author

@andrsd
The "fallback widget" option should be set to ON.
Please check again with that option turned ON(and without the comment of course)
Let me know your feedback!

@andrsd
Copy link
Contributor

andrsd commented Mar 31, 2023

The fallback widget was originally ON. I believe that's the default (?). That's when I had the issue with black screen, so I went to look for the cause and found this issue. I can try again.
I forgot to mention I built the this version: c85fe27

@andrsd
Copy link
Contributor

andrsd commented Mar 31, 2023

I tried a clean build of c85fe27, made sure the Fallback widget was ON and all works as expected. Hmmm... 🤔

@HuguesDelorme
Copy link
Member Author

@andrsd
I confirm the forceOpenGlFallbackWidget option is set to ON for macOS by default.

#ifndef MAYO_OS_MAC

I don't like this option, it's preferrable to fix the OpenGL framebuffer rendering with Qt for macOS
But until this gets fixed, seem like for macOS this workaround is required.

@andrsd
Copy link
Contributor

andrsd commented Mar 31, 2023

This is a pure guess and I might be totally wrong, but could it be that because MainWindow is created before appModule->settings()->resetAll(); is called, then on a clean machine (i.e. machine where mayo was never run before) for the first time the setting is not applied which would cause the black screen?

@HuguesDelorme
Copy link
Member Author

@andrsd
You might have spotted a potential issue, I need to check this.
The forceOpenGlFallbackWidget setting is explicitly loaded here:

AppModule::get()->settings()->loadProperty(&propForceOpenGlFallbackWidget);

But for some reason this could fail on the very first execution of Mayo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants