| 265 | } |
| 266 | |
| 267 | void vtkVolumeInputHelper::ActivateTransferFunction(vtkShaderProgram* prog, int blendMode) |
| 268 | { |
| 269 | int const transferMode = this->Volume->GetProperty()->GetTransferFunctionMode(); |
| 270 | int const numActiveLuts = |
| 271 | this->ComponentMode == INDEPENDENT ? Texture->GetLoadedScalars()->GetNumberOfComponents() : 1; |
| 272 | switch (transferMode) |
| 273 | { |
| 274 | case vtkVolumeProperty::TF_1D: |
| 275 | for (int i = 0; i < numActiveLuts; ++i) |
| 276 | { |
| 277 | this->OpacityTables->GetTable(i)->Activate(); |
| 278 | prog->SetUniformi( |
| 279 | this->OpacityTablesMap[i].c_str(), this->OpacityTables->GetTable(i)->GetTextureUnit()); |
| 280 | |
| 281 | if (blendMode != vtkGPUVolumeRayCastMapper::ADDITIVE_BLEND) |
| 282 | { |
| 283 | this->RGBTables->GetTable(i)->Activate(); |
| 284 | prog->SetUniformi( |
| 285 | this->RGBTablesMap[i].c_str(), this->RGBTables->GetTable(i)->GetTextureUnit()); |
| 286 | } |
| 287 | |
| 288 | if (this->GradientOpacityTables) |
| 289 | { |
| 290 | this->GradientOpacityTables->GetTable(i)->Activate(); |
| 291 | prog->SetUniformi(this->GradientOpacityTablesMap[i].c_str(), |
| 292 | this->GradientOpacityTables->GetTable(i)->GetTextureUnit()); |
| 293 | } |
| 294 | } |
| 295 | break; |
| 296 | case vtkVolumeProperty::TF_2D: |
| 297 | for (int i = 0; i < numActiveLuts; ++i) |
| 298 | { |
| 299 | vtkOpenGLVolumeTransferFunction2D* table = this->TransferFunctions2D->GetTable(i); |
| 300 | table->Activate(); |
| 301 | prog->SetUniformi(this->TransferFunctions2DMap[i].c_str(), table->GetTextureUnit()); |
| 302 | } |
| 303 | break; |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | void vtkVolumeInputHelper::DeactivateTransferFunction(int blendMode) |
| 308 | { |
no test coverage detected