|
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
|
