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

Method ReplaceShaderBase

Rendering/VolumeOpenGL2/vtkOpenGLGPUVolumeRayCastMapper.cxx:2366–2401  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2364
2365//------------------------------------------------------------------------------
2366void vtkOpenGLGPUVolumeRayCastMapper::ReplaceShaderBase(
2367 std::map<vtkShader::Type, vtkShader*>& shaders, vtkRenderer* ren, vtkVolume* vol, int numComps)
2368{
2369 vtkShader* vertexShader = shaders[vtkShader::Vertex];
2370 vtkShader* fragmentShader = shaders[vtkShader::Fragment];
2371
2372 // Every volume should have a property (cannot be nullptr);
2373 vtkVolumeProperty* volumeProperty = vol->GetProperty();
2374 int independentComponents = volumeProperty->GetIndependentComponents();
2375
2376 vtkShaderProgram::Substitute(vertexShader, "//VTK::ComputeClipPos::Impl",
2377 vtkvolume::ComputeClipPositionImplementation(ren, this, vol));
2378
2379 vtkShaderProgram::Substitute(vertexShader, "//VTK::ComputeTextureCoords::Impl",
2380 vtkvolume::ComputeTextureCoordinates(ren, this, vol));
2381
2382 vtkShaderProgram::Substitute(vertexShader, "//VTK::Base::Dec",
2383 vtkvolume::BaseDeclarationVertex(ren, this, vol, this->Impl->MultiVolume != nullptr));
2384
2385 vtkShaderProgram::Substitute(
2386 fragmentShader, "//VTK::CallWorker::Impl", vtkvolume::WorkerImplementation(ren, this, vol));
2387
2388 vtkShaderProgram::Substitute(fragmentShader, "//VTK::Base::Dec",
2389 vtkvolume::BaseDeclarationFragment(ren, this, this->AssembledInputs,
2390 this->Impl->TotalNumberOfLights, this->Impl->NumberPositionalLights,
2391 this->Impl->DefaultLighting, numComps, independentComponents));
2392
2393 vtkShaderProgram::Substitute(fragmentShader, "//VTK::Base::Init",
2394 vtkvolume::BaseInit(ren, this, this->AssembledInputs, this->Impl->DefaultLighting));
2395
2396 vtkShaderProgram::Substitute(
2397 fragmentShader, "//VTK::Base::Impl", vtkvolume::BaseImplementation(ren, this, vol));
2398
2399 vtkShaderProgram::Substitute(
2400 fragmentShader, "//VTK::Base::Exit", vtkvolume::BaseExit(ren, this, vol));
2401}
2402
2403//------------------------------------------------------------------------------
2404void vtkOpenGLGPUVolumeRayCastMapper::ReplaceShaderTermination(

Callers 1

ReplaceShaderValuesMethod · 0.95

Calls 8

BaseDeclarationVertexFunction · 0.85
WorkerImplementationFunction · 0.85
BaseDeclarationFragmentFunction · 0.85
BaseInitFunction · 0.85
BaseImplementationFunction · 0.85
BaseExitFunction · 0.85
GetPropertyMethod · 0.45

Tested by

no test coverage detected