gkv311 / occt-samples-gtk

Open CASCADE Technology sample - 3D Viewer within GTK window
Other
13 stars 5 forks source link

onGlAreaRender fails on OpenGl_FrameBuffer::InitWrapper() #1

Closed f1t3 closed 2 years ago

f1t3 commented 2 years ago

The onGlAreaRender failes on OpenGl_FrameBuffer::InitWrapper() with the error message

TKOpenGl | Type: Error | ID: 0 | Severity: High | Message:
OpenGl_FrameBuffer::InitWrapper(), color attachment of unsupported type has been skipped!
Default FBO wrapper creation failed

I modified the sample code slightly for use with gtkmm 4. OCCT version is 7.6.0 dev snapshot, build yesterday.

gkv311 commented 2 years ago

Could you please share description of your host environment (Linux distro name and version, desktop environment, OpenGL version reported by glxinfo, etc.)? Have you tried building a sample using gktmm 3 (or it is impossible in your environment) to see if there is a difference between them in this aspect?

gkv311 commented 2 years ago

I've looked onto packages available in Ubuntu 21.04, and it seems 3.0 is the latest available version. Have you buit 4.0 from source code, configured some PPA or use Linux distributive with 4.0 packages?

~$ apt-cache search gtkmm
libgtkmm-3.0-1v5 - C++ wrappers for GTK+ (shared libraries)
libgtkmm-3.0-dev - C++ wrappers for GTK+ (development files)
libgtkmm-2.4-1v5 - C++ wrappers for GTK+ 2 (shared libraries)
libgtkmm-2.4-dev - C++ wrappers for GTK+ 2 (development files)
f1t3 commented 2 years ago

Host environment:

Linux Distro:Arch Linux, fully updated Desktop: Gnome-Shell on Xorg glxinfo dump:

$ glxinfo | grep version
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
OpenGL core profile version string: 4.6.0 NVIDIA 390.143
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL version string: 4.6.0 NVIDIA 390.143
OpenGL shading language version string: 4.60 NVIDIA
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 390.143
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

I just build the sample using gtkmm 3 and it compiles and runs just perfect, so the issue seems indeet to be related to gtkmm 4.

Here is the console output of the gtkmm 3 build:

TKOpenGl | Type: Other | ID: 0 | Severity: Medium | Message:
OpenGl_Window::CreateWindow: window Visual is incomplete: no depth buffer, no stencil buffer
GLXDirectRendering: Yes
GLXVendor: NVIDIA Corporation
GLXVersion: 1.4
GLXExtensions: GLX_EXT_visual_info (............................................................)
GLvendor: NVIDIA Corporation
GLdevice: GeForce GTX 460/PCIe/SSE2
GLversion: 3.2.0 NVIDIA 390.143 [GLSL: 1.50 NVIDIA via Cg compiler]
Max texture size: 16384
Max FBO dump size: 16384x16384
Max combined texture units: 192
Max MSAA samples: 32
Viewport: 720x389
GPU free memory: 671 MiB
GPU memory: 1024 MiB
GLextensions: GL_AMD_multi_draw_indirect  (..............................................)
ResolutionRatio: 1

And here is the console output of the gtkmm 4 build:

TKOpenGl | Type: Other | ID: 0 | Severity: Medium | Message:
OpenGl_Window::CreateWindow: window Visual is incomplete: no depth buffer, no stencil buffer
GLXDirectRendering: Yes
GLXVendor: NVIDIA Corporation
GLXVersion: 1.4
GLXExtensions: GLX_EXT_visual_info (...................)
GLvendor: NVIDIA Corporation
GLdevice: GeForce GTX 460/PCIe/SSE2
GLversion: 3.2.0 NVIDIA 390.143 [GLSL: 1.50 NVIDIA via Cg compiler]
Max texture size: 16384
Max FBO dump size: 16384x16384
Max combined texture units: 192
Max MSAA samples: 32
Viewport: 0x0
GPU free memory: 651 MiB
GPU memory: 1024 MiB
GLextensions: GL_AMD_multi_draw_indirect (..........................)
ResolutionRatio: 1

TKOpenGl | Type: Error | ID: 0 | Severity: High | Message:
OpenGl_FrameBuffer::InitWrapper(), color attachment of unsupported type has been skipped!
Default FBO wrapper creation failed
gkv311 commented 2 years ago

Unfortunately, gtkmm 4 packages could be barely found for now in existing Linux distributions, and I've been unable to build it from source code due to errors.

But you may try a blind workaround pushed to the git which might help.

f1t3 commented 2 years ago

The blind workaround worked. Now the GLArea is displayed as expected and no more errors occur. Thank you!