Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] OpenGL problem in CGAL

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] OpenGL problem in CGAL


Chronological Thread 
  • From: David Rochera <>
  • To:
  • Subject: Re: [cgal-discuss] OpenGL problem in CGAL
  • Date: Thu, 14 Jan 2021 13:03:06 +0100
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:cVhMdBJ4j/d2B/LPhNmcpTZWNBhigK39O0sv0rFitYgXKvT7rarrMEGX3/hxlliBBdydt6sVzbKO+Pi6ESxYuNDd6S9EKMQNHzY+yuwu1zQ6B8CEDUCpZNXLVAcdWPp4aVl+4nugOlJUEsutL3fbo3m18CJAUk6nbVk9Kev6AJPdgNqq3O6u5ZLTfx9IhD2gar9uMRm6twrcutQSjId4Nqo91hTFrmdWd+9LwW9kOU+fkwzz68ut/pNv6Thct+4k+8VdTaj0YqM0QKBCAj87KW41/srrtRfCTQuL+HQRV3gdnwRLDQbY8hz0R4/9vSTmuOVz3imaJtD2QqsvWTu+9adrSQTnhzkBOjUk7WzYkM1wjKZcoBK8uxxyxpPfbY+JOPZieK7WYNUXTndDUMlMTSxMGoyzb4UNAOQBM+hWrJTzqUUSohalHwagGPnixyVUinPq36A31fkqHwHc3AwnGtIDqHrao8/rNKcTTO++0bXGzTLfYPNWxzj98pLHeQ0mrP6RR7JwdtbeyUkxGAPflFqdspfqMC+P2eQIqWeb8+pgWfioi249pAF8uz6izdojhYfVnIwa0EzE9Tlnz4YvI921UFJ3bN24HJZRqyyXM4t4T90sTW9opSs0xbkLtYOlcCULyJkpyADTZvyZfoSU4hzuVuafLDVmiH54Zb+zmRi8/Eqmx+bhWMe011NKoTBEktnKrn0NywLc68ebRfdn5UehxS6D1w/S6uFYIUA0iLHUJ4Q9zb43k5ofqUXDHinsmEX3lqCabEsk+vKu5u/6YbvmvoeRO5Fohgz6KKgjmcyyDf4lPgUPXWWX4+ux2bPl8EbkWrtFlOc2nbPcsJ3CJcQUuKq5AwhN34Ym8Rm/DjOm3M0cnXkJMV5JYRyHgofnNl3UL/D4CvC/g1uokDh13fzJIrrhApDVInjClrfuY6p95lZCxAYvyd1T/ZFZB7EbLP7uW0L8tsbUAxA3PgCsxuboEtR91ocQWWKVBa+ZNbvfvkKS5uIoP+aMZJEauCznJPU+/PHhkWU2mVoHcqm13Zsbcne4Hu5pI0mBe3rjns8BEXsWvgo5VOHllFKCXiRXZ3qrQq085yo7B567DYfYXYCgm6eB3Se+Hp1OfG9KEFGMEXHyd4WFQfgAciySItUy2gECTqWrHo89yQm15ki90KtiNuOS+ysCtJul2sIy/PzWjRh19Dp6CIOW3GiJCm11hWgVXCRl4aZkvEZd1lKHhKhkn+RDR5sU/OJMSg58NJjGzuU8Bcq1QRPEZt7OSVCoRZKtDjg1C94w2NQTeF0uJtO5kxr/0jq2Vr8Ji6SQVttz6bPZx3G3JsBnyn+A2rNmlEgjWsIINGuogel0+AHXQoLIiE6EjL35SaNJ1yHE8CKPzHGFoVpDeA92S6TMG34FNWXMqtGsykrcTrPmM7MsMgZbwIbWJrFNYd3kl1xuTvzqPd3CYyS2gWjmVkXA/a+FcIe/IzZV5y7aEkVRy1lCr0bDDhA3A2Kam0ybCTVvEVz1ZEa1qrt0o3q+R1M0iQaQYB84jubnylsunfWZDsgr8Pccoi548Gd+F1+41s7WTd2aqFg5JfgOUZYG+F5CkFnhmUl9M5indf0wg1cfd0FzsRqr2UksTIpHlscuoTUhyw8gca8=

