[vtkusers] vtkFixedPointVolumeRayCastMapper question

Randall Hand randall.hand at gmail.com
Wed May 25 15:04:56 EDT 2005


Sadly, none of that worked. 
1) Checked, and even if I have them backwards I should see something other 
than a blurry black spot.
2) Tried, no difference really.. With shading on I get a few specular 
highlights on my blurry black spot, but still isn't right.
3) I'm working with offscreen Mesa rendering, which is why I had this on. I 
commented it out, so it would use the default, but still no dice.
4) I set it to use all-red, and I still got my blurry black spot. I changed 
it to be all-red, and all opaque (set my opacity function to a constant 1) 
and my blurry black spot become a solid black brick (as attached).

Any ideas?

On 5/25/05, Lisa Avila <lisa.avila at kitware.com> wrote:
> 
> 
> Looking quickly at your code I don't see anything obviously wrong. 
> However, I would suggest trying a few things to isolate the problem:
> 
> 1) Make sure your first component is the one you want mapped to color, and 
> the second is the one you want mapped to opacity.
> 
> 2) Try volProp->ShadeOff(). Perhaps you do not have good gradients in your 
> data and that is causing the problem (although you have a high ambient so 
> that shouldn't be the problem...)
> 
> 3) Leave your ImageSampleDistance at 1.0 (the default). Keep in mind that 
> a distance of 0.5 means that you cast 4 rays for every pixels on the 
> screen. I believe when OpenGL maps this texture to the screen, it will 
> sample it for the pixel value, meaning that you are throwing away 3/4 of the 
> information you created during ray casting.
> 
> 4) If all these fail, try using a solid color transfer function (all 
> values map to red for example) - do you get what you expect?
> 
> 
> Lisa
> 
> 
> 
> At 02:15 PM 5/25/2005, Randall Hand wrote:
> 
> I have a long pipeline setup to render a multifield dataset. one field I 
> want mapped to opacity, and the other one is a vector that I want magnitude 
> mapped to color.
> My pipeline resembles the following:
> 
> 
> vtkDataSetReader -> vtkArrayCalculator (to calculate magnitude) -> 
> vtkGaussianSplatter -> vtkImageShiftScale = Dataset with ColorField single 
> component scalar
> +-> vtkGaussianSplatter -> ImageShiftScale = Dataset with OpacityField 
> single component scalar.
> 
> I then do a 
> OpacityData->GetPointData()->AddArray(Colordata->GetPointData()->GetArray("colorField")), 
> and pass the result through a vtkMergeFields to combine the 2 fields into a 
> single dual-component field, and make the new field the Active Scalar.
> 
> 
> I then construct my volume parts:
> vtkVolumeProperty *volProp = vtkVolumeProperty::New();
> volProp->IndependentComponentsOff();
> volProp->SetColor(xf_Color);
> volProp->SetScalarOpacity(xf_Opacity);
> volProp->SetInterpolationTypeToLinear();
> volProp->ShadeOn();
> volProp->SetAmbient(0.7);
> 
> // Now setup the Ray Caster
> vtkFixedPointVolumeRayCastMapper *modelMapper = 
> vtkFixedPointVolumeRayCastMapper::New();
> modelMapper->SetImageSampleDistance(0.5);
> modelMapper->SetSampleDistance(0.1);
> modelMapper->SetInput(mergeFilter->GetOutput());
> 
> // Creating Volume
> vtkVolume *volume = vtkVolume::New();
> volume->SetMapper(modelMapper);
> volume->SetProperty(volProp);
> volume->Update();
> 
> When all is said and done, however, I just get a darkish blurry spot 
> (image Attached). Can anyone see what's wrong, or have I exposed a bug in 
> the FixedPointVolumeRayCastMapper ? I've been waiting to do this since I 
> figured out that the old VolumeRayCastMapper couldn't handle multi-component 
> data, and i'm anxious to see this work for once :)
> -- 
> Randall Hand
> http://www.yeraze.com 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: 
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
>  http://www.vtk.org/mailman/listinfo/vtkusers
> 
> 


-- 
Randall Hand
http://www.yeraze.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050525/d6ffa885/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output.png
Type: image/png
Size: 13821 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050525/d6ffa885/attachment.png>


More information about the vtkusers mailing list