[vtkusers] VtkUnstructuredGrid SetOpacity

David E DeMarle dave.demarle at kitware.com
Thu Jan 26 12:02:07 EST 2012


On Thu, Jan 26, 2012 at 10:56 AM, Bhanu Hariharan <bhanu at petrotel.com>wrote:

> Thanks David. I have a few more questions in this regard before I make
> changes to my approach.
>
> 1.  How do I tell if my graphics card supports Depth peeling. Would Depth
> Peeling render it blueish green?
>
>
I _think_ it spits out a warning if it can't find the extensions it needs.
And yes depth peeling should render it correctly.


> 2. I tried vtkDepthSortPolyData but it needs vtkPolyData as input. I was
> wondering if VtkUnstructuredGrid can be used for vtkDepthSortPolyData or is
> there any other equivalent of vtkDepthSortPolyData for VtkUnstructuredGrid
> that would render according to depth correctly.
>
>
Nothing direct.


>
> 3. If I replaced all my code and do Volume rendering, do I still need to
> use vtkDepthSortPolyData?
>
>
No
.

> 4. I found VtkUnstructuredGrid  to be slow in rendering for large datasets
> thats why I was rendering only the outer surfaces.
> Is volume rendering better than VtkUnstructuredGrid  for rendering in
> terms of speed.
>

Yes.


> Are there any C++ examples for Volume rendering that will help me get
> started.
>
>
Most likely, try the vtk examples wiki.


> I really appreciate you taking the time to answer my questions.
>
> Thanks for your help.
>
> Bhanu
>
>
>
>
>
> On Wed, Jan 25, 2012 at 5:26 PM, David E DeMarle <dave.demarle at kitware.com
> > wrote:
>
>>
>> On Wed, Jan 25, 2012 at 5:52 PM, Bhanu Hariharan <bhanu at petrotel.com>wrote:
>>
>>> David, Thanks for replying.
>>>
>>> When I flip, I see blue AGAIN. Is that what you expect with the external
>>> surface rendering logic you explained?
>>>
>>> What is not clear is even if there are 2 surfaces, shouldnt I be seeing
>>> a blend of blue and green?
>>> And shouldnt it be same whether I see from top or flipped?
>>>
>>>
>> That is what I was trying to figure out. I suspect you see only blue
>> because those are the first polygons rendered in the object. Correctly
>> rendering translucent geometry is order dependent and VTK doesn't do depth
>> sorting automatically (since it takes time). Try enabling depth peeling. If
>> your graphics card doesn't support depth peeling use vtkDepthSortPolyData.
>> You should then see a blueish green object and that should be bluer or
>> greener depending on what is nearer. However you still won't see anything
>> on the inside.
>>
>> Bhanu
>>>
>>>
>>>
>>> On Wed, Jan 25, 2012 at 4:26 PM, David E DeMarle <
>>> dave.demarle at kitware.com> wrote:
>>>
>>>> When you flip the object around, do you see only green?
>>>>
>>>> In any case, the typical mapper people use for surface rendering,
>>>> vtkDataSetMapper, extracts the external surfaces. With that there is no
>>>> possibility to see the inner cells even with opacity.
>>>>
>>>> You could instead send the data through something like the shrink
>>>> filter,  to  break up the object so that all cells are unconnected and thus
>>>> external. Surface rendering with opacity then might to what you want.
>>>>
>>>> However, it is much better to use volume rendering. That will be much
>>>> faster and consume less memory.
>>>>
>>>> David E DeMarle
>>>> Kitware, Inc.
>>>> R&D Engineer
>>>> 21 Corporate Drive
>>>> Clifton Park, NY 12065-8662
>>>> Phone: 518-881-4909
>>>>
>>>>
>>>>
>>>> On Wed, Jan 25, 2012 at 4:58 PM, bhanu <bhanu at petrotel.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am using VtkUnstructuredGrid to render a simple volume wherein each
>>>>> grid
>>>>> cell in the 3dvolume has 8 world coordinates. Each grid cell has a
>>>>> color
>>>>> associated with it and I am using a vtkLookUpTable for this. When I use
>>>>> SetOpacity(1) and see the top view, I expect to see the top layer alone
>>>>> since I have set an opacity of 1.0. And that works fine.
>>>>> Now When the opacity is changed to anything less than 1 (even 0.99), it
>>>>> seems the top layer vanishes and all I see from the top is the bottom
>>>>> most
>>>>> layer.
>>>>> For example, if top most layer is green and the bottom most layer is
>>>>> blue
>>>>> (with inbetween layers shades of lighter green), with opacity less
>>>>> than 1, I
>>>>> see all blue from the top. I was expecting mixed colors( green and
>>>>> blue).
>>>>> What am I missing.
>>>>>
>>>>> How do you see a transparent grid using VtkUnstructuredGrid and Opacity
>>>>> property. Should I not be using Scalar Opacity for such a problem. Is
>>>>> this
>>>>> where one uses Gradient Opacity.
>>>>> Can anyone please paste some code to direct me here.
>>>>>
>>>>> Thanks,
>>>>> Bhanu
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://vtk.1045678.n5.nabble.com/VtkUnstructuredGrid-SetOpacity-tp5431453p5431453.html
>>>>> Sent from the VTK - Users mailing list archive at Nabble.com.
>>>>> _______________________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Please keep messages on-topic and check the VTK FAQ at:
>>>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>>>
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120126/558e2af0/attachment.htm>


More information about the vtkusers mailing list