[vtk-developers] OpenGL2: Picking problems on Linux

Ken Martin ken.martin at kitware.com
Tue Feb 3 09:21:43 EST 2015


I believe I tried that a month or two ago and Mesa will fail saying that
you cannot use shader version 150 with a 2.1 context.  If we create a 3.2
context then you can use a shader version that includes what we need.



Thanks

Ken



Ken Martin PhD

Chairman & CFO

Kitware Inc.

28 Corporate Drive

Clifton Park NY 12065

ken.martin at kitware.com

518 881-4901 (w)

518 371-4573 (f)



This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee.  Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited and may be unlawful. If you
received this communication in error please notify us immediately and
destroy the original message.  Thank you.



*From:* Aashish Chaudhary [mailto:aashish.chaudhary at kitware.com]
*Sent:* Tuesday, February 3, 2015 12:02 AM
*To:* Ken Martin
*Cc:* Bill Lorensen; VTK Developers
*Subject:* Re: [vtk-developers] OpenGL2: Picking problems on Linux



Ken,



Just curious:



Did we try setting the version number explicitly (I don't see it in the
output shader string)? If a version is not set then by default GLSL assumes
it is version 110 which is not what we want. More info here:
https://www.opengl.org/wiki/Core_Language_%28GLSL%29



Also, based on the message here:

0:100(28): error: operator '%' is reserved in GLSL 1.10 (GLSL 1.30 or
GLSL ES 3.00 required)



It seems like it is falling back to 110 even though system supports upto
130.



Thanks,

Aashish





On Mon, Feb 2, 2015 at 6:44 PM, Ken Martin <ken.martin at kitware.com> wrote:

Yup, known issue with Mesa. Right now picking with Mesa does not work. The
mesa dashboard shows the same issue. We are slowly working on a fix which
is basically making Mesa systems use a 3.2 context where they support the
calls we need, but we have a couple more classes to convert to work with
OpenGL 3.2 before that will work.

Thanks
Ken

Ken Martin PhD
Chairman & CFO
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065
ken.martin at kitware.com
518 881-4901 (w)
518 371-4573 (f)

This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee.  Access to this email by anyone else is unauthorized. If you
are not the intended recipient, any disclosure, copying, distribution or
any action taken in reliance on it is prohibited and may be unlawful. If
you received this communication in error please notify us immediately and
destroy the original message.  Thank you.


-----Original Message-----
From: vtk-developers [mailto:vtk-developers-bounces at vtk.org] On Behalf Of
Bill Lorensen
Sent: Monday, February 2, 2015 4:11 PM
To: VTK Developers
Subject: [vtk-developers] OpenGL2: Picking problems on Linux

Folks,

I built VTK with the OpenGL2 backend. This example:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/BalloonWidget
crashes when I hover over an actor. It is failing during the pick
operation.

My system is Fedoro 20. OPenGL version:
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.4, 128 bits)
OpenGL version string: 2.1 Mesa 10.3.3 OpenGL shading language version
string: 1.30

