[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section details the steps that occur when a shader is compiled. The compilation process is started by the shaderdl
script. This script defines some variables and then gives control to slcdl
, which is responsible for calling other tools.
The first step is the preprocessing step. 3Delight has its own preprocessor (cppdl
) which does a work very similar to a standard C preprocessor. The preprocessor takes a SL program with #
-directives, processes the #
-directives and outputs a SL program without #
-directives.
Then comes the shading language translation step. If you elected to output byte-code shaders, slcdl
parses the SL file generated by the preprocessor and outputs byte-code in a text file. The file name is the name of the shader found in the SL file, followed by the `.sdl' extension.
If elected to output object-code shaders, slcdl
parse the SL file and output a C++ program, instead of byte-code. This C++ program is then compiled by a C++ compiler (that you must provide) and linked into a dynamic shared object (DSO) or a dynamic link library (DLL). The DSO or DLL file name is the name of the shader found in the SL file, followed by the `.sdl' extension.
When using a shader, there is no need to worry about whether the shader is in byte-code or object-code. 3Delight will guess this by itself.