Skip to content
Raphael Paiva edited this page Jul 15, 2013 · 5 revisions

JTrace - A RayTrace Engine for Java

This project aims to create an extensible ray tracing Engine for the Java Programming Language.

JTrace is an open source project born from an academic assignment and is intended to be used as a library, providing basic ray tracing functionality, with the goal of helping in the understanding of the ray tracing technique.

This project has been used in assignments for the Computer Graphics course in the Computer Science program at Federal University of Rio de Janeiro. Implementation tasks ranged from optimization techniques (bounding boxes and octrees) to texture mapping and CSG rendering.

JTrace primary goal is to be extensible in the sense that most additional features can be implemented without interfering with the core library code.

Features

Mathematic Primitives

  • Point;
  • Vector;
  • Color;
  • Along with its operations.

Geometry Primitives

  • Sphere;
  • Plane;
  • Triangle;
  • Quadrilateral.

Camera

  • Extensible Camera model: easy to create new camera types;
  • JTrace provides some out of the box cameras:
    • Pin hole Camera;
    • Orthogonal Camera;

Light

  • Colored Point light.

Shadows

  • Hard shadows.

Illumination

  • Direct Illumination.

Shading

  • Pluggable and extensible Shader model: just add pre-made or custom shaders to the Tracer;
  • JTrace provides some out of the box shaders:
    • Ambient Shader
    • Diffuse Shader
    • Specular Shader

Materials

  • Colored materials with Diffuse, Ambient and specular coefficients;
  • Texturized materials.

Tracer Listener Model

  • All external interaction is done by listeners, such as:
    • Image file writing;
    • On screen Plotting;
    • Time tracking.
  • JTrace provides the following out of the box listeners:
    • Time listener;
    • Image listener;
    • Swing listener.

Optimization

  • Multi-threading;
    • Via MultiThreadTracer;

IO

  • Triangle meshes:
    • Support to ply file loading.

Work in Progress

Scene IO

  • Scene description file in a custom YAML format
  • Needs to read/dump all scene components;
    • Currently only mathematic primitives are readable/writable;

Future work (TODO)

Geometry Primitives

  • Disk;
  • Generic open Cylinder;
  • Generic Torus.

Object

  • Composite objects;

Light

  • Spot Light;

Material

  • Reflexive and Refractive materials;

Tracer

  • Recursion (Reflection);

Optimization

  • Intersection acceleration:
    • Bounding boxes;
    • KD-Tree;

General Assumptions

World Axes Orientation

  • X Axis grows from left to right of the screen;
  • Y Axis grows from the bottom to the top of the screen;
  • Z Axis grows from the inside to the outside of the screen.

References