CSE 557 Computer Graphics Grail

Fall 2005


Details on the Trace project debugging user interface

One of the useful tools we are providing with the Trace project is a debugging interface, which you can use to experiment with tracing individual paths through the scene and visualize exactly what is going on with your code. This is meant to be an introduction to the capabilities of this UI.

The first thing you should note is that the UI is already there and ready for you; you don't have to do anything to enable it. All you have to do is load a scene file and toggle the "Debugging display" check box to open the debugging window. Every time you call Scene::intersect, the ray and its intersection is cached so that it can be displayed. As long as you always use this method to cast rays, they will hence be displayed (including shadow rays, if you use this method in your shadow-handling code). The only thing you have to do is when you are creating the ray that will be traced, identify what kind of ray it is (the options are REFLECTION, REFRACTION, VISIBILITY, and SHADOW). The cache is cleared out at the top-level RayTracer::trace, so that when you view traced rays in the debugging window, only the ones for a particular pixel are shown.

This is what you will see when you enable the debugging view with the skeleton code. You will notice a number of features, each of which can be turned on or off using the "Display" menu:

Notice also that even though the skeleton code does not have Phong shading enabled, the debugging view does. This is, of course, because the debugging display uses OpenGL for all of its shading. This has a few connotations:

Now, as described above, you can easily move in and around the scene using the controls that you should be familiar with from Modeler. In order to get the full use of the debugging window, you should use the Rendered Image window to trace individual rays. Simply clicking on a pixel in the image window will cause the raytracer to trace rays through that pixel to the maximum depth specified by the depth slider. Additional tips:

Known issues

One problem you may encounter is that the camera code for the debugging view uses heuristics to determine what should be a good view of the scene. This seems to be correct for most reasonable scenes, but there may be scenes where you find that the heuristics fail and the scene itself starts out entirely out of the view frustrum. You should be able to maneuver it back in if this happens.

And if you try to open the debugging window without first loading a scene file, the program will crash. Just make sure you have a scene file loaded first.