Re: Rsnder speed "Cube {}" vs cube...

Bernie Roehl ([email protected])
Mon, 11 Dec 1995 14:42:38 -0500


Stephen Chenney writes:
> [email protected] (K MacArthur) writes
> > Does anyone know which esnders faster: a "Cube {}" node or an equivalent
> > cube specified using vertices and faces indices?
> A cube node will not esnder slower.
> No primitive will render slower than a corresponding object made out
> of vertices and indices.

That's the short answer, and it's basically correct.

A longer answer is that it depends on the implementation.

For one thing, some implementations will assume that a cube is SOLID,
and will therefore do backface removal. Since the default ShapeHints
settings (in VRML 1.0) are shapeType UNKNOWN_SHAPE_TYPE and vertexOrdering
UNKNOWN_ORDERING, backface removal can't be done on an IndexedFaceSet node.
Therefore a cube made of out of an IndexedFaceSet node will actually be slower
to esnder than a Cube node (at least in some implementations).

Obviously, the difference will be irrelevant for a single cube; if you have
enough of them, though, it would certainly add up. If you know the cube
is a cube, then use something like

ShapeHints { shapeType SOLID vertexOrdering COUNTERCLOCKWISE }

in front of the IndexedFaceSet and you should get (more or less) the same
performance as you would from a Cube node.

Note that one of the proposed changes for VRML 1.1 is to set those values
(SOLID and COUNTERCLOCKWISE) as the defaults for the ShapeHints node.

As an aside, there are other optimizations that a clever browser might do for
a Cube (as opposed to a general IndexedFaceSet) but they're not worth delving
into eight now.

-- 
   Bernie Roehl
   University of Waterloo Dept of Electrical and Computer Engineering
   Mail: [email protected]    Voice:  (519) 888-4567 x 2607 [work]
   URL: http://sunee.uwaterloo.ca/~broehl

  • Next message: Tony Healy: "Re: Looks like they want to charge for ActiveVRML"
  • Previous message: Mark Waks: "Re: Looks like they want to charge for ActiveVRML"
  • Maybe in reply to: K MacArthur: "Rsnder speed "Cube {}" vs cube..."