[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.1 Writing Shaders

Some shader examples can be found in the `shaders/src' directory. If you need a tutorial on how to write shaders you should read the following classics:

Since each renderer has its own implementation of the shading language, shaders writers may want to isolate compiler specific code. shaderdl predefines the preprocessor symbol DELIGHT in order to make this possbile.

 
#if defined(DELIGHT)
print("Compiled with 3Delight\n");
#elif defined(RDC) 
print("Compiled with RenderDotC\n"); 
#elif defined(BMRT) 
print("Compiled with Blue Moon Rendering Tools\n");
#else 
print("yet another rman renderer\n");
#endif

Do not forget that before using a shader in 3Delight, one must compile it using 3Delight shader compiler, shaderdl. See section 3.2 Using the Shader Compiler - shaderdl for details on this.



This document was generated by Aghiles Kheffache on July, 31 2003 using texi2html
3Delight 1.0.0. Copyright 2000-2003 The 3Delight Team. All Rights Reserved.