------------------------------------------------------------------------------
| 2364 | |
| 2365 | //------------------------------------------------------------------------------ |
| 2366 | void 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 | //------------------------------------------------------------------------------ |
| 2404 | void vtkOpenGLGPUVolumeRayCastMapper::ReplaceShaderTermination( |
no test coverage detected