Re: problem with alpha blending in MPR2

New Message Reply Date view Thread view Subject view Author view

Robert Grzeszczuk (rg)
Wed, 19 May 1999 11:35:45 -0700 (PDT)


Luca & Ricardo,

The algorithm used by MPR demos for 2D texture mapping relies on blending
circuits to compute a properly sampled tri-linear interpolation of a slice
(essentially, an ablique slice is decomposed into many very thin slivers which
are blended together; I can describe it in greter detail if you're interested).
 therefore, you cannot disable blending in these demos and get correct results.

An alternative is to adjust the lookup table to make sure that the slices are
drawn opaque (set all Alpha components to 1.0).

Also, if the 3 perpendicular slices happen to be axis aligned, you don't need
to use the general purpose algorithm that MPR demos use to draw arbitrary
oblique slices. Simply, get a suitable 2D slice from each of the three
BrickSets, bind it, and texture map it onto three perpendicular rectangles (you
can use voFaceSets to represent the polygons, or plain OpenGL):

        aVolume->setCurrentBrickSet(voPlaneOrientationScope::XY);
        voBrick *aBrick = aVolume->getCurrentBrickSet()->getBrick(zSliceNum));

        voAppearanceActions::textureEnable(aVolume->getInterpolationType());

        if (!hasTextureComponent(my_Data.interleavedArrayFormat))
          voAppearanceActions::texgenEnable();

        if (!hasTextureComponent(my_Data.interleavedArrayFormat))
          voAppearanceActions::texgenSetEquation(aBrick);

        voAppearanceActions::textureBind(aBrick);

        voGeometryActions::draw(myFaceSet,my_Data.interleavedArrayFormat);

The above can be made to work with both 2D and 3D texture mapping.

-rg

On May 19, 8:40am, Riccardo Grassi - Gandolfo Luca wrote:
> Subject: problem with alpha blending in MPR2
> Hello,
> We have seen the voglMPR2 example and we tried to disable the
> blending to obtaine a cross between three perpendicular planes from
> slides of a 3D Volume, but with the blending activate, we aren't able
> to see the intersections between slides because these are
> semitransparent.
> Without Alpha Blending the images on the planes results to be rendered
> with many artifacts such as black lines parallel to the best set of
> sampling planes.(We work on a O2 that don't support texture3D and we
> must replicate our bricks (with volumeMakeTransposed)).
> How can we solve this problem ?
>
> Thanks
>
>
> Luca Gandolfo
>
> Riccardo Grassi
>-- End of excerpt from Riccardo Grassi - Gandolfo Luca


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Nov 01 1999 - 13:42:00 PST