Abstract. Shaders describe the appearance of a surface. The
creation of an efficient and quality shader requires some effort and is
often done iterative. Sometimes it is even important to fine tune
shaders in the display environment in which the shader is utilized.
Developing a shader in a compiled language, like C++, leads to
recompiling and restaring the system after changing the shader. This is
a time consuming process. Being able to change the shader online leads
to significant time savings. Scripting languages interpreted at run
time can be used to do interactive shader development. All shader
changes are visible the next frame and the workflow is not interrupted
for recompiling and restarting the system. Continuous working with the
model is achieved. Our ray tracing framework, written in C++, is
designed to support shader-scripts and it provides an interactive
interface to allow changes at run time. We decided to use
Python as the scripting language mainly because of its object
orientation and clear syntax. Other systems that support scripting are
Renderman for off-line global illumination calculations and CG for
local illumination on the graphics hardware.
[
project home page
|
contact authors
]
Example of a simple Phong-shader.
All objects from the module giAPI are extensions of the ray-tracing framework for Python.
This extension is needed to exchange data between C++ and Python.
import giAPI
import math
class phongMaterial: