Functions | |
void | Define_Shader (char const *name, char const *options, char const *shader_source) |
void | Define_Shader_By_Key (HC_KEY key, char const *name, char const *options, char const *shader_source) |
void | UnDefine_Shader (char const *iname) |
void | UnDefine_Shader_By_Key (HC_KEY key, char const *iname) |
void Define_Shader | ( | char const * | name, | |
char const * | options, | |||
char const * | shader_source | |||
) |
Defines a section of code that will be injected into the HOOPS 3DF pixel shader.
name | - A name to associate with the shader code. | |
options | - A quoted string or a string variable containing a list of the desired option settings. | |
shader_source | - A section of shader code that be injected into the HOOPS pixel shader. |
Note that if your shader code uses hlsl specific calls, the driver type for your model at render time must be DX9 while shaders that use glsl specific calls will only work with OpenGL2.
All shader definitions are considered local to the current segment and below.
The options parameter to Define_Shader is a comma-separated list of settings which can include the following:
If set, any diffuse textures present in channels greater than 0 will be layered on top of the material properties that are specified in the shader. Normally, all diffuse texture input is assumed to be handled in the shader while remaining textures would be skipped. The default value is "no multitexture".
parameterization source = source
Like textures, shaders will require some form of parameterization source to be considered active. The possible settings are as described in the Define_Texture()'s description of parameterization source. The default value for this option is "world".
This option specifies where the shader code should be injected. Currently, "material" is the only acceptable value, but future versions, HOOPS may allow other stages of the pipeline to be overridden. The default value is, of course, "material".
The possible settings for this option are as described in the Define_Texture()'s description of transform.
void Define_Shader_By_Key | ( | HC_KEY | key, | |
char const * | name, | |||
char const * | options, | |||
char const * | shader_source | |||
) |
Similar to Define_Shader() but apply the shader code to the segment referenced by an HC_KEY.
key | - Unique numeric identifier to of the segment to apply the shader code. | |
name | - A name to associate with the shader code. | |
options | - A quoted string or a string variable containing a list of the desired option settings. | |
shader_source | - A section of shader code that be injected into the HOOPS pixel shader. |
void UnDefine_Shader | ( | char const * | iname | ) |
Removes the shader code associated with the passed name.
iname | - Simple name to be removed from the list of shaders. |
void UnDefine_Shader_By_Key | ( | HC_KEY | key, | |
char const * | iname | |||
) |
Removes the shader code associated with the passed name from the segment identified by the key.
key | - Unique numeric identifier to of the segment to remove the shader code. | |
iname | - Simple name to be removed from the list of shaders. |