diff --git a/Rendering/Core/vtkVolumeProperty.cxx b/Rendering/Core/vtkVolumeProperty.cxx index 153db733045a101ca6a0d41956cffb34558c4da4..9665cd969904b470742f68e0fd77acb9f5c5860c 100644 --- a/Rendering/Core/vtkVolumeProperty.cxx +++ b/Rendering/Core/vtkVolumeProperty.cxx @@ -44,7 +44,7 @@ vtkVolumeProperty::vtkVolumeProperty() this->TransferFunction2D[i] = NULL; this->DefaultGradientOpacity[i] = NULL; this->DisableGradientOpacity[i] = 0; - this->TransferFunctionMode = TF_1D; + this->TransferFunctionMode = vtkVolumeProperty::TF_1D; this->ComponentWeight[i] = 1.0; @@ -262,7 +262,7 @@ void vtkVolumeProperty::SetColor( int index, vtkPiecewiseFunction *function ) this->GrayTransferFunctionMTime[index].Modified(); this->Modified(); - this->TransferFunctionMode = TF_1D; + this->TransferFunctionMode = vtkVolumeProperty::TF_1D; } if (this->ColorChannels[index] != 1) @@ -308,7 +308,7 @@ void vtkVolumeProperty::SetColor( int index, vtkColorTransferFunction *function } this->RGBTransferFunctionMTime[index].Modified(); this->Modified(); - this->TransferFunctionMode = TF_1D; + this->TransferFunctionMode = vtkVolumeProperty::TF_1D; } if (this->ColorChannels[index] != 3) @@ -355,7 +355,7 @@ void vtkVolumeProperty::SetScalarOpacity( int index, vtkPiecewiseFunction *funct this->ScalarOpacityMTime[index].Modified(); this->Modified(); - this->TransferFunctionMode = TF_1D; + this->TransferFunctionMode = vtkVolumeProperty::TF_1D; } } @@ -418,7 +418,7 @@ void vtkVolumeProperty::SetGradientOpacity( int index, vtkPiecewiseFunction *fun this->GradientOpacityMTime[index].Modified(); this->Modified(); - this->TransferFunctionMode = TF_1D; + this->TransferFunctionMode = vtkVolumeProperty::TF_1D; } } @@ -455,14 +455,15 @@ void vtkVolumeProperty::SetTransferFunction2D(int index, vtkImageData* function) if (this->TransferFunction2D[index] != function) { vtkDataArray* dataArr = function->GetPointData()->GetScalars(); + const int* dims = function->GetDimensions(); if (!dataArr || dataArr->GetNumberOfComponents() != 4 || - dataArr->GetDataType() != VTK_FLOAT) + dataArr->GetDataType() != VTK_FLOAT || dims[0] == 0) { const int type = dataArr->GetDataType(); const int comp = dataArr->GetNumberOfComponents(); vtkErrorMacro(<< "Invalid type (" << type << ") or number of components (" - << comp << ") for a 2D Transfer Function, VTK_FLOAT 4 Components" - " expected!"); + << comp << ") or dimensions (" << dims[0] << ", " << dims[1] << ")." + " Expected VTK_FLOAT, 4 Components, dimensions > 0!"); return; } @@ -479,7 +480,7 @@ void vtkVolumeProperty::SetTransferFunction2D(int index, vtkImageData* function) this->TransferFunction2DMTime[index].Modified(); this->Modified(); - this->TransferFunctionMode = TF_2D; + this->TransferFunctionMode = vtkVolumeProperty::TF_2D; } } @@ -664,6 +665,11 @@ vtkTimeStamp vtkVolumeProperty::GetRGBTransferFunctionMTime( int index ) return this->RGBTransferFunctionMTime[index]; } +vtkTimeStamp vtkVolumeProperty::GetTransferFunction2DMTime(int index) +{ + return this->TransferFunction2DMTime[index]; +} + vtkTimeStamp vtkVolumeProperty::GetGrayTransferFunctionMTime( int index ) { return this->GrayTransferFunctionMTime[index]; diff --git a/Rendering/Core/vtkVolumeProperty.h b/Rendering/Core/vtkVolumeProperty.h index 297e6b633b18ac3035f6ce1164f0b0738a0e7eda..f83f7fe05f01eb6edc4a0a8abb35833bde194509 100644 --- a/Rendering/Core/vtkVolumeProperty.h +++ b/Rendering/Core/vtkVolumeProperty.h @@ -17,28 +17,30 @@ * @class vtkVolumeProperty * @brief represents the common properties for rendering a volume. * - * * vtkVolumeProperty is used to represent common properties associated * with volume rendering. This includes properties for determining the type * of interpolation to use when sampling a volume, the color of a volume, * the scalar opacity of a volume, the gradient opacity of a volume, and the * shading parameters of a volume. * - * Color, scalar opacity and gradient opacity transfer functions can be set - * as either 3 separate 1D functions (1 vtkColorTransferFunction and 1 - * vtkPiecewiseFunction respectively) or as a single 2D transfer function - * (4-component vtkImageData; scalar value vs. gradient magnitude). + * Color, scalar opacity and gradient magnitude opacity transfer functions + * can be set as either 3 separate 1D functions or as a single 2D transfer + * function. * - * - 1D Transfer functions + * - 1D Transfer functions (vtkVolumeProperty::TF_1D) + * Color, scalar opacity and gradient magnitude opacity are defined by 1 + * vtkColorTransferFunction and 2 vtkPiecewiseFunctions respectively. * When the scalar opacity or the gradient opacity of a volume is not set, * then the function is defined to be a constant value of 1.0. When a * scalar and gradient opacity are both set simultaneously, then the opacity * is defined to be the product of the scalar opacity and gradient opacity - * transfer functions. This is the default behavior. + * transfer functions. 1D transfer functions is the legacy and default behavior. * - * - 2D Transfer functions - * The 1D functions are used by default unless a 2D function is explicitely - * set. + * - 2D Transfer functions (vtkVolumeProperty::TF_2D) + * Color and scalar/gradient magnitude opacity are defined by a 4-component + * vtkImageData instance mapping scalar value vs. gradient magnitude on its + * x and y axis respectively. This mode is only available if a 2D TF has been + * explicitly set (see SetTransferFunction2D). * * Most properties can be set per "component" for volume mappers that * support multiple independent components. If you are using 2 component @@ -48,7 +50,7 @@ * index parameter on the Set/Get methods will access index = 0. * * @sa vtkPiecewiseFunction vtkColorTransferFunction -*/ + */ #ifndef vtkVolumeProperty_h #define vtkVolumeProperty_h @@ -231,7 +233,15 @@ public: return this->GetTransferFunction2D(0); }; - enum TransferMode { + /** + * Color-opacity transfer function mode. TF_1D is its default value. + * - TF_1D Mappers will use 3 separate 1D functions for color, scalar opacity + * and gradient mag. opacity. + * - TF_2D Mappers will use a single 2D function for color and scalar/gradient mag. + * opacity. + */ + enum TransferMode + { TF_1D = 0, TF_2D }; @@ -290,6 +300,7 @@ public: case TF_1D: return (this->GradientOpacity[index] != NULL); case TF_2D: return true; } + return false; } //@{ @@ -422,7 +433,7 @@ protected: /** * WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE - * Get the time that the GrayTransferFunction was set + * Get the time when the TransferFunction2D was set. */ vtkTimeStamp GetTransferFunction2DMTime(int index); vtkTimeStamp GetTransferFunction2DMTime() diff --git a/Rendering/VolumeOpenGL2/vtkOpenGLGPUVolumeRayCastMapper.cxx b/Rendering/VolumeOpenGL2/vtkOpenGLGPUVolumeRayCastMapper.cxx index 52238b79763e103407afbf2df1c26401edbb6093..d009ed280053b0d536abb63121cf933d44570b2e 100644 --- a/Rendering/VolumeOpenGL2/vtkOpenGLGPUVolumeRayCastMapper.cxx +++ b/Rendering/VolumeOpenGL2/vtkOpenGLGPUVolumeRayCastMapper.cxx @@ -277,13 +277,22 @@ public: void InitializeTransferFunction(vtkRenderer* ren, vtkVolume* vol, int noOfComponents, int independentComponents); - void SetupTransferFunction1D(vtkRenderer* ren, vtkVolume* vol, + void UpdateTransferFunction(vtkRenderer* ren, vtkVolume* vol, int noOfComponents, int independentComponents); + + void ActivateTransferFunction(vtkShaderProgram* prog, vtkVolumeProperty* volProp, + int numSamplers); + + void DeactivateTransferFunction(vtkVolumeProperty* volumeProperty, + int numSamplers); + + void SetupTransferFunction1D(vtkRenderer* ren, int noOfComponents, + int independentComponents); void ReleaseGraphicsTransfer1D(vtkWindow* window); void DeleteTransfer1D(); - void SetupTransferFunction2D(vtkRenderer* ren, vtkVolume* vol, - int noOfComponents, int independentComponents); + void SetupTransferFunction2D(vtkRenderer* ren, int noOfComponents, + int independentComponents); void ReleaseGraphicsTransfer2D(vtkWindow* window); void DeleteTransfer2D(); ///@} @@ -608,21 +617,25 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::ToFloat( //---------------------------------------------------------------------------- void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::SetupTransferFunction1D( - vtkRenderer* ren, vtkVolume* vol, int noOfComponents, - int independentComponents) + vtkRenderer* ren, int noOfComponents, int independentComponents) { this->ReleaseGraphicsTransfer1D(ren->GetRenderWindow()); this->DeleteTransfer1D(); - // Create RGB lookup table - if (noOfComponents > 1 && independentComponents) - { - this->RGBTables = new vtkOpenGLVolumeRGBTables(noOfComponents); - } - else - { - this->RGBTables = new vtkOpenGLVolumeRGBTables(1); - } + // Check component mode (independent or dependent) + noOfComponents = noOfComponents > 1 && independentComponents ? + noOfComponents : 1; + + // Create RGB and opacity (scalar and gradient) lookup tables. We support up + // to four components in independentComponents mode. + this->RGBTables = new vtkOpenGLVolumeRGBTables(noOfComponents); + this->OpacityTables = new vtkOpenGLVolumeOpacityTables(noOfComponents); + this->GradientOpacityTables = new vtkOpenGLVolumeGradientOpacityTables( + noOfComponents); + + this->OpacityTablesMap.clear(); + this->RGBTablesMap.clear(); + this->GradientOpacityTablesMap.clear(); if (this->Parent->MaskInput != 0 && this->Parent->MaskType == LabelMapMaskType) @@ -637,38 +650,7 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::SetupTransferFunction1D( } } - // We support up to four components - if (noOfComponents > 1 && independentComponents) - { - this->OpacityTables = new vtkOpenGLVolumeOpacityTables(noOfComponents); - } - else - { - this->OpacityTables = new vtkOpenGLVolumeOpacityTables(1); - } - - if (noOfComponents > 1 && independentComponents) - { - // Assuming that all four components has gradient opacity for now - this->GradientOpacityTables = - new vtkOpenGLVolumeGradientOpacityTables(noOfComponents); - } - else - { - if (vol->GetProperty()->HasGradientOpacity()) - { - this->GradientOpacityTables = - new vtkOpenGLVolumeGradientOpacityTables(1); - } - } - - this->OpacityTablesMap.clear(); - this->RGBTablesMap.clear(); - this->GradientOpacityTablesMap.clear(); - std::ostringstream numeric; - /// TODO fix this: noOfComponents should be either noOfComponents or 1 - /// depnding on the above for (int i = 0; i < noOfComponents; ++i) { numeric << i; @@ -696,8 +678,7 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::SetupTransferFunction1D( //---------------------------------------------------------------------------- void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::SetupTransferFunction2D( - vtkRenderer* ren, vtkVolume* vol, int noOfComponents, - int independentComponents) + vtkRenderer* ren, int noOfComponents, int independentComponents) { this->ReleaseGraphicsTransfer2D(ren->GetRenderWindow()); this->DeleteTransfer2D(); @@ -708,7 +689,7 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::SetupTransferFunction2D( std::ostringstream indexStream; const std::string baseName = "in_transfer2D"; - for (int i = 0; i < num; i++) + for (unsigned int i = 0; i < num; i++) { if (i > 0) { @@ -731,14 +712,137 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::InitializeTransferFunction( switch(transferMode) { case vtkVolumeProperty::TF_2D: - this->SetupTransferFunction2D(ren, vol, noOfComponents, - independentComponents); + this->SetupTransferFunction2D(ren, noOfComponents, independentComponents); break; case vtkVolumeProperty::TF_1D: default: - this->SetupTransferFunction1D(ren, vol, noOfComponents, - independentComponents); + this->SetupTransferFunction1D(ren, noOfComponents, independentComponents); + } +} + +//---------------------------------------------------------------------------- +void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateTransferFunction( + vtkRenderer* ren, vtkVolume* vol, int noOfComponents, + int independentComponents) +{ + int const transferMode = vol->GetProperty()->GetTransferFunctionMode(); + switch(transferMode) + { + case vtkVolumeProperty::TF_1D: + if (independentComponents) + { + for (int i = 0; i < noOfComponents; ++i) + { + this->UpdateOpacityTransferFunction(ren, vol, i); + this->UpdateGradientOpacityTransferFunction(ren, vol, i); + this->UpdateColorTransferFunction(ren, vol, i); + } + } + else + { + if (noOfComponents == 2 || noOfComponents == 4) + { + this->UpdateOpacityTransferFunction(ren, vol, noOfComponents - 1); + this->UpdateGradientOpacityTransferFunction(ren, vol, + noOfComponents - 1); + this->UpdateColorTransferFunction(ren, vol, 0); + } + } + break; + + case vtkVolumeProperty::TF_2D: + if (independentComponents) + { + for (int i = 0; i < noOfComponents; ++i) + { + this->UpdateTransferFunction2D(ren, vol, i); + } + } + else + { + if (noOfComponents == 2 || noOfComponents == 4) + { + this->UpdateTransferFunction2D(ren, vol, 0); + } + } + break; + } +} + +//---------------------------------------------------------------------------- +void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::ActivateTransferFunction( + vtkShaderProgram* prog, vtkVolumeProperty* volumeProperty, + int numberOfSamplers) +{ + int const transferMode = volumeProperty->GetTransferFunctionMode(); + switch (transferMode) + { + case vtkVolumeProperty::TF_1D: + for (int i = 0; i < numberOfSamplers; ++i) + { + this->OpacityTables->GetTable(i)->Activate(); + prog->SetUniformi( + this->OpacityTablesMap[i].c_str(), + this->OpacityTables->GetTable(i)->GetTextureUnit()); + + if (this->Parent->BlendMode != vtkGPUVolumeRayCastMapper::ADDITIVE_BLEND) + { + this->RGBTables->GetTable(i)->Activate(); + prog->SetUniformi( + this->RGBTablesMap[i].c_str(), + this->RGBTables->GetTable(i)->GetTextureUnit()); + } + + if (this->GradientOpacityTables) + { + this->GradientOpacityTables->GetTable(i)->Activate(); + prog->SetUniformi( + this->GradientOpacityTablesMap[i].c_str(), + this->GradientOpacityTables->GetTable(i)->GetTextureUnit()); + } + } + break; + case vtkVolumeProperty::TF_2D: + for (int i = 0; i < numberOfSamplers; ++i) + { + vtkOpenGLTransferFunction2D* table = + this->TransferFunctions2D->GetTable(i); + table->Activate(); + prog->SetUniformi(this->TransferFunctions2DMap[i].c_str(), + table->GetTextureUnit()); + } + break; + } +} + +//----------------------------------------------------------------------------- +void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::DeactivateTransferFunction( + vtkVolumeProperty* volumeProperty, int numberOfSamplers) +{ + int const transferMode = volumeProperty->GetTransferFunctionMode(); + switch(transferMode) + { + case vtkVolumeProperty::TF_1D: + for (int i = 0; i < numberOfSamplers; ++i) + { + this->OpacityTables->GetTable(i)->Deactivate(); + if (this->Parent->BlendMode != vtkGPUVolumeRayCastMapper::ADDITIVE_BLEND) + { + this->RGBTables->GetTable(i)->Deactivate(); + } + if (this->GradientOpacityTables) + { + this->GradientOpacityTables->GetTable(i)->Deactivate(); + } + } + break; + case vtkVolumeProperty::TF_2D: + for (int i = 0; i < numberOfSamplers; ++i) + { + this->TransferFunctions2D->GetTable(i)->Deactivate(); + } + break; } } @@ -2903,8 +3007,7 @@ void vtkOpenGLGPUVolumeRayCastMapper::BuildShader(vtkRenderer* ren, fragmentShader = vtkvolume::replace( fragmentShader, "//VTK::ComputeGradient::Dec", - vtkvolume::ComputeGradientDeclaration(vol, noOfComponents, - independentComponents), + vtkvolume::ComputeGradientDeclaration(vol), true); switch(volumeProperty->GetTransferFunctionMode()) @@ -2949,13 +3052,13 @@ void vtkOpenGLGPUVolumeRayCastMapper::BuildShader(vtkRenderer* ren, fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::GradientCache::Dec", - vtkvolume::GradientCacheDec(ren, this, vol, noOfComponents, + vtkvolume::GradientCacheDec(ren, vol, noOfComponents, independentComponents), true); fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::PreComputeGradients::Impl", - vtkvolume::PreComputeGradientsImpl(ren, this, vol, noOfComponents, + vtkvolume::PreComputeGradientsImpl(ren, vol, noOfComponents, independentComponents), true); break; @@ -3346,50 +3449,8 @@ void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren, this->ComputeReductionFactor(vol->GetAllocatedRenderTime()); this->Impl->UpdateSamplingDistance(input, ren, vol); - - /// TODO Move this into a function - int const transferMode = vol->GetProperty()->GetTransferFunctionMode(); - switch(transferMode) - { - case vtkVolumeProperty::TF_1D: - if (independentComponents) - { - for (int i = 0; i < noOfComponents; ++i) - { - this->Impl->UpdateOpacityTransferFunction(ren, vol, i); - this->Impl->UpdateGradientOpacityTransferFunction(ren, vol, i); - this->Impl->UpdateColorTransferFunction(ren, vol, i); - } - } - else - { - if (noOfComponents == 2 || noOfComponents == 4) - { - this->Impl->UpdateOpacityTransferFunction(ren, vol, noOfComponents - 1); - this->Impl->UpdateGradientOpacityTransferFunction(ren, vol, - noOfComponents - 1); - this->Impl->UpdateColorTransferFunction(ren, vol, 0); - } - } - break; - - case vtkVolumeProperty::TF_2D: - if (independentComponents) - { - for (int i = 0; i < noOfComponents; ++i) - { - this->Impl->UpdateTransferFunction2D(ren, vol, i); - } - } - else - { - if (noOfComponents == 2 || noOfComponents == 4) - { - this->Impl->UpdateTransferFunction2D(ren, vol, 0); - } - } - break; - } + this->Impl->UpdateTransferFunction(ren, vol, noOfComponents, + independentComponents); // Update noise sampler texture if (this->UseJittering) @@ -3663,45 +3724,7 @@ void vtkOpenGLGPUVolumeRayCastMapper::DoGPURender(vtkRenderer* ren, //-------------------------------------------------------------------------- // Opacity, color, and gradient opacity samplers / textures int const numberOfSamplers = (independentComponents ? noOfComponents : 1); - int const transferMode = volumeProperty->GetTransferFunctionMode(); - switch (transferMode) - { - case vtkVolumeProperty::TF_1D: - for (int i = 0; i < numberOfSamplers; ++i) - { - this->Impl->OpacityTables->GetTable(i)->Activate(); - prog->SetUniformi( - this->Impl->OpacityTablesMap[i].c_str(), - this->Impl->OpacityTables->GetTable(i)->GetTextureUnit()); - - if (this->BlendMode != vtkGPUVolumeRayCastMapper::ADDITIVE_BLEND) - { - this->Impl->RGBTables->GetTable(i)->Activate(); - prog->SetUniformi( - this->Impl->RGBTablesMap[i].c_str(), - this->Impl->RGBTables->GetTable(i)->GetTextureUnit()); - } - - if (this->Impl->GradientOpacityTables) - { - this->Impl->GradientOpacityTables->GetTable(i)->Activate(); - prog->SetUniformi( - this->Impl->GradientOpacityTablesMap[i].c_str(), - this->Impl->GradientOpacityTables->GetTable(i)->GetTextureUnit()); - } - } - break; - case vtkVolumeProperty::TF_2D: - for (int i = 0; i < numberOfSamplers; ++i) - { - vtkOpenGLTransferFunction2D* table = - this->Impl->TransferFunctions2D->GetTable(i); - table->Activate(); - prog->SetUniformi(this->Impl->TransferFunctions2DMap[i].c_str(), - table->GetTextureUnit()); - } - break; - } + this->Impl->ActivateTransferFunction(prog, volumeProperty, numberOfSamplers); if (this->Impl->NoiseTextureObject) { @@ -3960,29 +3983,7 @@ void vtkOpenGLGPUVolumeRayCastMapper::DoGPURender(vtkRenderer* ren, } #endif - switch(transferMode) - { - case vtkVolumeProperty::TF_1D: - for (int i = 0; i < numberOfSamplers; ++i) - { - this->Impl->OpacityTables->GetTable(i)->Deactivate(); - if (this->BlendMode != vtkGPUVolumeRayCastMapper::ADDITIVE_BLEND) - { - this->Impl->RGBTables->GetTable(i)->Deactivate(); - } - if (this->Impl->GradientOpacityTables) - { - this->Impl->GradientOpacityTables->GetTable(i)->Deactivate(); - } - } - break; - case vtkVolumeProperty::TF_2D: - for (int i = 0; i < numberOfSamplers; ++i) - { - this->Impl->TransferFunctions2D->GetTable(i)->Deactivate(); - } - break; - } + this->Impl->DeactivateTransferFunction(volumeProperty, numberOfSamplers); if (this->Impl->CurrentMask) { diff --git a/Rendering/VolumeOpenGL2/vtkOpenGLTransferFunction2D.h b/Rendering/VolumeOpenGL2/vtkOpenGLTransferFunction2D.h index fd22d159591fb9dc40ca6e83612acfb123a1605c..379c2914147b15ed41de68864192f9c8c6c74699 100644 --- a/Rendering/VolumeOpenGL2/vtkOpenGLTransferFunction2D.h +++ b/Rendering/VolumeOpenGL2/vtkOpenGLTransferFunction2D.h @@ -84,7 +84,7 @@ public: // Resample if there is a size restriction void* data = transfer2D->GetPointData()->GetScalars()->GetVoidPointer(0); - if (dims[0] != width || dims[1] != height); + if (dims[0] != width || dims[1] != height) { this->ResizeFilter->SetInputData(transfer2D); this->ResizeFilter->SetResizeMethodToOutputDimensions(); diff --git a/Rendering/VolumeOpenGL2/vtkVolumeShaderComposer.h b/Rendering/VolumeOpenGL2/vtkVolumeShaderComposer.h index 18fbf2776234c80c46bc83b3b7e0b60d04329349..dc5e31a790af81381abf453c07d839622a432b51 100644 --- a/Rendering/VolumeOpenGL2/vtkVolumeShaderComposer.h +++ b/Rendering/VolumeOpenGL2/vtkVolumeShaderComposer.h @@ -479,8 +479,7 @@ namespace vtkvolume } //-------------------------------------------------------------------------- - std::string ComputeGradientDeclaration(vtkVolume* vol, int noOfComponents, - int independentComponents) + std::string ComputeGradientDeclaration(vtkVolume* vol) { std::string shaderStr; if (vol->GetProperty()->GetShade() && @@ -1015,7 +1014,7 @@ namespace vtkvolume "vec4 computeColor(vec4 scalar, float opacity)\n" "{\n" " vec4 color = texture2D(" + colorTableMap[0] + ",\n" - " vec2(scalar.w, g_gradients.w));\n" /// TODO Scale all gradients with the actual texture size (?) or is this done already through the normalized magnitude to Range/4? + " vec2(scalar.w, g_gradients.w));\n" " return computeLighting(color, 0);\n" "}\n"); } @@ -1060,7 +1059,6 @@ namespace vtkvolume } else { - // TODO Rearrange this branches, is this one necessary (Dep RGBA ?) return std::string( "vec4 computeColor(vec4 scalar, float opacity)\n" "{\n" @@ -1228,7 +1226,6 @@ namespace vtkvolume //-------------------------------------------------------------------------- std::string GradientCacheDec(vtkRenderer* vtkNotUsed(ren), - vtkVolumeMapper* mapper, vtkVolume* vtkNotUsed(vol), int noOfComponents, int independentComponents = 0) @@ -1265,7 +1262,6 @@ namespace vtkvolume //-------------------------------------------------------------------------- std::string PreComputeGradientsImpl(vtkRenderer* vtkNotUsed(ren), - vtkVolumeMapper* mapper, vtkVolume* vtkNotUsed(vol), int noOfComponents, int independentComponents = 0)