PARC Python Animation, Rendering and Compositing
 
 
  Features   Installation   Examples   Reference   Download  

 
Features
ToDo List
Projects
Modules
Requirements
 
 

Click on this and other images to view at full size

This is set of Python C extensions allow for high quality animation, rendering and compositing. The system is designed to be an ideal learning environment demonstrating programming techniques for advanced rendering. The open source code is designed to be easy to understand without compromising efficiency (too much). A simple graphical user interface provides for algorithmic visualization and optimizes the program development cycle. Python scene description and shaders provide extensibility for the more technical animator. The system is ideally designed for generating procedural effects animations.

If you find any bugs, or would like to submit any picures or code modifications, please send me email.  

Features:

  • Python based scene description language
  • Programmable material, light, and geometry shaders written in Python
  • Stochastic ZBuffer renderer (REYES micropolygon style)
  • Platform independence with support for Linux, Windows, and OSX.
  • Motion blurred transforms and deforming geometry
  • Depth of field controls using real-world camera settings
  • Hierarchical materials for procedural texture mapping
  • Displacement mapping
  • Transparency
  • Interactive display and interruption of rendering
  • Deferred DAG-based image processing engine, only a few operations
  • Interactive display and interruption of rendering output
  • 2D TrueType, Type1, OpenType and other font rendering using FreeType2
  • Basic I/O operations for image class (PPM support)
  • Matrix and Vector extensions for Python
  • Camera formats including video d1 & ntsc and film 1.85, academy & scope
  • Reconstruction filters (gaussian, triangle, box) of arbitrary width
  • Pixel samples (supersamping rate)
  • Screen space driven tessellation of polygons
  • Proper gamma correction and dithering
  • Produces RGB, A, and depth images

 
 

ToDo List

This is the current list of development tasks:

  • Only quads work, need to add tris, points, curves, and subdivision surfaces
  • Basic shaders, spot, phong, sphere, teapot, etc.
  • Particle rendering
  • Shadows (Z-output, percentage closer filtering, implemented as a material?)
  • Interactive 3D visualization of the rendering algorithm
  • Filtering and anti-aliasing for texture lookups (du,dv region)
  • Geometry API rework (bboxes currently not implemented)
  • Light and Geometry bindings for projections
  • Stratified sampling for time, subpixel and lens positions via dsos?
  • Hierarchical ZBuffer occlusion culling
  • Curve library, curve bindings
  • A ton of matrix and vector library functions, number and sequence functions
  • More image file formats (tif, jpeg libraries come to mind)
  • Area operations for image processing engine (ie. fft, convolution, etc)
  • Robust handling of primitives that cross the camera plane

 
 

Here are some interesting projects:

Stratified Sampling

Implement a stratified sampling algorithm for choosing subpixel positions for visibility computations, motion blur interpolation times, and depth of field lense positions. Some candidate algorithms include n-rooks, halton, or Poisson disc. Compare the results against uniform random and non-random sampling by creating a set of sample scenes such as a fine toothed comb, slowly moving radial lines, fast moving objects, and so forth.

Shadow Algorithms

The basic shadow algorithm is a very basic percentage closer algorithm. Try to modify or rewrite the algorithm to add more accurate penumbra, or create more realistic controls such as a light radius, to work correctly with multiple shadow maps for point lights or detail maps for specific areas, add translucent shadows, or ray traced shadows.

Bokeh

Add probability sampling to the lens depth of field computations to simulate bokeh.

Geometric Primitive

Add a subdivision surface primitive to the geometry library. Or derive a new Geometry class and implement subdivision surfaces, read a new file format such as Wavefront's OBJ polygon format, add support for NURBS by converting them to Bezier patches

Material Shaders

Implement an advanced material shader. For example, a skin shader with multiple layers and Kubelka-Monk subtractive mixing, an anisotropic metal shader, multi-lobed phong models using measured reflectance data, etc.

Ray Tracing

Add support for ray traced reflections, or shadow maps.

Environment Maps

Write a set of scripts to generate the views for six faces of a cube that surround a given point and use these images as an environment map by deriving a new Material class that computes reflections and indexes into the appropriate image

