[vtk-developers] [VTK 0013549]: vtkSmartVolumeMapper does not change color function in GPU mode

Mantis Bug Tracker mantis at public.kitware.com
Tue Oct 23 12:04:59 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://vtk.org/Bug/view.php?id=13549 
====================================================================== 
Reported By:                Jose M.
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   13549
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     backlog
Project:                    TBD 
Type:                       incorrect functionality 
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             2012-10-23 12:04 EDT
Last Modified:              2012-10-23 12:04 EDT
====================================================================== 
Summary:                    vtkSmartVolumeMapper does not change color function
in GPU mode
Description: 
This issue is for VTK 5.10.0

Changing the vtkColorTransferFunction of a vtkSmartVolumeMapper object will have
no effect after the first render, if render mode is GPU-based (which is the
default)

I have attached a case test, where one vtkSmartVolumeMapper and two diferent
color transfer functions are defined. There are 4 lines of code of interest,
marked as TESTLINE1 .. TESTLINE4

  // Render composite. In default mode. For coverage.
  //TESTLINE1
  renWin->Render();
 
  //Change color function to green
  //TESTLINE2
  volumeProperty->SetColor(color2); 

  //Change render to software mode
  //TESTLINE3
  volumeMapper->SetRequestedRenderModeToRayCast();
  renWin->Render();

  //Change render to default (GPU) mode
  //TESTLINE4
  volumeMapper->SetRequestedRenderModeToDefault();
  renWin->Render();


This example define a color transfer function in red values. The TESTLINE2
changes it to another color in green values. The expected result should be to
see a sphere with green color, but the original red color is used.

Disabling TESTLINE1, so initial GPU render is avoided, will produce the correct
behavior.

Disabling TESTLINE4 (so CPU raycast is used) will also produce correct behavior,
even if TESTLINE1 is enabled.

So it seems that GPU based renderer is not changing the color transfer function
after the first call to render(). 
Doing a explicit call to volume->UpdateTransferFunctions(ren1) does not help to
solve the problem.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-10-23 12:04 Jose M.        New Issue                                    
2012-10-23 12:04 Jose M.        File Added: SmartVolumeMapper.cxx               
    
======================================================================




More information about the vtk-developers mailing list