I actually had the opportunity at Siggraph to speak to Henry Sowizral at Sun who is involved with the Java3D development - you may have seen him also at the Java3D BOF at the JavaOne conference.  He was looking at a demo that I had made which exhibited precisely the same effect, and he mentioned that that was a known bug which would be fixed in a subsequent release.
 
So how do you work around this transparency problem?  Hmmm....  Naively speaking I guess the defect is simply that translucent objects can't rely on the zbuffer.  I could be wrong here.  But anyway if this is true then correct translucency requires objects being printed in a sorted order.  Probably (again making another assumption) Java3D does make some efforts to paint objects in sorted order but of course this can fail since you can't guarantee sorted order for objects which interpenetrate in the viewing camera forward viewing vector.  Of course this approach only works for simple convex or 'shomarkerable' objects (objects which always render correctly if rendered with a known polygon ordering).  An object level BSP here would help you do this efficiently or you could sort them by hand.  Somehow you have to guarantee the right manual sorting.  Perhaps if you know how the scenegraph is traced you can arrange your geometries to always successfully render in the right order - but you have to reorder your scenegraph every frame.  Alternatively you can just print them by hand - this is probably doable in direct mode.  Even in this case however you can get degenerate cases that resist sorting. For objects which are more complex such as overlapping forks or something like that you need to decompose your objects down to the polygon level... and at that point you need to start using polygon BSP style solutions to guarantee correctness.
 
Anyway I could be entirely wrong - for example why is hardware also sometimes subject to this defect?  It may not be a sorting problem at all but just some other artifact.  In that case I have no idea what layer is responsible for this kind of issue - if its the fault of the higher levels such as Java3D or if it is the fault of the low level rasterizer such as OpenGL.  I would tend towards the latter in fact and if this is true then there may be some information in one of the numerous OpenGL books or websites on this topic.
 
 - Anselm Hook
 
 
-----Original Message-----
From: Steve Grenier <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Thursday, October 21, 1999 8:13 PM
Subject: Re: [JAVA3D] Problem with grouping several objects (transparency)

Ok, in response to the message below.  Thank you for responding to my question!  Your response was very helpful actually.  It does turn out that my problem was due to (a bug?) with Transparency and overlapping objects.  The problem occurs even if the Appearance of your objects which are "overlapping" has a TransparencyAttribute set (even if the transparency on all objects is 0.0f ).  This kinda sux though, since I was planning on having one of the objects in my group being semi-transparent.  Anyone have any suggestions on how to work around this problem?
 
----- Original Message -----
Sent: Friday, October 22, 1999 6:18 PM
Subject: Re: [JAVA3D] Problem with grouping several objects

Are any of your objects partially transparent?  I heard there was a defect with how translucent objects were drawn when overlapping each other.
 
This bug you're seeing might not have anything to do with the fact that your Shape3D's happen to be in the same group.
 
 - Anselm Hook
 
-----Original Message-----
From: Steve Grenier <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Thursday, October 21, 1999 6:15 PM
Subject: [JAVA3D] Problem with grouping several objects

Hi All,
 
I'm wondering if anyone out there has some insight on this.  I created a class which defines several different custom Shape3D objects.  All of these objects in the class are add to a single 'Group' object, and the getShape() of this class returns the Group object.  This is so that I can add the single large group of objects as "one" Shape to the scene graph and transformations on that group will affect the entire object.
 
My problem is that for some reason, when I create one of these objects and add it to my scene,  some of the "individual" Shape3D objects from the original class seem to "overlap" each other.  The group as a whole still transforms as one object, but the individual pieces that make up the group this problem.  For example,  a large cube-like object seems to cover a plane-like object, even though the plane is closer to the viewer (z-buffer).  Does anyone know why this might happen?  Any help would be appreciated.
 
Steve Grenier

Reply via email to