Documentation/Shader library

From PixieWiki

Jump to: navigation, search


Pixie comes with a library that allows you to query a compiled shader for its parameter. SDR lib exports the following two functions:

TSdrShader *sdrGet(const char *);

void sdrDelete(TSdrShader *);

The first function is used to get the shader info i.e.: sdrGet("matte.sdr"). The second function can be used to free the structure returned be sdrGet. The structure TSdrShader contains the shader and parameter information. See the source code for "sdrinfo" for example usage.

The structure TSdrShader is defined as:

typedef struct TSdrParameter {
	char          *name;         // Name of the parameter
	ESdrType      type;          // Type of the parameter
	ESdrContainer container;     // Container class of the parameter
	int           numItems;      // Number of items (the number of items if an array, 1 otherwise)
	char          *space;        // The space that the default value is expressed in
	UDefaultVal   defaultValue;  // The default value
	struct TSdrParameter *next;  // The next parameter
} TSdrParameter;
Personal tools