Optimizing scenes: use primitives or not? 
Author Message
 Optimizing scenes: use primitives or not?

Hi all:

        I had always thought that a good way to optimize my vrml
scenes, not only in their download time but also in their rendering
speed, was to use primitives (boxes, cylinders, cones, etc.) whenever
possible. However, lately I'm finding out that this isn't actually the
case, at least with rendering speed: for example, if I have a scene
with several (say 20) spheres, all of them created using primitives,
my browser navigates through it more slowly than what I think that it
should be, considering that all of them are created using Sphere
instead of, say, IndexedFaceSet.
        Can anyone provide some light into this? How do the different
browsers represent internally the geometry of the scene, and
specifically the primitives? If I use 20 sphere primitives as in the
above example, am I actually wasting 800 (40 * 20) polygons only in
that part of the scene, of am I saving more space than if I used other
alternatives? Could I speed up rendering if I represented the spheres
with a highly optimized IndexedFaceSet (using the creaseAngle field to
make them look smooth instead of "polygonal"), instead of the
primitives? But in that case, isn't there a tradeoff between
downloading speed (achieved using primitives) and rendering speed?

                                Paulo (a bit confused)



Fri, 21 Apr 2000 03:00:00 GMT  
 Optimizing scenes: use primitives or not?

Hi all:

        I had always thought that a good way to optimize my VRML
scenes, not only in their download time but also in their rendering
speed, was to use primitives (boxes, cylinders, cones, etc.) whenever
possible. However, lately I'm finding out that this isn't actually the
case, at least with rendering speed: for example, if I have a scene
with several (say 20) spheres, all of them created using primitives,
my browser navigates through it more slowly than what I think that it
should be, considering that all of them are created using Sphere
instead of, say, IndexedFaceSet.
        Can anyone provide some light into this? How do the different
browsers represent internally the geometry of the scene, and
specifically the primitives? If I use 20 sphere primitives as in the
above example, am I actually wasting 800 (40 * 20) polygons only in
that part of the scene, of am I saving more space than if I used other
alternatives? Could I speed up rendering if I represented the spheres
with a highly optimized IndexedFaceSet (using the creaseAngle field to
make them look smooth instead of "polygonal"), instead of the
primitives? But in that case, isn't there a tradeoff between
downloading speed (achieved using primitives) and rendering speed?

                                Paulo (a bit confused)



Sat, 22 Apr 2000 03:00:00 GMT  
 Optimizing scenes: use primitives or not?

Quote:

> Hi all:

>         I had always thought that a good way to optimize my VRML
> scenes, not only in their download time but also in their rendering
> speed, was to use primitives (boxes, cylinders, cones, etc.) whenever
> possible. However, lately I'm finding out that this isn't actually the
> case, at least with rendering speed: for example, if I have a scene
> with several (say 20) spheres, all of them created using primitives,
> my browser navigates through it more slowly than what I think that it
> should be, considering that all of them are created using Sphere
> instead of, say, IndexedFaceSet.
>         Can anyone provide some light into this? How do the different
> browsers represent internally the geometry of the scene, and
> specifically the primitives? If I use 20 sphere primitives as in the
> above example, am I actually wasting 800 (40 * 20) polygons only in
> that part of the scene, of am I saving more space than if I used other
> alternatives? Could I speed up rendering if I represented the spheres
> with a highly optimized IndexedFaceSet (using the creaseAngle field to
> make them look smooth instead of "polygonal"), instead of the
> primitives? But in that case, isn't there a tradeoff between
> downloading speed (achieved using primitives) and rendering speed?

>                                 Paulo (a bit confused)

Send primitives, and you're at the mercy of the person who wrote the
browser.
I don't recall the spec saying anything about how many faces or what
kind of
rendering to use on primitives.  In theory, they could raycast every
point on the sphere and bring the world to a grinding halt, although no
sane browser implementer would do such a thing.

Use IndexedFaceSet and *you* have control.  In order to minimize
bandwidth
you might want to experiment with a PROTO for a sphere made from an
IndexedFaceSet.
You would have to send the PROTO once for each world, but at least you
wouldn't have to send it once for each sphere.

--

check out my VRML software at: http://www.erols.com/stevemar

The World's Words Whirl, but the meanings stay the same.



Sun, 23 Apr 2000 03:00:00 GMT  
 Optimizing scenes: use primitives or not?

I can't comment on the question of how the browsers represent the
primitives - I simply don't know.  I ran into the same problem, and it does
appear that quite a few polygons are used in the sphere primitive.  I don't
know if this is appropriate for your scene, but I've solved the problem by
using pre-rendered spheres rather than the sphere primitive.

More specifically, I have billboard nodes, each with a single face as a
child.  Each of these faces has a GIF file depicting a sphere mapped onto
it.  This was adequate for my purposes, and the difference in rendering
speed was HUGE.

    -Adam Fass



Tue, 25 Apr 2000 03:00:00 GMT  
 Optimizing scenes: use primitives or not?

I'm not qualified to comment on how primitives are represented by browsers,
but I do have a solution for scenes with lots of spheres.  I had this
problem, and I decided to represent the spheres with bitmaps.

More specifically, I replaced all of my spheres with billboard nodes.  Each
of the billboards has a single face as a child, and all of these faces have
a GIF file depicting a sphere texture mapped onto them.  It looks great (the
sphere bitmap was ray-traced) and it made a HUGE difference in rendering
speed.  Just make sure that your GIF file has the background color marked as
transparent.

Hope this helps!

    -Adam Fass



Tue, 25 Apr 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. come to see my new VRML scene with text editor using only

2. Primitive failed in: EmSystemConfiguration>>#loadComponentPrimitive: due to Not enough memory

3. Software Technology is NOT Primitive

4. HW support for primitives (was Re:Graphics Primitives)

5. FKERNEL.F in Win32Forth is not optimized perfectly

6. post-optimizing inline assembly : why not !?

7. Tcl file handlers and WinSock, or not how to optimize things

8. Any compilers do not optimize this?

9. Using system() primitive with awk

10. About function middle using primitive recursion

11. User defined primitives using Borland C++

12. Optimizing programmer vs optimizing compiler (was: Re: Assembly vs c/c++)

 

 
Powered by phpBB® Forum Software