HC_Compile_Shader
-
bool
HC_Compile_Shader(int key_count, Key const path_keys[], char const *options) - bool HC_Compile_Shader(int key_count, Key const path_keys, char const options)
Defines a section of code that will be injected into HOOPS 3DF shaders.
The geometry suboption needs to be the type of geometry which we want to see the shader for, optionally followed by a filter to limit generation to a particular set of primitives. For example, you could specify “geometry = (shell = triangles)” to get only the triangle shader for the shell, “geometry = (shell = (lines, points))” to get only the lines and points shaders for the shell, or “geometry = shell” to get triangle, lines, and points shaders for shells. The following is a list of geometry choices with the primitive types they may generate:
- “nurbs curve” - “lines”
- “elliptical arc” - “lines”
- “circular arc” - “lines”
- “line” - “lines”
- “polyline” - “lines”
- “polygon” - “triangles”, “lines”
- “circular chord” - “triangles”, “lines”
- “circular wedge” - “triangles”, “lines”
- “ellipse” - “triangles”, “lines”
- “circle” - “triangles”, “lines”
- “marker” - “points”
- “shell” - “triangles”, “lines”, “points”
- “mesh” - “triangles”, “lines”, “points”
- “cylinder” - “triangles”, “lines”
- “polycylinder” - “triangles”, “lines”
- “sphere” - “triangles”, “lines”
- “nurbs surface” - “triangles”, “lines”
- “text” - “triangles”, “lines”
- “grid” - “triangles”, “lines”, “points”
- “infinite line” - “lines”
- “image” - “triangles”
[all] stage [vertex | pixel]
The stage suboption will be either vertex or pixel if you wanted to restrict the shaders that are generated to a particular stage.
vertex format
The vertex format suboption can have the following options:
- “position” - [on | off]
- “double position” - [on | off]
- “normals” - [on | off]
- “diffuse” - [on | off]
- “specular” - [on | off]
Default activated options are : position, normals and diffuse.
HC_Show_Compilation_Results_Size, HC_Show_Compilation_ResultsParameters
key_count: The number of keys in the path
path_keys: An array of keys, from the target segment up to a driver. Also possible to pass a single segment key
options: A quoted string or a string variable containing a list of the desired options
Returns
true if it was able to find a custom shader on the given path for either the vertex or pixel shader and geometry, construct the shader source for any relevant primitive types, invoke the shader compile function, and the compilation is successful. Returns false otherwise.