Hi, Maxime,

Add to the previous item 3 that the "Polyhedron_3" demo also shows the warning

QOpenGLVertexArrayObject::destroy() failed to restore current context


when closing the window. Thanks a lot!

Best wishes,

David

On Thu, 14 Jan 2021 at 12:49, Maxime Gimeno <> wrote:
Thanks a lot for the detailed report, I'll look into each of those.
The LCC_3 demo is known to be broken, there is an ongoing fix. I'll come to you again soon, with new updates.

Le jeu. 14 janv. 2021 à 12:22, David Rochera <> a écrit :
Yes, thank you very much for your work! I have been testing this morning all the modified examples and demos to be sure everything works fine. In general, they seem to work correctly, however I have some comments for the demos:

1. Regarding the AABB_tree demo, it works fine but the points are displayed very very small (just a pixel), so that they can hardly be seen (and I don't know a way to increase their size inside the demo; in other demos, the default point size is bigger and they can be clearly seen at first).


2. Although I believe that they work correctly, the demos "periodic_3_triangulation_3_demo", "Periodic_Lloyd_3", "T3_demo" and "PCA_demo" still show the messages

GL 4.3 context initialization failed. 

Using context  2 . 1 GL


and


QOpenGLVertexArrayObject::destroy() failed to restore current context 


when closing the window.



3. The demos "Alpha_shape_3" and "Circular_kernel_3"  (display correctly the 4.1 context but) when closing the window still show the message:

QOpenGLVertexArrayObject::destroy() failed to restore current context



4. The worst thing happens when initializing the "Linear_cell_complex_3_demo". It shows the message

zsh: segmentation fault  ./Linear_cell_complex_3_demo


and it does not work (I don't know if this has to do with the new PR since I have never run this demo before). See attached the problem report.

Best wishes and thank you very much again! :)

David




On Thu, 14 Jan 2021 at 09:51, Maxime Gimeno <> wrote:
Ok, I think I just fixed it.

Le mer. 13 janv. 2021 à 16:33, David Rochera <> a écrit :
Hi Maxime,

I tested one of the examples and now it works perfectly. Unfortunately, I tried the AABB_tree demo and it does not work yet, I get:

Using context  4 . 1 GL

QOpenGLShader::compile(Fragment): ERROR: 0:6: Invalid call of undeclared identifier 'texture2D'


*** Problematic Fragment shader source code ***

#version 150 

#ifdef GL_KHR_blend_equation_advanced

#extension GL_ARB_fragment_coord_conventions : enable

#extension GL_KHR_blend_equation_advanced : enable

#endif

#define lowp

#define mediump

#define highp

#line 1

uniform sampler2D texture;

in highp vec2 texc;

out highp vec4 out_color; 

void main(void) { 

out_color = texture2D(texture, texc.st);

} 



***

Compiling fragmentsource FAILED

QOpenGLShader::link: ERROR: One or more attached shaders not successfully compiled


linking Program FAILED

QOpenGLShader::link: ERROR: One or more attached shaders not successfully compiled


QOpenGLShaderProgram::attributeLocation(vertex): shader program is not linked

QOpenGLShader::link: ERROR: One or more attached shaders not successfully compiled


QOpenGLShaderProgram::attributeLocation(tex_coord): shader program is not linked

QOpenGLShader::link: ERROR: One or more attached shaders not successfully compiled



Similar warnings when using it and when closing the window:


Write setting... done.

QOpenGLVertexArrayObject::destroy() failed to restore current context



Best wishes,


David


On Wed, 13 Jan 2021 at 15:25, Maxime Gimeno <> wrote:
Hi, 
I updated my PR with a generalization of my fix to all demos, I hope it works now.

Maxime

Le jeu. 7 janv. 2021 à 16:28, David Rochera <> a écrit :
Thank you very much, Maxime! I've tested it and now the points and edges are perfectly displayed in the examples!

I don't know if it's important, but just let you know that when the Basic Viewer window is closed, the following line is still shown:

    QOpenGLVertexArrayObject::destroy() failed to restore current context


In addition, there may be some demos in which the 4.1 context still does not work... In particular, I tried the AABB_tree demo.

Best wishes,

David

On Thu, 7 Jan 2021 at 13:16, Maxime Gimeno <> wrote:
I made a PR to fix your specific issue : https://github.com/CGAL/cgal/pull/5336
If you don't want to wait for the next release, you can clone the branch and use it, it is based on CGAL-5.1

Le jeu. 7 janv. 2021 à 10:56, David Rochera <> a écrit :
Sorry, Sebastien, it was for CGAL version 5.1.1.

I downgraded because for the latest version, 5.2, I got an error message like the following when trying to compile the Polyhedron demo:

[  3%] Building CXX object CMakeFiles/demo_framework.dir/Viewer.cpp.o

/Users/drochera/Downloads/CGAL-David/Polyhedron/Viewer.cpp:1133:31: error: 

      too few arguments to function call, expected 2, have 1

    d->textRenderer->draw(this);

    ~~~~~~~~~~~~~~~~~~~~~     ^

/usr/local/include/CGAL/Three/TextRenderer.h:142:5: note: 'draw' declared here

    void draw(CGAL::Three::Viewer_interface* viewer, const QVector3D &scaler);

    ^

1 error generated.

make[2]: *** [CMakeFiles/demo_framework.dir/Viewer.cpp.o] Error 1

make[1]: *** [CMakeFiles/demo_framework.dir/all] Error 2

make: *** [all] Error 2


But this might be another different bug... (for the CGAL version 5.1.1 this error does not appear).

Best wishes.


On Thu, 7 Jan 2021 at 09:00, Maxime Gimeno <> wrote:
I opened an issue and I've been working on a fix since yesterday: https://github.com/CGAL/cgal/issues/5334

Le jeu. 7 janv. 2021 à 08:47, Sebastien Loriot <> a écrit :
What version of CGAL are you using?

Sebastien

On 1/5/21 8:47 PM, David Rochera wrote:
>> Hello, I'm new in CGAL and in this mailing list,
>>
>> I have been trying for many days to solve an OpenGL problem I have
>> when running some CGAL examples and demos but I could not solve it
>> yet. If some of you know the answer to this question I would be very
>> grateful. :)
>>
>> I'm using a fairly new Mac OS, where I have installed the last
>> versions of CGAL, Qt5 and many other optional libraries. The OpenGL
>> support was discontinued for Apple some years ago, so that my GL Core
>> version is up to 4.1. The problem is that after compiling and running
>> some CGAL examples and demos I get the warning:
>>
>> GL 4.3 context initialization failed.
>>
>> Using context  2 . 1 GL
>>
>>
>> This results in not being able to see vertices nor edges in the
>> Basic_viewer. I'm wondering how the 4.1 context could be set in order
>> to avoid such an issue. Looking at the CGAL Qt files, I can guess
>> that the 4.3 context is tried to be set and, if not found, the ES 2.0
>> context is displayed instead. Nevertheless, I guess there should be a
>> way to display the highest possible Mac OS context 4.1 because the
>> Polyhedron demo, for instance, works fine for me. If I run it, I can
>> see vertices and edges and indeed I get:
>>
>> Using context  4 . 1 GL
>>
>>
>> If the problem is regarding the OS, there should be many affected
>> CGAL users but I haven't found many people speaking about it in any
>> forum... so I don't know if I'm missing something.
>>
>>
>> Thank you very much and best wishes,
>>
>>
>> David
>>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss



--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss




Archive powered by MHonArc 2.6.19+.

Top of Page