Error GLSL 1.50 is not supported.

Hello people,

I’m new on this site. I am getting an error when trying to run a simple vtk representation program.
The error is
“error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES”
I use VTK8.0. Information on my computer:
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
Version: 18.0.5
Max core profile version: 3.3
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0
OpenGL version string: 3.0 Mesa 18.0.5
OpenGL shading language version string: 1.30

The program is

#include “vtkActor.h”
#include “vtkRenderer.h”
#include “vtkPolyData.h”
#include “vtkPolyDataMapper.h”
#include “vtkProperty.h”
#include <vtkRenderingOpenGL2Module.h>
#include <vtkInteractionStyleModule.h>
#include <vtkGenericDataObjectReader.h>
#include
#include <QVTKOpenGLWidget.h>
#include <vtkGenericOpenGLRenderWindow.h>
#include <vtkAutoInit.h>

VTK_MODULE_INIT (vtkRenderingOpenGL2);
VTK_MODULE_INIT (vtkInteractionStyle);

int main(int argc, char** argv)
{
QApplication app( argc, argv );
QVTKOpenGLWidget widget;
widget.resize(640,384);

vtkGenericDataObjectReader *objectReader = vtkGenericDataObjectReader::New();
objectReader->SetFileName("kube.vtk");
objectReader->Update();

vtkPolyData*  g_poly_data  = vtkPolyData::New ();
g_poly_data = objectReader->GetPolyDataOutput();

vtkGenericOpenGLRenderWindow *renderWindow =    vtkGenericOpenGLRenderWindow::New();

vtkRenderer *renderer = vtkRenderer::New();

vtkPolyDataMapper* g_mapper = vtkPolyDataMapper::New();
g_mapper ->SetInputData (g_poly_data);

vtkActor *actor = vtkActor::New();
actor ->SetMapper(g_mapper);
actor->GetProperty()->SetColor (1,0,0);
actor->GetProperty()->SetRepresentationToSurface();

renderer->AddActor(actor);
renderer->SetBackground(0.2, 0.4, 0.8);

renderWindow->AddRenderer(renderer);

widget.SetRenderWindow(renderWindow);
widget.show();
app.exec();

renderWindow->Delete();
renderer->Delete();
actor->Delete();
g_mapper->Delete();

return 0;
}

Any suggestion is appreciated.

Did you ever find a solution or a workaround?

When I got this error running someone else’s program I found that it worked if I set this:

MESA_GL_VERSION_OVERRIDE=3.2

2 Likes

Thanks for your commit. I succeed with this line.