#include <section>

Statement for including common shader code from the external code\default.fx file that is separated into different sections. This way functions or variable declaration shared by all shaders are placed in an external file. The file default.fx contains often-used shader variables and functions for lighting, fog, and transformations.

#include <filename.fx>

Statement for including code from an external file. The file name must end with ".fx" and contain the relative or absolute path to the file. A8.50

Type

statement

Remarks

You can copy the default.fx file into your work folder and modify it if desired. It is a customizable script. For defining a new section in the default.fx file, enter a section comment tag, like "//section: sectionname". The "#include <sectionname>" statement will then include this section in the shader code, up to the next section. The following include sections are currently available:

Examples for shaders with included sections can be found in the include\mtlFX.c file. Although the common code will make shader programming easier, understanding shader code is still required.

Example (shader code)

#include <transform>
#include <fog> ... out.Pos = DoTransform(in.Pos); out.Fog = DoFog(in.Pos);

See also:

MATERIAL, shaders, effect parameters

► latest version online