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 09:50:44 +0100
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:u7RnyR2L+2fl5p7ksmDT+DRfVm0co7zxezQtwd8ZsesXKvjxwZ3uMQTl6Ol3ixeRBMOHsqIC07ad6vm7ESxYuNDd6S9EKMQNHzY+yuwu1zQ6B8CEDUCpZNXLVAcdWPp4aVl+4nugOlJUEsutL3fbo3m18CJAUk6nbVk9Kev6AJPdgNqq3O6u5ZLTfx9IhD2gar9uMRm6twrcutQVjId4Nqo8xRTFrmZVd+lY2GhkIU6fkwvm6sq/4ZJu8T5ct+49+8JFTK73Y7k2QbtEATo8Lms7/tfrtR7NTQuO4nsTTGAbmQdWDgbG8R/3QI7/vjP1ueRh1iaaO9b2Ta0vVjS586hrUh7ohzwZODM/7Wral9Z/jKNfoBKmuhx/34vZa5ybOfZiYq/Qe84RSGxcVchTSiNBGJuxYIQBD+UDPehWoYrzqUYQoxSiHgSjHv/jxyVSi3PqwaE30eIsGhzG0gw6GNIOtWzZotLvO6YdUOC1ybfHxijCYfNX3Dfy9o7Ichc8qvyLWLJ/a8XQyUgqFwzblFmQpo3lPzaL2eQLtGiW9OVgVee1hG4mrwF9uCSgxsApioTQgI8e11/L+zljzokvOd24VFB0YcSiEJZItSyXKpV6Tt0/Tmx0vCs3yqEKtIOlcSUU1Zkr2RDRZuGZfoWH7RzuVuicLSp5iXxrZr6xiBa8/Ea+x+DzS8S4zVBHpTdLnNnLs3ACzR3T6s6fR/th4Eig1iqA2xrI6uFYOUw0mqvbK4Ihwr4tjZUfq1jMHijzmEnuja+WcF8k+umy5Oj9bLXmvJmRPJJ3hAHmKqkihNCzDOAiPgUNX2WX4/qw2KP98UHjXblHjeM6n6/Eu57AP8sbvLS2AwpN34Yj9Rm/CzCm3cwdnXYdLVJFfAuLj5HqO13TOfz4A+qzjleynDtxyPDGObrhAprJLnfdirvuYbF960tExAoyy9BQ+Y5UB6kfLP7vXkL9rt/VAx8jPwCq3errFs9x2p4dVG6RGqOZNbndsV6M5uIhOemMY4oVtS74K/c/6P/ujHo5lkEHcamm3JsXbW63HvJhI0iCbnrsh80OEWYOvgYkUOPqj1iCXSZJZ3muR6I8+i07CIW+AIjfSYCimriB0D6mEZ1XfWBJFk2MEWzzd4ifQPcNaCeSItd7nTAeVLihTZUh1RC0uwPgxbpnNLmcxysDqJi21MRp//aB0lYp5DlsBoKc1XuMRid6hCQTVjou1ed+p0J6jVyM2Kw9j/1DHsFI/KB0VBwnP77AyugvC8zuQhmTOZCSWVO+S5OnByswR5Q/2ZgVckNlEpKjiB7EmCGlCrtQm72QD4Ev6fHh2WPsLfpw22qT1LU9l0J0BYxUJGi+j+h+8RLSDsjHiQKChqOyfOMd2iDKs2yMxG7LsEBDWxNrSvb5WiUUaULS6Nj4/UjfVKSGCLI9MwIHx9TRBLFNb4jMhEVHQfqrF9XbbmS20zO1DAaJw77KY4vvdmMa9CrYAUkA1QsU+CDVZkAFGi69rjeGX3RVHlX1bha0qLUsmDaAVkYxijqyQQh5zbPso0wagPWdT7UY2bdW4H58+QUxJ0602pftM/TFpwdle/8CM9Y04VMCzGGA8gIkbsbmIKdliVoTNQ9wuhG2jkQlOsB7icEv6UgS4k93IKOc3klGcmrBj5/1M7zTbGL1+UL2Zg==

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




Archive powered by MHonArc 2.6.19+.

Top of Page