lighting/opacity question

Will Schroeder will.schroeder at kitware.com
Thu Jun 24 08:35:21 EDT 1999


Hi Jim-

The problem is this: opacity is implemented using alpha compositing in hardware. Alpha compositing only works when the polygons are rendered in the right order: from back to front. In your data, in one direction the polygons are ordered correctly, in other directions, they are not.

One solution is to sort the polygons based on camera position using a BSP tree or something similar. Some folks on this list (I believe) have played around with this, maybe you can get an implementation from them.

Another solution is to use something like RenderMan or BMRT (free) that manage the rendering of translucent primitives correctly. Of course, these are much slower than hardware.

Will

At 10:08 AM 6/23/99 -0700, you wrote:
>
>Hi,
>
>I'm not understanding something about lighting/opacity, at least I'm not
>getting the results I'm expecting. I have forty data files representing a
>volume changing over time. ( a timestep per file). I read the data files
>in order, extract three surfaces using marching cubes, assign each surface 
>a color and an opacity so I can see thru the object, and display these three
>surfaces. I works fine if I just read and display the data looking down the z
>axis. What I'd like to do is to move around the object. The approch I've been
>trying is to move the camera every time step. I have a light defined. I set the
>light's position to the camera position after moving the camera. I also
>recompute the viewplane normals after the camera and light moves.When I'm on
>the "front" of the object I can see thru the object .e.g., the object is sort of
>like a cone, wher there is one surface it is light blue, where there are two
>surfaces it is a darker blue. But when I'm on the back of the object I see only
>light blue or a single surface. Also at 90 and 270 degrees there is a mottled
>look to the surfaces.
>
>
>I have a mpeg file if the above discription isn't clear. 
>
>
>Any ideas??
>
>
>Thanks,
>Jim
>
>
>---------------------------------------------
>Jim Harsh  E-Mail: harsh at lanl.gov
>Los Alamos National Laboratory, MS P940
>Los Alamos, NM 87545
>505-665-0485, FAX - 505-665-3359
>Date: 23-Jun-99,Time: 09:38:44
>---------------------------------------------
>
>
>-----------------------------------------------------------------------------
>This is the private VTK discussion list.  Please keep messages on-topic.
>Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
>To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
><majordomo at gsao.med.ge.com>.  For help, send message body containing
>"info vtkusers" to the same address.     Live long and prosper.
>-----------------------------------------------------------------------------
> 

--------------------------------
Dr. William J. Schroeder
Kitware Visualization Solutions / vtk Commercial Support
469 Clifton Corporate Parkway
Clifton Park, NY 12065
will.schroeder at kitware.com
1-518-371-3971 (Phone & Fax)


-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list