[vtkusers] (yet another) Opacity Issue (hmm)

Clinton Stimpson clinton at elemtech.com
Fri Jan 14 02:46:43 EST 2005


One thing I do that really helps with scenes in VTK is to make two passes at
rendering the transparent data.

I've overloaded vtk*Renderer::UpdateGeometry.
I've also overloaded vtkOpenGLProperty::Render.

The UpdateGeometry function does a cheap z-depth sort at the actor level,
instead of each polygon.

I turn enable culling..
glEnable(GL_CULL_FACE)

Then draw each polygons with
glCullFace(GL_FRONT)

then on the second pass, draw each polygon with
glCullFace(GL_BACK)

For the types of things I'm drawing, this is a cheap way to get pretty good
results, but it isn't perfect.  I've heard no complaints from any of our
users.  I might see some minor artifacts when I have terribly convoluted
geometry or pieces of geometry tangled up with each other.

That might work for you.

Clint

>
> Message: 9
> Date: Thu, 13 Jan 2005 20:07:23 -0500
> From: Marius S Giurgi <rendezvous at dreamxplosion.com>
> Subject: [vtkusers] (yet another) Opacity Issue (hmm)
> To: vtkusers at vtk.org
> Message-ID: <A5A7FCD4-65C8-11D9-AC31-000393D5EB76 at dreamxplosion.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> I know, I know. there's a lot of feedback regarding the opacity of
> overlapping geometry issue, but to my disappointment, after spending a
> loooong long time reading through the VTK archives, I still couldn't
> find a satisfactory answer to this (rather annoying) problem. By the
> way, most of the 3D software (I know) out there have this issue already
> solved (3DS Max, Alias|wavefront Maya etc). I wonder how comes VTK (4.4
> and counting) still has issues with opacity? I'm sure there should be
> some smart developers out there to figure this out and have it history
> once and for all. Those VTK developers should probably take a peek and
> see how the smart guys at SGI (Alias|Wavefront: MAYA) approached this
> issue.
>
> (the riddle of the intersecting transparent polygons).
> In Maya (Alias), for instance, I create two perpendicular planes
> (intersecting each other), give them two different colors and set their
> transparency to 0.5 (let's say). They display fine both in the
> interactive window and in the rendered scene without any artifacts. How
> do they do it? Magic.
>
> Yes, I came across the vtkDepthSortPolyData "cute" idea, which is not
> only slowing down the whole pipeline but also fails to work on the
> simple scenario of two intersecting polygons (both having opacity < 1).
> Besides I'd like to see this "sorting" be part of the rendering engine
> rather than have it as an extra element in the pipeline (via some
> DepthSort class of sort).
>
> Also I noticed a similar (opacity<1) issue while I was rendering a
> scene containing a 3D volume (with opacity<1) combined with some
> polydata (also with opacity<1). If the volume is in front of the
> PolyData, the volume fails to hide the PolyData. Again, some sort of
> ordering issue.
>
>
> God speed our VTK developers' way in getting this issue solved!
>
> marius
>
> PS: if there IS a solution tho this riddle, please let me know. Thanks!
>
>
>




More information about the vtkusers mailing list