Hi, I have run a vtk program to render a image like this, and I do have the desired result, that is, when running my vtk program it dose show the window on where my expected image present.
But before the result arise, there is another window entitled by “vtkOutputWindow” shows , and it says:
ERROR: In vtkShaderProgram.cxx, line 1144
vtkShaderProgram (00000204C6B55D50): 1: #version 150
2: #ifndef GL_ES
3: #define highp
4: #define mediump
5: #define lowp
6: #define texelFetchBuffer texelFetch
7: #endif // GL_ES
8: #define attribute in
9: #define varying out
10:
11:
12: // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13: // SPDX-License-Identifier: BSD-3-Clause
14:
15: in vec4 vertexMC;
16:
17:
18:
19: // frag position in VC
20: out vec4 vertexVCVSOutput;
21:
22: // optional normal declaration
23: //VTK::Normal::Dec
24:
25: // extra lighting parameters
26: //VTK::Light::Dec
27:
28: // Texture coordinates
29: //VTK::TCoord::Dec
30:
31: // material property values
32: //VTK::Color::Dec
33:
34: // clipping plane vars
35: //VTK::Clip::Dec
36:
37: // camera and actor matrix values
38: uniform mat4 MCDCMatrix;
39: uniform mat4 MCVCMatrix;
40:
41: // Apple Bug
42: //VTK::PrimID::Dec
43:
44: // Value raster
45: //VTK::ValuePass::Dec
46:
47: // picking support
48: //VTK::Picking::Dec
49:
50: // Surface with edges on GLES 3.0
51: //VTK::EdgesGLES30::Dec
52:
53: // PointSize on GLES 3.0
54: //VTK::PointSizeGLES30::Dec
55:
56: // LineWidth on GLES 3.0
57: //VTK::LineWidthGLES30::Dec
58:
59: void main()
60: {
61: //VTK::CustomBegin::Impl
62:
63: //VTK::PointSizeGLES30::Impl
64:
65: //VTK::Color::Impl
66:
67: //VTK::Normal::Impl
68:
69: //VTK::TCoord::Impl
70:
71: //VTK::Clip::Impl
72:
73: //VTK::PrimID::Impl
74:
75: vertexVCVSOutput = MCVCMatrix * vertexMC;
76: gl_Position = MCDCMatrix * vertexMC;
77:
78:
79: //VTK::LineWidthGLES30::Impl
80:
81: //VTK::ValuePass::Impl
82:
83: //VTK::Light::Impl
84:
85: //VTK::Picking::Impl
86:
87: //VTK::CustomEnd::Impl
88:
89: //VTK::EdgesGLES30::Impl
90: }
ERROR: In vtkShaderProgram.cxx, line 1145
vtkShaderProgram (00000204C6B55D50): Could not create shader object.
ERROR: In vtkOpenGLPolyDataMapper.cxx, line 2645
vtkOpenGLPolyDataMapper (00000204BBECD4E0): Could not set shader program
ERROR: In vtkShaderProgram.cxx, line 1144
vtkShaderProgram (00000204C6B55FD0): 1: #version 150
2: #ifndef GL_ES
3: #define highp
4: #define mediump
5: #define lowp
6: #define texelFetchBuffer texelFetch
7: #endif // GL_ES
8: #define attribute in
9: #define varying out
10:
11:
12: // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13: // SPDX-License-Identifier: BSD-3-Clause
14:
15: in vec4 vertexMC;
16:
17:
18:
19: // frag position in VC
20: out vec4 vertexVCVSOutput;
21:
22: // optional normal declaration
23: //VTK::Normal::Dec
24: in vec3 normalMC;
25: uniform mat3 normalMatrix;
26: out vec3 normalVCVSOutput;
27:
28: // extra lighting parameters
29: //VTK::Light::Dec
30:
31: // Texture coordinates
32: //VTK::TCoord::Dec
33:
34: // material property values
35: //VTK::Color::Dec
36:
37: // clipping plane vars
38: //VTK::Clip::Dec
39:
40: // camera and actor matrix values
41: uniform mat4 MCDCMatrix;
42: uniform mat4 MCVCMatrix;
43:
44: // Apple Bug
45: //VTK::PrimID::Dec
46:
47: // Value raster
48: //VTK::ValuePass::Dec
49:
50: // picking support
51: //VTK::Picking::Dec
52:
53: // Surface with edges on GLES 3.0
54: //VTK::EdgesGLES30::Dec
55:
56: // PointSize on GLES 3.0
57: //VTK::PointSizeGLES30::Dec
58:
59: // LineWidth on GLES 3.0
60: //VTK::LineWidthGLES30::Dec
61:
62: void main()
63: {
64: //VTK::CustomBegin::Impl
65:
66: //VTK::PointSizeGLES30::Impl
67:
68: //VTK::Color::Impl
69:
70: normalVCVSOutput = normalMatrix * normalMC;
71: //VTK::Normal::Impl
72:
73: //VTK::TCoord::Impl
74:
75: //VTK::Clip::Impl
76:
77: //VTK::PrimID::Impl
78:
79: vertexVCVSOutput = MCVCMatrix * vertexMC;
80: gl_Position = MCDCMatrix * vertexMC;
81:
82:
83: //VTK::LineWidthGLES30::Impl
84:
85: //VTK::ValuePass::Impl
86:
87: //VTK::Light::Impl
88:
89: //VTK::Picking::Impl
90:
91: //VTK::CustomEnd::Impl
92:
93: //VTK::EdgesGLES30::Impl
94: }
ERROR: In vtkShaderProgram.cxx, line 1145
vtkShaderProgram (00000204C6B55FD0): Could not create shader object.
ERROR: In vtkOpenGLPolyDataMapper.cxx, line 2645
vtkOpenGLPolyDataMapper (00000204BBEA7CC0): Could not set shader program
for the above text, I don’t konw what happend.
this is my code:
sphere.cxx (1.7 KB)
More details:
the vtk lib is static.
the configuration is to obtain “x64” exe file.