Ignore:
Timestamp:
Oct 2, 2013 1:16:17 AM (11 years ago)
Author:
ldelgass
Message:

Scale opacity using transfer function alpha map when volume renderer is VTK's
GPU ray-caster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/vtkvis/Volume.cpp

    r3961 r3980  
    213213    if (getVolume() != NULL) {
    214214        getVolume()->GetProperty()->SetColor(_colorMap->getColorTransferFunction(_dataRange));
     215#ifdef USE_GPU_RAYCAST_MAPPER
     216        getVolume()->GetProperty()->SetScalarOpacity(_colorMap->getOpacityTransferFunction(_dataRange, _opacity));
     217#else
    215218        getVolume()->GetProperty()->SetScalarOpacity(_colorMap->getOpacityTransferFunction(_dataRange));
     219#endif
    216220    }
    217221}
     
    234238    if (getVolume() != NULL) {
    235239        getVolume()->GetProperty()->SetColor(_colorMap->getColorTransferFunction(_dataRange));
     240#ifdef USE_GPU_RAYCAST_MAPPER
     241        getVolume()->GetProperty()->SetScalarOpacity(_colorMap->getOpacityTransferFunction(_dataRange, _opacity));
     242#else
    236243        getVolume()->GetProperty()->SetScalarOpacity(_colorMap->getOpacityTransferFunction(_dataRange));
     244#endif
    237245    }
    238246}
     
    256264    // 3D texture mapper, not the GPU raycast mapper
    257265    if (getVolume() != NULL) {
     266#ifdef USE_GPU_RAYCAST_MAPPER
     267        getVolume()->GetProperty()->SetScalarOpacity(_colorMap->getOpacityTransferFunction(_dataRange, opacity));
     268#else
    258269        if (opacity < 1.0e-6)
    259270            opacity = 1.0e-6;
    260271        getVolume()->GetProperty()->SetScalarOpacityUnitDistance(1.0/opacity);
     272#endif
    261273    }
    262274}
Note: See TracChangeset for help on using the changeset viewer.