Tcl3D Logo
Overview
Currently selected Documentation
Getting started
Modules
Resources
Tcl3D reference
OpenGL
OpenSceneGraph
rtVis explained
Applications
Demos
Downloads
History
Related links
Contact
Valid XHTML 1.0 Transitional

Documentation - rtVis explained

rtVis is a tool to visualize certain aspects of ray-tracing algorithms.
It can be used to easily instrument multi-threaded ray-tracers working with dynamic acceleration structures subdividing space in axis-aligned bounding boxes like Octrees, Kd-Trees or Bounding Volumes Hierarchies (BVH).
Download the script and an example here.

It currently supports the following features:

  • Display spawned rays: Primary rays coming from the camera, secondary rays (shadow and reflection rays).
  • Display rendered geometry in either filled or line mode.
  • Display lightsources as spheres in either filled or line mode.
  • Display hierarchy of one or more dynamic acceleration structures. The different hierarchies can be individually switched on or off.
  • Display the different patches rendered by the threads.
This table lists all available commands.

Examples

Octree visualization

This screenshot shows the first 3 levels of an Octree based subdivision.
Reflection rays are shown as yellow, shadow rays are shown as blue lines.

Top of page

Kd-Tree visualization

This screenshot shows all 24 levels of a Kd-Tree based subdivision.
The subdivision is based on an Surface Area Heuristics (SAH) algorithm.

Top of page

BVH visualization

This screenshot shows the first 3 levels of a BVH based subdivision.
Primary rays hitting an object and the two lightsources are shown as white lines.

Top of page

Patch visualization

This screenshot shows another scene with lightsources and geometry in filled mode.
The patches of the image rendered by the 4 threads are marked with coloured rectangles.

Top of page

Table of supported rtVis commands

Command Description
rtvisImageSize { width height } Announce the image size of the rendered image.
width and height specify the number of pixels of the image.
This command must be specified before any of the rtvisPixel commands.
rtvisPatch { thread xmin ymin xmax ymax } Specify the bounding box of the patch rendered by thread "thread".
rtvisPixel { thread x y } Announce the rendering of pixel (x, y) by thread "thread".
rtvisPixelValue { thread x y r g b a } Rendering of pixel (x, y) by thread "thread" results in color (r, g, b, a).
The color values must be specified as floats in the range of [0, 1].
rtvisRay { thread type org dir len } Announce a ray rendered by thread "thread" starting at origin "org" looking into direction "dir". The intersection point of the ray with an object is "len" units away from the origin.
The ray is of type "type":
Primary ray : 0
Reflected ray : 1
Shadow ray : 2
org and dir are 3D vectors supplied as Tcl lists.
rtvisLgtPoint { pos color radius castShadow } Announce a point lightsource located at position "pos" with radius "radius".
The lightsource emits light of color "color".
"castShadow" specifies, if this lightsource can cast shadows onto objects.
pos and color are 3D vectors supplied as Tcl lists.
The color values must be specified as floats in the range of [0, 1].
rtvisLgtSpot { pos dir color radius castShadow } Announce a spot lightsource located at position "pos" emitting into direction "dir".
The lightsource has radius "radius".
The lightsource emits light of color "color".
"castShadow" specifies, if this lightsource can cast shadows onto objects.
pos, dir and color are 3D vectors supplied as Tcl lists.
The color values must be specified as floats in the range of [0, 1].
rtvisTriangle { v1 v2 v3 { isStatic 1 } } Announce a geometry object of type triangle.
The vertices of the triangle are given with "v1", "v2" and "v3".
v1, v2, v3 are 3D vectors supplied as Tcl lists.
The optional parameter "isStatic" specifies, if the triangle belongs to the static world (1), or to the dynamic world (0).
rtvisAABB { level ll ur { asId "AS" } } Announce an AABB cell at level "level".
Note : Level numbering must start at 1 !
The lower-left and upper-right corner of the cell are given with "ll" and "ur".
ll and ur are 3D vectors supplied as Tcl lists.
If using multiple acceleration structures, an identifier can be specified as optional parameter "asId". This identifier can be any string.

Top of page