The QuadLOD Node for VRML

Overview

The QuadLOD node is an new node for VRML, implemented using VRML's EXTERNPROTO facility. It provides a specialised form of the built-in LOD node with a number of additional features. These features have been designed to improve the support in VRML for large, multi-resolution terrain grids.

The QuadLOD node switches the representation of a feature based upon its distance from the viewpoint. Only two levels of detail can be specified, however arbitarily deep hierarchies can be produced by nesting several QuadLOD nodes. The node works by displaying a single piece of geometry by default. Then when the viewpoint nears this geometry it is replaced by four alternative geometries. This is meant to represent a single low resolution terrain tile that is then subdivided into four higher resolution quadrants, e.g.

N.B. there is a new version of QuadLOD that supports tile caching and finer control over bounding boxes.

Specification

Currently, the EXTERNPROTO interface looks like this

EXTERNPROTO QuadLOD [
  field    MFString parentUrl 	    # the URL for the low resolution tile
  field    MFString child1Url 	    # the URL for high resolution tile no. 1
  field    MFString child2Url  	    # the URL for high resolution tile no. 2
  field    MFString child3Url  	    # the URL for high resolution tile no. 3
  field    MFString child4Url  	    # the URL for high resolution tile no. 4

  field    SFVec3f  parentCenter    # center of the low res tile's bounding box
  field    SFVec3f  parentSize 	    # size of the low res tile's bounding box
  field    SFVec3f  switchSize      # the size of the switch zone bounding box

  eventOut MFNode   children        # exposes the nodes built by this PROTO

  field    SFBool   enabled         # is the LOD node enabled (default = TRUE)
  eventIn  SFBool   set_enabled     # change the setting of enabled
  eventOut SFBool   enabled_changed # query the current enabled setting

] "QuadLOD.wrl#QuadLOD"

The QuadLOD node is a grouping node that specifies two different levels of detail of an object, such as a tile of terrain. The level of detail is switched depending upon the viewers relation to the bounding box with center at parentCenter and dimensions give by switchSize. When outside this bounding box, only the geometry for parent_url is displayed, but when the viewer enters the switch bounding box this geometry is replaced with the four geometries specified by child_url1 through child_url4.

The bounding boxes for each of the four children are calculated from the values of parentCenter and parentSize. This is done assuming a child layout ordering as given in the above figure, and assuming that the Z axis represents up (terrain height) - i.e. the parent bounding box is segmented into quarters over the X-Y plane.

The geometry for the four higher resolution tiles are only loaded into the memory when the user is within the switching volume. Similarly, these are unloaded from memory when the user is outwith this volume. Any tiles that are outside of the view frustum are removed from the scene graph (but not unloaded from memory), as long as you specify bounding box information.

The enabled field can be used to specify whether you want the QuadLOD node to be enabled (TRUE) or disabled (FALSE). A disabled QuadLOD node freezes the currently displayed nodes and performs no further switches of LOD (i.e. performs no further loading or unloading of data).

An example use of this EXTERNPROTO might be:

    QuadLOD {
      parent_url  "lores.wrl"
      child_url1  "hires1.wrl"
      child_url2  "hires2.wrl"
      child_url3  "hires3.wrl"
      child_url4  "hires4.wrl"
      parentSize  2 2 2
      switchSize  8 8 8
    }

Examples

Sources

The following sources and examples are made available to evaluate this new node:

Compatibility

This node does not work fully with CosmoPlayer 2.1 beta under Win95 (there is a browser bug that occurs when you try to nest QuadLOD nodes). It does work with version 2.0 and is expected to work fully with the final release of 2.1 for Win95.

Also, this node currently does not work with CosmoPlayer under IRIX because it does not support Java or JavaScript in the Script node, and the VrmlScript implementation is incomplete. JavaScript support is expected for CP 1.03 for IRIX, at which time this node should work for the SGI platform. WorldView compatability has not yet been evaluated.

Things To Do

This material is still under development. Here is a list of things that I intend to address in the near future. Please feel free to e-mail me (see below) if you have any further comments/suggestions.
  1. Can we only switch to next LOD when all four children have been loaded? We already do this, but we can only check when the inlined file has been completely loaded - if that file contains another inline that is loaded in a different thread (as Cosmo does), then we will switch too soon. What we need is some way to know when a file has completely loaded, including any nested inlined files.
  2. ProximitySensors don't fire when you re-enable them so if you disable the QuadLOD node, zoom in/out, and re-enable the node, then the scene is not updated for the current viewpoint. Need to look at faking this somehow.
  3. Provide eventIn/eventOut fields for all of the urls, so that they look more like exposedFields.
  4. Try to find out more about the ProximitySensor behaviour that requires a transparent Box geometry (with the same position and dimensions as the sensor) to be inserted into the group node (see the code for QuadLOD.wrl above).

See Also

  1. The Cached QuadLOD node.
  2. The VisibilityInline node.


Martin Reddy
Last modified: Tue Sep 15 15:51:12 PDT 1998