New in version R13.029.
A data class for creating shader (channel shader) plugins. Use RegisterShaderPlugin() to register the plugin. A registered shader will appear in the popup menu of the channels in the Materials Manager in CINEMA 4D.
Here are some general comments on the shader API:
- Coordinate Systems: if there is no further note all elements like points, normals etc. then they are always given in global coordinates.
- Angle Systems: all angle values are always given in radians. Use Deg (angle) for conversion if needed.
- Vectors: all normals and ray vectors must be normalized. Also, all normals and ray vectors you recieve from CINEMA 4D are normalized.
See also
Py-Fresnel plugin example.
Override - Precalculate any data for rendering.
Parameters: |
|
||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
long |
||||||||||
Returns: |
Result of the initialisation:
|
Override - Free any resources used for the precalculated data from InitRender().
Parameters: | sh (BaseShader) – The shader node connected with this instance. |
---|
Override - Called for each point of the visible surface of a shaded object. Here you should calculate and return the channel color for the point cd.p.
Important: No OS calls are allowed during this function. Doing so could cause a crash, since it can be called in a multi-processor context.
Parameters: |
|
---|---|
Return type: | |
Returns: |
The calculated color. |
New in version R13.029.
Set the exception color.
Parameters: | col (Vector <c4d.Vector>) – The exception color. |
---|