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: Maxime Gimeno <>
  • To:
  • Subject: Re: [cgal-discuss] OpenGL problem in CGAL
  • Date: Thu, 14 Jan 2021 12:49:27 +0100
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:RJJNfB3ycpaak6tysmDT+DRfVm0co7zxezQtwd8ZsesWI/nxwZ3uMQTl6Ol3ixeRBMOHsqMC07Kd6/qoGTRZp8rY7zZaKN0EfiRGoP1epxYnDs+BBB+zB9/RRAt+Iv5/UkR49WqwK0lfFZW2TVTTpnqv8WxaQU2nZkJ6KevvB4Hdkdm82fys9J3PeQVIgye2ba9vIBmsogjdq80bjZF+JqotxRfFvmVEcPlSyW90OF6fhRnx6tqy8ZJ57yhcp/ct/NNcXKvneKg1UaZWByk8PWAv483ruxjDTQ+R6XYZT24bjBlGDRXb4R/jRpv+vTf0ueR72CmBIM35Vqs0Vii476dqUxDnliEKPCMk/W7Ni8xwiKVboA+9pxF63oXZbp2ZOOZ4c6jAe94RWGhPUdtLVyFZDYy8YYkAAeoPM+hbsofzuUcBoACkCgWwHu7i0CNEimP00KA8zu8vERvG3AslH98Wt3rbttr0NKYXUe+r0aLGzDTDb/ZI1jf774jDbxcsofSWUrN/cMrRzFcgGxnKjlWRrIzqITWV1uMWvmiU6upvT+Ovi2o9pw5tpTivw94hh4/UjY0a1l7K7z92wJopJdKmUk57Z8apHZlNui2EKYd7X98vTmVotSom17ALp4C2cTUUxJop2hPSdfOKfYeK7x/tSeqcIDl2iGxqdry/iRu/70etx/DhWsSyzV1EoC1FktzWuXAM0Rze8tSHReVy/0i9wzqPzBzT5vlLIUA1iarbK4MhzaUqmpUPtkTDGzf6mETwjK+Md0Ur4PKk6+r9Yrjgu5SSNJd0hxngPqgynsGzG+c1PwgUU2SF5OiwyKfv8EL3TbhMk/Y4iLPWsIrAKsQevqO5AxFa0oIk6xunCjepytUYnX0eIFJCZBKLkpHlO1/BLf32F/u/jFOskDBkx/DCILLtGInCLn/GkLv5fLZ97VBTyBYrwNxB+55ZDqsNLfHzV0PrqtDUEwM1Pxa7zuvpENl905kRWWOLAq+XKqPStlqI6/oqI+aWa44VuTP9JOY/6/7hjH85nEESfa+u3ZYMZ3C4G+5pI0SdYXb2ntgBFmIKshIkTOP2kF2CTSJTZ3GqUq0g6TE0EoamAZ7eSYCsm7yOwDq7HoZNZm1dEVCNEXLod52eVPsWaSKSJNVhkj0eWrS7RY8hz0LmiQnh1rAyLvbI4jZK8tX4xd1t7qvSkwsz/Hp6FYOGwmSVRiZ1mG0PADQ51aQ6rU1mwUqYyvtFhedFH/xP4vccUhsmLYWOiKthGtXqU0TAeM2IQRCoWJK9EDQpR5UwxdEJJE1yEtHnghHY1DexGOwokaeWDqA54r6J32TtP90vjDHdxaw5hh8nRNFOPCuonOlk5g3LDsnIlUue0K2lfKBZ0C/W/3qY1jmyuxRTXwd0FKnERnsCfVD+rNLj50qEQaX9J64gN15kwN6DL6YCRdzsgFNBDKPmMcTfZm/3lGa1CBCP7ryJZYvuPW4a2XOOWwA/jwkP8CPeZkAFDSC7rjeGVW08JRfUe0rptNJGhja+R04wwRuNahQ4hbWw8x8Rw/ebTqFKh+5WiGIaszxxWW2F8ZfOEdPZ/lhueaxdZZU251IVjTuE5Tw4BYSpKuVZvnBbcwlzuBmzhRB+C4EFltRz6X12l0x9LqWX1F4HfDSdj8j9

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




Archive powered by MHonArc 2.6.19+.

Top of Page