hi olivier,

transparency and z-buffering do not work well together.

let me summarize how a z-buffer (depth buffer) works: when some polygon is
drawn, the corresponding pixels in the z-buffer are set to the distance of
that point-in-polygon to the viewer. when a second polygon is drawn which
overlaps the first, for each pixel the system first checks if the new pixel
is "nearer" (i.e. has a z-value that is smaller). the new pixel is only
drawn if it is nearer.

now imagine this scenario for your icon/terrain situation. imagine the
transparent icon (which has a smaller z value than the terrain) is drawn
first: because the buffer is initally cleared, what you see behind the
transparent pixels is pure black (or whatever is your background color).
nevertheless, the z value of the transparent pixels is set in the
depth-buffer!

when it comes to drawing the terrain, the system does not draw the pixels
"under" the icon because it determines that with regard to these pixels, the
terrain has a larger z-value. the result looks like transparency would not
work because "behind" the icons you see the background, not the terrain.

the simple solution to this problem is: have the terrain being drawn first,
then the icon(s). i don't know how exactly this is done in retained mode,
perhaps with the OrderedGroup class you mention (i am using immediate mode,
where it is left to the programmer in what order the primitives are drawn).

i don't know if it helps, but you can also individually disable writing to
the depth-buffer and depth-buffer testing for each Appearance (I think using
RenderAttributes or PolygonAttributes). you may even disable usage of the
depth buffer completely if you do not need it.

-- julian



-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of Olivier fillon
Sent: Tuesday, February 15, 2000 11:11 PM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] OrderedGroup and Transparency


Hi fellow avatars,
I have icons of vehicule driving on a road, to be usre to have the vehicle
on top of the road (even if they have same z or just a slight z diff, I am
using ordered group=>
the problem, now, the transparent background of the icon does not work
anymore.
As I understand things, my using an ordered group, I change the z order
processing and this may/must be the cause of my now inactive transparency;
Is this what is happening? How can i combine both: ordered group and working
transparency?
Any help very welcome


Olivier Fillon    Minestar Project
[EMAIL PROTECTED]  Mincom Limited
Ph.+61-7-3303-3344               61 Wyandra Street
Fax+61-7-3303-3232               Teneriffe Qld. 4005.
Australia
Company home page: http://www.mincom.com/
Personal home page: http://www.powerup.com.au/~fillon
--- A word from our sponsor ---
This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please delete
it and notify the sender. The contents of this E-mail are the opinion of the
writer only and are not endorsed by Mincom Limited unless expressly stated
otherwise.

--
-----Original Message-----
From: gav <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Wednesday, February 16, 2000 3:53 AM
Subject: [JAVA3D] Textured plane rendering issues...


>Hey everyone,
>  Just a quick question for the group: has anyone played with textured
>plane objects (any object, not necessarily planar, but made up of only two
>triangles which share an edge)?  I'm currently working on a grid-based
>terrain application.  When I apply regular ColoringAttributes to the
>Appearance, the grid looks fine, I can position the camera anywhere with no
>texturing issues.  However, if I apply a TextureAttributes to the
>Appearance, the grid looks fine except when I'm on a level plane with it
>(like walking on top of it).  Then, several strange render issues appear,
>where textures bleed over one another, and for some reason just seem to
>render in the wrong order.
>  I also had this problem in an app I wrote just a few months ago, except I
>would actually change the Appearance of the Shape3D.  I had four objects
>(plane objects as above) and would move only on a planar surface towards
>these objects, which were facing the user directly (almost like a wall).
>However, when I changed the Appearance of one (it was an intersection
>behavior), the plane rendered behind all the other objects, even if it was
>spatially located in front of them.
>  I'm using the J3D OpenGL 1.1.2, and J3D D3D 1.1.3.  Is this an issue
>that's been fixed since then, or is it something I'm doing incorrectly in
>my setup?  Thanks,
>George
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff JAVA3D-INTEREST".  For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to