Algorithm Visualization

Write a viewer that graphically visualizes part of the main rendering pipeline. For example, write a subpixel viewing tool that illustrates the sampling problem and visualizes the surfaces within the pixel to show how transparency is handled.

Texture Filtering

Implement a more advanced texture filtering operation, such as oriented eliptical filtering, scan conversion, or summed area tables.

Tone Operators

Write a 2D image filter that computes a global tone operator for the entire image and quantizes the floating point colors into 8bit or 16bit values. How should this work for a sequence of images?

Dithering

Writea 2D image filter that performs one of the many dithering algorithms, such as Floyd/Steinberg, or Error Diffusion, while quantizing the floating point data into 8-bits.

Modules

The PARC distribution consists of nine separate modules. The list.so module is a pure C library with no Python bindings. All of the other modules are Python C extensions except for the scene.py pure python module, which is reponsible for importing all of the other C extensions and providing convinience routines.

list.so

Simple C list library. A header is provided which is placed at the top of any structure to allow it to be part of a list. Basic functions for insertion, deletion, sorting, and so forth are provided.

matrix.so

A Python C extension containing basic 3D matrix and vector functions. A Vector and Matrix type is provided with typical functions including dot, cross, length, transformation, projection, and so forth.

image.so

The image module manages tile based images with basic input, output and manipulation options. Images are restricted to only store floating point red, green, blue, alpha or depth channels. Different bit depths (ie. 8 or 16 bit) are handled only on input and output. A file format systems provides for easy addition of new formats. Basic pixel set and get operations are provided with or without filtering.

ip.so

The image processing module, ip, contains a deferred execution image processing engine, extensions to support text rendering using the FreeType2 library, and a few other miscellaneous functions. The image engine is easily extensible and uses a pixel based pull model to compute only the minimally required regions and operations.

geometry.so

The geometry module provides basic Vertex and rendering primitives such as polygons, Bezier patches and subdivision meshes. Conventions also apply for setting bounding boxes and affine transformations. To support motion blur, the vertex type supports vertex deformations, and the affine matrices include motion information.

shader.so

The shader module provides the glue between the processing pipeline and the Python shaders. Provisions are made for parallel processing of shading calls and utility routines are provided to ease the shader writing task. A simple but powerful mechanism for passing arbitrary data between shaders makes texture mapping via hierarchical material shaders trivial.

zb.so

The top level ZBuffer module handles the primary 3D pipeline including the initiation of dicing, micropolygon scan conversion, displacement, transparency, motion blur, depth of field, and final reconstruction and image output.

scene.py

This module imports all necessary modules and provides convinience functions to simplify the scene description language.

tui.so

The TUI platform independent user interface toolkit with a Python binding for displaying images.

 

Requirements

The PARC code is standard ANSI C code and should be easily compiled under Unix using the GNU C compiler and the Python header files. The modules have been successfully tested with Python versions 1.5, and 2.1. You must download the Python source code (or at least the header files and precompiled library).

The current distribution contains precompiled binaries for Windows and Linux. The OSX port is nearly ready with only a few user interface details to finish up. The GUI is built using my tui user interface library. The distribution includes a separate image viewer executable that displays all formats supported by the system including flipbook animations. The user interface builder, tui_build, is also included, but it isn't ready for public use yet.

The TUI user interface library uses the platform specific user interface libraries for the widgets and OpenGL for the image and 3D viewers. Under Linux, the widgets are created using Xlib calls, under Windows, the Win32 library (no MFC) is used, and under OSX, the Carbon libraries are used. Please make sure that you have installed OpenGL and the GL Utility library (libGLU) or the interactive viewers won't work. If you don't already have OpenGL installed on your system, you can find more information at the main OpenGL site or at MESA, Brian Paul's free implementation of OpenGL.

Two dimensional font rendering relies on the FreeType library version 2.05 which can be downloaded from SourceForge

Under Windows, you will need to download the pthreads-win32 library since Microsoft has deemed, in its infinite wisdom, that supporting a standard is not good for business.