Laser 2.0 Raytracer
Introduction

Welcome to Laser! In the past two years, the Morgan Systems computer graphics research project code named "Laser" has touched on many areas of computer science beyond graphics -- including language design, parallel computing, networked computing, and human computer interaction. The major work and results have been released on the web through the Laser Homepage.

Laser 2.0 radically extends the Laser programming language. With it, we introduce the Laser 2.0 Raytracer (L2R), an internet based ray tracer supporting the new specification. While the L2R offers many advanced features as a ray tracer, it has many short comings as a professional graphics tool. The most significant contributions of the L2R and the Laser 2.0 language specification are to Computer Science research, not to the pool of excellent comercial renderers.

Laser 2.0 Language Features:

Laser 2.0 Raytracer Features:

The Laser programming language is based on the functional programming language, Scheme. Along with its syntax, basic API and language structure, Laser inherits proper tail recursion from Scheme and its predecessor, LISP. Properly tail recursive programing languages can execute tail recursive (functionally iterative) procedures in constant space. Many algorithms are less complicated to implement if a recursive rather than iterative approach is taken, so it is an ideal property for a language.

Environments (stack frames) and procedures in Laser are first class. They can be passed as arguments to functions, stored in data structures, and be the return value of a function call. This allows a higher degree of abstraction in programming, and allows Laser to function as a meta-language. Advanced concepts such as object oriented programming, delayed/lazy evaluation, multiple scope methods, and exception handling can be implemented using first class environments and procedures. Three new special forms are introduced in Laser 2.0 to handle first class environments.

Laser supports named arguments to functions. With named arguments, the order of arguments in a function call is not significant. While this adds convenience, the implied ability to support optional arguments provides the real power. Most of the Laser graphics primitives have named and optional arguments with defaults specified. The names of the named arguments are first class, providing even more flexibility. The syntax is backwards compatible with Scheme, and makes use of self generating procedures.

Unlike programming languages with restricted built-in types, like C, Laser provides powerful data types in the standard library. Linked lists, Hash tables, 3d Coordinates, Materials, and Symbols are just a few of the built in data types which allow easy manipulation of complex and high level data sets. All of the arithmetic functions are appropriately equiped to handle these complex data types.

Because one of the most difficult and confusing issues to handle in computer graphics is the nonlinearity of perceptual functions (Gamma, color balance), Laser provides functions which will simulate the perceptual effects of color, such as the procedure perceptual-intensity.

While Laser 2.0 has many advanced features as a theoretical language, it is also very useful as a computer graphics programming language. Unlike OpenInventor or VRML, Laser is a true programming language. Complex algorithmic shapes, animated behaviors (see the Laser 1.0 Virtual Reality Browser) and highly abstracted geometric concepts can be expressed in Laser code. Like the Henderson picture language which inspired the Scheme/LISP based approach, Laser code structure parallels object structure. The code physically resembles the abstraction structure of the scene it describes.

The Laser 2.0 Raytracer is runtime extensible. Users can create new primitive procedures by writing in Java (as opposed to creating new compound procedures by writing Laser code). In addition, users can create new visible graphics primitives, viewers, environments and lights which render as quickly and efficiently as the provided ones.

Laser extensions are written in Java, and compiled into .class files. These files can be runtime linked and treated as primitive procedures by Laser. The special syntax (lambda URL-String) creates a new primitive procedure from the code at the end of the URL. The Java code must extend the class laser.scheme.SchemePrimitiveProcedure. To create new graphics primitives, the procedure must return a new instance of a class which extends laser.lang.Graphics_primitive.

Because the Laser 2.0 Raytracer is provided in Java byte-code, it is platform independent. It was developed and tested under Windows NT 4.0, Macintosh System 7.5 and IRIX 5.3 using appletviewer and the Netscape web browser. This means that the L2R and any runtime extensions can be shared and run on any machine with an interpretter or hardware supporting the Java virtual machine. Platform independence is valuable in today's cross-platform computing environments, but is essential to running as an application across the internet and on the world wide web.

The Laser 2.0 Raytracer runs in three modes: Stand Alone, Master, and Slave. In Stand Alone mode, the program, like most raytracers, evaluates the scene description and renders the image using the local machine's processor. In Master/Slave configuration, however, a theoretically unbounded number of machines, running on any OS/hardware platform, anywhere on the internet, can all work together to render the same image. Because ray tracing is an almost perfectly parallel algorithm, the speedup is linearly proportional to the number of computers working on the task. This gives the L2R the potential to be one of the fastest ray tracing renderers available.

While not the most advanced effects renderer available, the L2R offers a number of rendering effects which can be hard to achieve in some packages. Dispersion, for example is not present in many professional renderers. In the L2R, the energy loss as light passes through a translucent medium is exponentially proportional to the distance traveled. This effect can be seen when looking at the colored shadow cast by a solid translucent object. The shadow is darkest where the light had to pass through the most material. Many ray tracers would draw the shadow in a constant intensity. The L2R can support the following effects and rendering features: Dispersion Modeling, Refraction, Reflection, Translucency, Environment Mapping, Texture/Bump Mapping, Shadows/Projective Gels, and Fog.

In conclusion, Laser 2.0 is a significant system for its contributions to cross-platform and networked software design, parallel processing, language design and computer graphics. It provides a meta-language and context for exploring new ideas in each of these fields, and allows interaction between them. The language specification and Laser 2.0 Raytracer are concrete results from ongoing work on the Laser project. We look forward to releasing a version of the Laser Virtual Reality Web Browser compatible with the new specification, and to observing the Laser runtime extensions and images which will undoubtedly be created by members of the internet community.


[Laser 2.0 Raytracer] [Laser 2.0 Documentation]


© 1996, Morgan McGuire ([email protected]) and Laura Wollstadt ([email protected])
All rights reserved.