HC_Set_Shader
-
void
HC_Set_Shader(char const *target, Key vertex_shader, Key pixel_shader) - void HC_Set_Shader(char const target, Key vertex_shader, Key pixel_shader)
Allows you to have the current segment drawn using a custom vertex and/or pixel shader.
The vertex and pixel shader Keys must be Keys to modern custom shader definitions that have been previously defined through calls to Define_Custom_Shader. It is not necessary to provide shaders for both the vertex and pixel stages of the pipeline. If you do not wish to provide a shader for a particular stage, HC_ERROR_KEY can be passed for that stage.
When a custom shader is set on a segment, the segment is drawn using the regular HOOPS shaders with your custom shader code injected into them. As such, you do not need to provide a complete shader program, but rather you can just read and modify the values computed by Visualize.
Custom shaders are attributes and as such they are inherited throughout the scene graph once set. It is possible to attribute lock custom shaders.
Parameters
target: The graphics primitives which the shaders will affect.
vertex_shader: A Key to a previously defined vertex shader.
pixel_shader: A Key to a previously defined pixel shader.