Black screen when selecting objects from a sketch

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
dcapeletti
Posts: 383
Joined: Wed Jul 23, 2014 2:27 pm

Re: Black screen when selecting objects from a sketch

Postby dcapeletti » Tue Aug 27, 2019 11:15 pm

Forthman wrote:
Tue Aug 27, 2019 3:37 pm
I have the same problem ( black screen on selection) when anti-aliasing is on MSAA 8x
:o How did you determine that was?
User avatar
Forthman
Posts: 533
Joined: Fri Apr 27, 2018 11:23 am
Location: Tarn-et-Garonne (82)

Re: Black screen when selecting objects from a sketch

Postby Forthman » Wed Aug 28, 2019 5:55 am

chance :oops: :lol:
wmayer
Site Admin
Posts: 14897
Joined: Thu Feb 19, 2009 10:32 am

Re: Black screen when selecting objects from a sketch

Postby wmayer » Wed Aug 28, 2019 8:31 am

On my PC that recently crashed the issue did not appear but the old PC that I re-activated I can confirm the problem.
I have created the ticket issue #4103. Maybe we can find a way to get it reliably working when anti-aliasing is enabled.
wmayer
Site Admin
Posts: 14897
Joined: Thu Feb 19, 2009 10:32 am

Re: Black screen when selecting objects from a sketch

Postby wmayer » Mon Sep 16, 2019 10:02 pm

In the output window you can enable log messages and when doing the rubber band selection this message may appear: QOpenGLFramebufferObject: Unsupported framebuffer format.

The problem is that the combination of multi-sampling and internally requested texture format are not supported by the driver and then the message is printed.

In my case the maximum allowed multi-sampling (GL_MAX_SAMPLES) is even 16 but only 8 is requested by the application but in OpenGL an error is still set. What works for me is to reduce the multi-sampling to 4.
dxp.dev
Posts: 86
Joined: Tue Dec 11, 2018 12:57 pm

Re: Black screen when selecting objects from a sketch

Postby dxp.dev » Tue Sep 17, 2019 1:52 pm

That solved the issue for me, no more black screen.


18turbo wrote:
Tue Aug 27, 2019 5:24 pm
In Preferences -> Anti-aliasing: NONE

This solves the error/bug/problem :) for now.
But now every line, including the axes turn black after selection :

1 - No antialiasing - On selection.png
1 - No antialiasing - On selection.png (38.21 KiB) Viewed 136 times
2 - No antialiasing - After selection.png
2 - No antialiasing - After selection.png (33.84 KiB) Viewed 136 times

OS: macOS Mojave (10.14)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18213 (Git)
Build type: Release
Branch: master
Hash: 22babc09954ac6fda9135ee71d68550921659b1c
Python version: 3.7.3
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/Switzerland (fr_CH)
wmayer
Site Admin
Posts: 14897
Joined: Thu Feb 19, 2009 10:32 am

Re: Black screen when selecting objects from a sketch

Postby wmayer » Tue Sep 17, 2019 2:17 pm

I don't know if a universal fix is possible.

As said above the problem is a combination of the multi-samples and the internal texture format for the framebuffer. So one way to avoid this problem is by decreasing the multi-samples and now with git commit f4bc889b4 it's also possible to change the internal texture format.

Until now the hard-coded value was GL_RGB32F_ARB but it apparently caused problems on older systems. The value GL_RGB32F_ARB once was used because this was (on my old system) the only value where creating an image worked correctly if the model has semi-transparent surfaces. For a model without transparencies the default value works, too.

With the change the default value is not overridden any more and it's the same value used for the real rendering of a QOpenGLWidget. So, I hope that the rubber band selection and saving images works on older systems, too.

If people want/need to override this value then they should open the parameter editor and go to: BaseApp > Preferences > View and create a string of the name InternalTextureFormat. The value should be one of these: Default, GL_RGB, GL_RGBA, GL_RGB8, GL_RGBA8, GL_RGB10, GL_RGB10_A2, GL_RGB16, GL_RGBA16, GL_RGB32F or GL_RGBA32F.
chrisb
Posts: 19043
Joined: Tue Mar 17, 2015 9:14 am

Re: Black screen when selecting objects from a sketch

Postby chrisb » Tue Sep 17, 2019 4:14 pm

Thanks for the good news - and of course for the work. I hope that the save image will work here again.
chrisb
Posts: 19043
Joined: Tue Mar 17, 2015 9:14 am

Re: Black screen when selecting objects from a sketch

Postby chrisb » Sun Sep 22, 2019 6:45 pm

And it does fix the issue. After more than 2 years I can create images again! Thank you very much!