vtkSmartVolumeMapper inconsistant results with independent components
ON VTK Master I am using the vtkSmartVolumeMapper to render vtkImageData with the following
dims : 128 1024 8
extent : 0 127 0 1023 0 7
bounds : 0 .10 0 .50 0 0.005
spacing : 0.000787402 0.000488759 0.000714286
data range : 0.000139062 0.00055625
opacity range : 0.000139062 0.00055625
This volume does not appear when the number of components is 1. This volume does appear when the number of components is 2. However, the color mapping is not correct.
By appear the volume is rendered but the opacity sampling is such that appears totally translucent.
Original volume with one component, totally translucent.
Original volume with two components - both component values are the same, incorrect color mapping.
If I scale the image grid by 100 to have the following:
bounds : 0 10 0 50 0 0.5
spacing : 0.0787402 0.0488759 0.0714286
This volume does appear when the number of components is 1. This volume does appear when the number of components is 2. And, the color mapping is correct.
Scaled x100 volume with one component, correct color mapping.
Scaled x100 volume with two components - both component values are the same, correct color mapping and consistent with the one component scaled volume.
These images are from using TestOSPRayVolumeRenderer with the following changes:
- Use a vtkSmartVolumeMapper instead of vtkOSPRayVolumeMapper
- The clipping is not done. // ren->AddActor(dssActor);
- Read in my data volume
- Original volume with one component.
- Original volume with two component (both being the same)
- Scaled x100 volume with one component.
- Scaled x100 volume with two component (both being the same)
- For 2 and 4 volumeProperty->SetIndependentComponents( false );
My expectation is that the rendered images would be the same as the rendering paths should be the same regardless if there is one or two components. Obviously they are not the same paths and the results are greatly affected by the volume size. While reasonable that some volumes may not render well one would expect that the poor rendering would be consistent.
I can supply my test image data and my modified TestOSPRayVolumeRenderer file.
I should also note that if I switch to the vtkOSPRayVolumeMapper the volume does not appear. However if I scale the image grid by 1000, then it appears. There are some slight color differences that I would expect. But here again I would not have expected to have been forced to scale the grid.
vtkOSPRayVolumeMapper with Scaled x100 volume with one component, correct color mapping, but nearly translucent. Note the nearly horizontal faint green line.
Additional observations via my application. When rendering the original volume with one component both my colormap and opacity had 256 entries. The opacity was a ramp from 0 to .9999. Both were clamped. If I made the last two opacity entries 1.0 the volume would render. However, the resulting image was not correct in that all other areas were the opacity was less than 1 were fully translucent. If only the last opacity value was 1.0 then it was fully translucent.
I can replicate this issue with other data that has similar spacing but with dims of 256 64 64. Thus the issue is not related to be a thin plate.