This is the reported error before the segfault:
ERROR: In
/home/lorensen/ProjectsGIT/VTKGerrit/Rendering/OpenGL2/vtkShaderProgram.cx
x,
line 291
vtkShaderProgram (0x1340be0): 1:
/*========================================================================
=
2:
3:   Program:   Visualization Toolkit
4:   Module:    vtkglPolyDataFSHeadight.glsl
5:
6:   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7:   All rights reserved.
8:   See Copyright.txt or http://www.kitware.com/Copyright.htm for
details.
9:
10:      This software is distributed WITHOUT ANY WARRANTY; without even
11:      the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR
12:      PURPOSE.  See the above copyright notice for more information.
13:
14:
=========================================================================*
/
15: // the lighting model for this shader is a Headlight
16:
17: // The following line handle system declarations such a
18: // default precisions, or defining precisions to null
19: #extension GL_EXT_gpu_shader4 : enable
20: #define highp
21: #define mediump
22: #define lowp
23:
24:
25: // all variables that represent positions or directions have a suffix
26: // indicating the coordinate system they are in. The possible values
are
27: // MC - Model Coordinates
28: // WC - WC world coordinates
29: // VC - View Coordinates
30: // DC - Display Coordinates
31:
32: // VC positon of this fragment
33: varying vec4 vertexVC;
34:
35: // optional color passed in from the vertex shader, vertexColor
36: uniform float opacityUniform; // the fragment opacity
37: uniform vec3 ambientColorUniform; // intensity weighted color
38: uniform vec3 diffuseColorUniform; // intensity weighted color
39: uniform vec3 specularColorUniform; // intensity weighted color
40: uniform float specularPowerUniform;
41:
42:
43: // optional normal declaration
44: varying vec3 normalVCVarying;
45:
46: // Texture coordinates
47: //VTK::TCoord::Dec
48:
49: // picking support
50: uniform vec3 mapperIndex;
51: uniform int pickingAttributeIDOffset;
52:
53: // Depth Peeling Support
54: //VTK::DepthPeeling::Dec
55:
56: // clipping plane vars
57: //VTK::Clip::Dec
58:
59: void main()
60: {
61:   //VTK::Clip::Impl
62:
63:   vec3 ambientColor;
64:   vec3 diffuseColor;
65:   float opacity;
66:   vec3 specularColor;
67:   float specularPower;
68:   ambientColor = ambientColorUniform;
69:   diffuseColor = diffuseColorUniform;
70:   opacity = opacityUniform;
71:   specularColor = specularColorUniform;
72:   specularPower = specularPowerUniform;
73:
74:
75:   // Generate the normal if we are not passed in one
76:   vec3 normalVC = normalize(normalVCVarying);
77:   if (gl_FrontFacing == false) { normalVC = -normalVC; }
78:
79:
80:   // diffuse and specular lighting
81:   float df = max(0.0, normalVC.z);
82:   float sf = pow(df, specularPower);
83:
84:   vec3 diffuse = df * diffuseColor;
85:   vec3 specular = sf * specularColor;
86:
87:   gl_FragColor = vec4(ambientColor + diffuse + specular, opacity);
88:   //VTK::TCoord::Impl
89:
90:   if (gl_FragColor.a <= 0.0)
91:     {
92:     discard;
93:     }
94:
95:   //VTK::DepthPeeling::Impl
96:
97:   if (mapperIndex == vec3(0.0,0.0,0.0))
98:     {
99:     int idx = gl_PrimitiveID + 1 + pickingAttributeIDOffset;
100:     gl_FragColor = vec4(float(idx%256)/255.0,
float((idx/256)%256)/255.0, float(idx/65536)/255.0, 1.0);
101:     }
102:   else
103:     {
104:     gl_FragColor = vec4(mapperIndex,1.0);
105:     }
106:
107: }
108:
109:
110:
111:


ERROR: In
/home/lorensen/ProjectsGIT/VTKGerrit/Rendering/OpenGL2/vtkShaderProgram.cx
x,
line 292
vtkShaderProgram (0x1340be0): 0:19(12): warning: extension
`GL_EXT_gpu_shader4' unsupported in fragment shader
0:99(12): error: `gl_PrimitiveID' undeclared
0:99(12): error: operands to arithmetic operators must be numeric
0:99(12): error: operands to arithmetic operators must be numeric
0:100(28): error: operator '%' is reserved in GLSL 1.10 (GLSL 1.30 or GLSL
ES 3.00 required)
0:100(22): error: cannot construct `float' from a non-numeric data type
0:100(22): error: operands to arithmetic operators must be numeric
0:100(17): error: cannot construct `vec4' from a non-numeric data type
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtk-developers
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtk-developers





-- 



*| Aashish Chaudhary | Technical Leader         | Kitware Inc.            *

*| http://www.kitware.com/company/team/chaudhary.html
<http://www.kitware.com/company/team/chaudhary.html>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150203/d933b583/attachment-0001.html>


More information about the vtk-developers mailing list