Functions | |
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. More... | |
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. More... | |
void | UnDefine_Shader (char const *iname) |
Removes the shader code associated with the passed name. More... | |
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. More... | |
Detailed Description
Function Documentation
◆ Define_Shader()
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.
- Parameters
-
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.
- Supported Options:
- multitexture, parameterization source, stage transform
DETAILS
With Define_Shader, you can specify a section of code to be injected into the pixel shader instead of replacing the entire shader. The shader source can be a snippet of glsl or hlsl code that has access to lights, textures, and coordinates to use as inputs, and can override or modify values for material relating to colors and local surface normals.
Note that if your shader code uses hlsl specific calls, the driver type for your model at render time must be DX11 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.
- See also
◆ Define_Shader_By_Key()
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.
- Parameters
-
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.
DETAILS
No additional details. See Define_Shader().
◆ UnDefine_Shader()
void UnDefine_Shader | ( | char const * | iname | ) |
Removes the shader code associated with the passed name.
- Parameters
-
iname - Simple name to be removed from the list of shaders.
DETAILS
No additional details. See Define_Shader().
◆ UnDefine_Shader_By_Key()
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.
- Parameters
-
key - Unique numeric identifier to of the segment to remove the shader code. iname - Simple name to be removed from the list of shaders.
DETAILS
No additional details. See Define_Shader().