------------------------------------------------------------------------------
| 3952 | |
| 3953 | //------------------------------------------------------------------------------ |
| 3954 | void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::RenderSingleInput( |
| 3955 | vtkRenderer* ren, vtkOpenGLCamera* cam, vtkShaderProgram* prog) |
| 3956 | { |
| 3957 | auto& input = this->Parent->AssembledInputs[0]; |
| 3958 | auto vol = input.Volume; |
| 3959 | auto volumeTex = input.Texture.GetPointer(); |
| 3960 | |
| 3961 | // Sort blocks in case the viewpoint changed, it immediately returns if there |
| 3962 | // is a single block. |
| 3963 | vol->GetModelToWorldMatrix(this->TempMatrix4x4); |
| 3964 | volumeTex->SortBlocksBackToFront(ren, this->TempMatrix4x4); |
| 3965 | vtkVolumeTexture::VolumeBlock* block = volumeTex->GetCurrentBlock(); |
| 3966 | |
| 3967 | if (this->CurrentMask) |
| 3968 | { |
| 3969 | this->CurrentMask->SortBlocksBackToFront(ren, this->TempMatrix4x4); |
| 3970 | } |
| 3971 | |
| 3972 | const int independent = vol->GetProperty()->GetIndependentComponents(); |
| 3973 | const int numComp = volumeTex->GetLoadedScalars()->GetNumberOfComponents(); |
| 3974 | while (block != nullptr) |
| 3975 | { |
| 3976 | const int numSamplers = (independent ? numComp : 1); |
| 3977 | this->SetMapperShaderParameters(prog, ren, independent, numComp); |
| 3978 | |
| 3979 | vtkMatrix4x4 *wcvc, *vcdc, *wcdc; |
| 3980 | vtkMatrix3x3* norm; |
| 3981 | cam->GetKeyMatrices(ren, wcvc, norm, vcdc, wcdc); |
| 3982 | this->SetVolumeShaderParameters(prog, independent, numComp, wcvc); |
| 3983 | |
| 3984 | this->SetMaskShaderParameters(prog, vol->GetProperty(), numComp); |
| 3985 | this->SetLightingShaderParameters(ren, prog, vol, numSamplers); |
| 3986 | this->SetCameraShaderParameters(prog, ren, cam); |
| 3987 | this->SetAdvancedShaderParameters(ren, prog, vol, block, numComp); |
| 3988 | |
| 3989 | this->RenderVolumeGeometry(ren, prog, vol, block->VolumeGeometry); |
| 3990 | |
| 3991 | this->FinishRendering(numComp); |
| 3992 | block = volumeTex->GetNextBlock(); |
| 3993 | if (this->CurrentMask) |
| 3994 | { |
| 3995 | this->CurrentMask->GetNextBlock(); |
| 3996 | } |
| 3997 | } |
| 3998 | } |
| 3999 | |
| 4000 | //------------------------------------------------------------------------------ |
| 4001 | void vtkOpenGLGPUVolumeRayCastMapper::SetPartitions( |
no test coverage detected