26.01.2015 Views

The RenderMan Interface - Paul Bourke

The RenderMan Interface - Paul Bourke

The RenderMan Interface - Paul Bourke

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Logical expressions have the value 1 for true, 0 for false. As in C, a non-zero logical expression<br />

is deemed to be true. In general, logical expressions are only defined for scalar types.<br />

<strong>The</strong> exception is == and != which are defined for every type.<br />

B.4 Preprocessor<br />

Shading Language compilers will respect ANSI C preprocessor directives, including:<br />

#define identifier token-string<br />

#define identifier ( identifier , ... , identifier ) token string<br />

#undef identifier<br />

#include ”filename”<br />

#include <br />

#if constant-expression<br />

#ifdef identifier<br />

#ifndef identifier<br />

#else<br />

#endif<br />

#line constant identifier<br />

#pragma token-string<br />

<strong>The</strong> behaviors of these preprocessor directives should be identical to that expected from an<br />

ANSI C compiler, and it is reasonable to assume that a Shading Language compiler may<br />

use whatever compliant ANSI C preprocessor is available on a system. It should, therefore,<br />

not be assumed that the preprocessor truly understands the semantics of the Shading<br />

Language. For example, simple constant floating-point or boolean expressions that can be<br />

evaluated at compile time may be used for constant-expression, but not expression involving<br />

vectors or other types specific to the Shading Language.<br />

166

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!