<div dir="ltr">Ken will have more say but here is one of the reasons for the failure: <div><br></div><div><span style="font-size:16px">GL_EXT_gpu_shader4 is required for gl_PrimitiveID to exist in the shader. It may be possible that what GLEW is reporting is not quite matching with what actually is supported. </span><br></div><div><br></div><div><span style="font-size:16px"> - Aashish</span><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 2, 2015 at 4:11 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Folks,<br>
<br>
I built VTK with the OpenGL2 backend. This example:<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/BalloonWidget" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/BalloonWidget</a><br>
crashes when I hover over an actor. It is failing during the pick operation.<br>
<br>
My system is Fedoro 20. OPenGL version:<br>
OpenGL vendor string: VMware, Inc.<br>
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.4, 128 bits)<br>
OpenGL version string: 2.1 Mesa 10.3.3<br>
OpenGL shading language version string: 1.30<br>
<br>
This is the reported error before the segfault:<br>
ERROR: In /home/lorensen/ProjectsGIT/VTKGerrit/Rendering/OpenGL2/vtkShaderProgram.cxx,<br>
line 291<br>
vtkShaderProgram (0x1340be0): 1:<br>
/*=========================================================================<br>
2:<br>
3:   Program:   Visualization Toolkit<br>
4:   Module:    vtkglPolyDataFSHeadight.glsl<br>
5:<br>
6:   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen<br>
7:   All rights reserved.<br>
8:   See Copyright.txt or <a href="http://www.kitware.com/Copyright.htm" target="_blank">http://www.kitware.com/Copyright.htm</a> for details.<br>
9:<br>
10:      This software is distributed WITHOUT ANY WARRANTY; without even<br>
11:      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR<br>
12:      PURPOSE.  See the above copyright notice for more information.<br>
13:<br>
14: =========================================================================*/<br>
15: // the lighting model for this shader is a Headlight<br>
16:<br>
17: // The following line handle system declarations such a<br>
18: // default precisions, or defining precisions to null<br>
19: #extension GL_EXT_gpu_shader4 : enable<br>
20: #define highp<br>
21: #define mediump<br>
22: #define lowp<br>
23:<br>
24:<br>
25: // all variables that represent positions or directions have a suffix<br>
26: // indicating the coordinate system they are in. The possible values are<br>
27: // MC - Model Coordinates<br>
28: // WC - WC world coordinates<br>
29: // VC - View Coordinates<br>
30: // DC - Display Coordinates<br>
31:<br>
32: // VC positon of this fragment<br>
33: varying vec4 vertexVC;<br>
34:<br>
35: // optional color passed in from the vertex shader, vertexColor<br>
36: uniform float opacityUniform; // the fragment opacity<br>
37: uniform vec3 ambientColorUniform; // intensity weighted color<br>
38: uniform vec3 diffuseColorUniform; // intensity weighted color<br>
39: uniform vec3 specularColorUniform; // intensity weighted color<br>
40: uniform float specularPowerUniform;<br>
41:<br>
42:<br>
43: // optional normal declaration<br>
44: varying vec3 normalVCVarying;<br>
45:<br>
46: // Texture coordinates<br>
47: //VTK::TCoord::Dec<br>
48:<br>
49: // picking support<br>
50: uniform vec3 mapperIndex;<br>
51: uniform int pickingAttributeIDOffset;<br>
52:<br>
53: // Depth Peeling Support<br>
54: //VTK::DepthPeeling::Dec<br>
55:<br>
56: // clipping plane vars<br>
57: //VTK::Clip::Dec<br>
58:<br>
59: void main()<br>
60: {<br>
61:   //VTK::Clip::Impl<br>
62:<br>
63:   vec3 ambientColor;<br>
64:   vec3 diffuseColor;<br>
65:   float opacity;<br>
66:   vec3 specularColor;<br>
67:   float specularPower;<br>
68:   ambientColor = ambientColorUniform;<br>
69:   diffuseColor = diffuseColorUniform;<br>
70:   opacity = opacityUniform;<br>
71:   specularColor = specularColorUniform;<br>
72:   specularPower = specularPowerUniform;<br>
73:<br>
74:<br>
75:   // Generate the normal if we are not passed in one<br>
76:   vec3 normalVC = normalize(normalVCVarying);<br>
77:   if (gl_FrontFacing == false) { normalVC = -normalVC; }<br>
78:<br>
79:<br>
80:   // diffuse and specular lighting<br>
81:   float df = max(0.0, normalVC.z);<br>
82:   float sf = pow(df, specularPower);<br>
83:<br>
84:   vec3 diffuse = df * diffuseColor;<br>
85:   vec3 specular = sf * specularColor;<br>
86:<br>
87:   gl_FragColor = vec4(ambientColor + diffuse + specular, opacity);<br>
88:   //VTK::TCoord::Impl<br>
89:<br>
90:   if (gl_FragColor.a <= 0.0)<br>
91:     {<br>
92:     discard;<br>
93:     }<br>
94:<br>
95:   //VTK::DepthPeeling::Impl<br>
96:<br>
97:   if (mapperIndex == vec3(0.0,0.0,0.0))<br>
98:     {<br>
99:     int idx = gl_PrimitiveID + 1 + pickingAttributeIDOffset;<br>
100:     gl_FragColor = vec4(float(idx%256)/255.0,<br>
float((idx/256)%256)/255.0, float(idx/65536)/255.0, 1.0);<br>
101:     }<br>
102:   else<br>
103:     {<br>
104:     gl_FragColor = vec4(mapperIndex,1.0);<br>
105:     }<br>
106:<br>
107: }<br>
108:<br>
109:<br>
110:<br>
111:<br>
<br>
<br>
ERROR: In /home/lorensen/ProjectsGIT/VTKGerrit/Rendering/OpenGL2/vtkShaderProgram.cxx,<br>
line 292<br>
vtkShaderProgram (0x1340be0): 0:19(12): warning: extension<br>
`GL_EXT_gpu_shader4' unsupported in fragment shader<br>
0:99(12): error: `gl_PrimitiveID' undeclared<br>
0:99(12): error: operands to arithmetic operators must be numeric<br>
0:99(12): error: operands to arithmetic operators must be numeric<br>
0:100(28): error: operator '%' is reserved in GLSL 1.10 (GLSL 1.30 or<br>
GLSL ES 3.00 required)<br>
0:100(22): error: cannot construct `float' from a non-numeric data type<br>
0:100(22): error: operands to arithmetic operators must be numeric<br>
0:100(17): error: cannot construct `vec4' from a non-numeric data type<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" target="_blank">http://markmail.org/search/?q=vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" target="_blank">http://public.kitware.com/mailman/listinfo/vtk-developers</a><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><font face="trebuchet ms, sans-serif"><i>| Aashish Chaudhary <br>| Technical Leader         <br>| Kitware Inc.            <br></i></font><div><i><font face="trebuchet ms, sans-serif">| </font><a href="http://www.kitware.com/company/team/chaudhary.html" target="_blank">http://www.kitware.com/company/team/chaudhary.html</a></i></div></div></div>
</div>