Effects & Shaders predefined variables

The following variables, vectors, matrices and textures are available within effect scripts and shaders. Please note that all names in the HLSL shader language are case sensitive. Writing them in a wrong case will not produce an error message by the shader compiler, but just cause the shader not to work.

Example

The built-in variables and textures are used in a shader definition this way:
		
// predefined code
	#include <transform>
	#include <sun>
	#include <lights>
	#include <fog>
	#include <normal>

// declare predefined textures	
	Texture entSkin1;
	Texture entSkin2;

// declare predefined variables
	float4 vecSkill41;
	float fAmbient;

// define samplers with predefined textures
	sampler sMaskTex = sampler_state { Texture = (entSkin1); };
	sampler sBaseTex = sampler_state { Texture = (entSkin2); };