MCPcopy Create free account
hub / github.com/Kitware/VTK / Build

Method Build

Rendering/VR/vtkVRModel.cxx:61–100  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

59
60//------------------------------------------------------------------------------
61bool vtkVRModel::Build(vtkOpenGLRenderWindow* win)
62{
63 this->FillModelHelper();
64
65 this->ModelHelper.Program = win->GetShaderCache()->ReadyShaderProgram(
66
67 // vertex shader -- use normals?? yes?
68 "//VTK::System::Dec\n"
69 "uniform mat4 matrix;\n"
70 "in vec4 position;\n"
71 // "attribute vec3 v3NormalIn;\n"
72 "in vec2 v2TexCoordsIn;\n"
73 "out vec2 v2TexCoord;\n"
74 "void main()\n"
75 "{\n"
76 " v2TexCoord = v2TexCoordsIn;\n"
77 " gl_Position = matrix * vec4(position.xyz, 1);\n"
78 "}\n",
79
80 // fragment shader
81 "//VTK::System::Dec\n"
82 "//VTK::Output::Dec\n"
83 "uniform sampler2D diffuse;\n"
84 "in vec2 v2TexCoord;\n"
85 "out vec4 outputColor;\n"
86 "void main()\n"
87 "{\n"
88 " gl_FragData[0] = texture(diffuse, v2TexCoord);\n"
89 "}\n",
90
91 // geom shader
92 "");
93
94 this->SetPositionAndTCoords();
95
96 // create and populate the texture
97 this->CreateTextureObject(win);
98
99 return true;
100}
101
102//------------------------------------------------------------------------------
103void vtkVRModel::Render(vtkOpenGLRenderWindow* win, vtkMatrix4x4* modelToPhysicalMatrix)

Callers 15

TestPIOReader.pyFile · 0.45
WritePolyDataMethod · 0.45
TestOggTheoraWriterFunction · 0.45
TestFFMPEGWriterFunction · 0.45
TestPLYWriterAlphaFunction · 0.45
TestMHD.pyFile · 0.45
TestSEPReaderFunction · 0.45
TestGDALVectorReaderFunction · 0.45
WriteColorsMethod · 0.45

Calls 5

GetShaderCacheMethod · 0.80
FillModelHelperMethod · 0.45
ReadyShaderProgramMethod · 0.45
SetPositionAndTCoordsMethod · 0.45
CreateTextureObjectMethod · 0.45

Tested by 15

TestOggTheoraWriterFunction · 0.36
TestFFMPEGWriterFunction · 0.36
TestPLYWriterAlphaFunction · 0.36
TestSEPReaderFunction · 0.36
TestGDALVectorReaderFunction · 0.36
TestMP4WriterFunction · 0.36
TestAVIWriterFunction · 0.36