I ran a little experiment. I put 1000 flowers into the scene (thats 2
shapes each) using links and shared groups. With say, 500 visible at one
time. The first time I put them in an ordered group and the fps was 5. The
second time I jumbled them into a single branchgroup. The fps was then 17.
So putting them in an ordered group seems to cost a lot more. I suspect
that you give up the appearance sorting when you do that. I then made the
plants non-transparent.. it will interest you to know there was no change in
fps.
As an aside, it is interesting that 4000 vertices can have that big an
impact on the scene. Its really all the same geometry, the only difference
being the translation. Technically in opengl you should be able to set the
appearance, set the display list and just set the transform and render the
shape. I am a little suprised at the impact. The next thing to try is to
build a "batch" of plants all in the same shape and see how that renders.
Dave Yazel
----- Original Message -----
From: David <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 05, 2001 12:57 PM
Subject: [JAVA3D] Ordered Groups and Optimizations
Hi all:
I am trying to get a handle on managing the sorting of transparent
vegetation. My first stab at it used an ordered group, with each shape
being in a seperate branch group. After the user moves a short distance I
check to see if the nodes are out of order (based on distance from eye to
center of sub-scene. If they are out of order I detach the BG parent of the
ordered group (because the following detaches are very expensive if they are
live), and detach all the nodes from the ordered group and then place the
children back into the ordered group in the proper sorted order. This is
extremely expensive when the sorted sub-graphs reach past 100 or so.
1. Does the renderer still optimize at all, if the sub-graphs have the same
material, appearance, etc? Say I have 100 sub-graphs which are branch
groups with links to the exact same geometry. Technically the only thing
different is the transform. Is the ordered group causing java3d to
repeatedly send all the appearance info for each ordered group?
2. I would like to consider an alternate approach for a specific case. The
case is that I have, say 4 batches of 100 sub-graphs. Each batch of 100 has
exactly the same sub-graph, but with different transformations. Would it be
more efficient to just sort the trsnaformations? In other words don't sort
the groups each pass, just sort the transforms, swapping transforms as I
sort?
3. One problem I have been having is with intersecting alpha blended shapes.
Like a simple bush which has 2 or 3 intersecting planes with alpha blended
textures. The problem is that ordering the entire bush with other such
bushes is fine as far as its relation to each bush goes, but the ordering of
the planes within a single bush can (and almost always do) cause them to
step on each other. So sometimes you look at it from one angle and you see
that the back to front pane must have been drawn before the left to right
pane, causing you to see behind the bush on the left, missing the left hand
part of one pane. I could make those 4 seperate planes, so there is no
intersection and sort them.
A. This is more sorting, would increase the objects being sorted 400
percent.
B. Could I place all four planes in one shape node? Would I need to
sort the geometries then?
C. If I have to sort the geometry arrays then I can no longer use links
and shared groups right?
Any suggestions would be helpful,
I would love to hear how the Sun engineers would code this if they were
doing it in Java3d.
Sincerely,
Dave Yazel
Cosm Development Team
===========================================================================
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".