#include <c4d_shaderdata.h>
A data class for creating shader (channel shader) plugins.
Shader plugins appear in the popup menu of the channels in the Material Manager.
Use RegisterShaderPlugin() to register a scene hook plugin.
Here are some general comments on the shader API:
Draw | |
virtual Bool | Draw (BaseShader *sh, BaseObject *op, BaseTag *tag, BaseDraw *bd, BaseDrawHelp *bh) |
Init/Free Render | |
virtual INITRENDERRESULT | InitRender (BaseShader *sh, const InitRenderStruct &irs) |
virtual void | FreeRender (BaseShader *sh) |
Output | |
virtual Vector | Output (BaseShader *sh, ChannelData *cd) |
Miscellaneous | |
virtual SHADERINFO | GetRenderInfo (BaseShader *sh) |
virtual BaseShader * | GetSubsurfaceShader (BaseShader *sh, Float &bestmpl) |
OpenGl Mode | |
virtual UInt32 | GlMessageDummy (BaseShader *sh, Int32 type, void *msgdata) |
virtual Int32 | InitGLImage (BaseShader *sh, BaseDocument *doc, BaseThread *th, BaseBitmap *bmp, Bool alpha, Int32 doccolorspace, Bool linearworkflow) |
virtual void | DestroyGLImage (BaseShader *sh, BaseDocument *doc) |
virtual void | InvalidateGLImage (BaseShader *sh, BaseDocument *doc) |
virtual Bool | GetGLImageSize (BaseShader *sh, BaseDocument *doc, Int32 s, Bool noScale, Int32 &w, Int32 &h) |
|
virtual |
Called to draw additional information for the shader in the editor's view.
[in] | sh | The BaseShader connected with the ShaderData instance. Equal to static_cast <ShaderData*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed shader. |
[in] | op | The active object. Cinema 4D owns the pointed object. |
[in] | tag | The active tag. The caller owns the pointed tag. |
[in] | bd | The editor's view. The caller owns the pointed view. |
[in] | bh | The helper for the editor's view. The caller owns the pointed base draw helper. |
|
virtual |
Called to initialize resources for the render.
[in] | sh | The BaseShader connected with the ShaderData instance. Equal to static_cast <ShaderData*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed shader. |
[in] | irs | A struct with information about the upcoming rendering. |
|
virtual |
Called to free any resources allocated in InitRender.
[in] | sh | The BaseShader connected with the ShaderData instance. Equal to static_cast <ShaderData*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed shader. |
|
virtual |
Called for each point of the visible surface of a shaded object to calculate and return the channel color for the point cd->p.
[in] | sh | The BaseShader connected with the ShaderData instance. Equal to static_cast <ShaderData*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed shader. |
[in] | cd | The channel data to use and/or modify. The caller owns the pointed channel data. |
|
virtual |
Called to get information about what the shader plugin requires from the render and what it will return.
[in] | sh | The BaseShader connected with the ShaderData instance. Equal to static_cast <ShaderData*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed shader. |
|
virtual |
Called to return the best SSS sub-shader for the shader.
[in] | sh | The BaseShader connected with the ShaderData instance. Equal to static_cast <ShaderData*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed shader. |
[in] | bestmpl | The current best (smallest) Median Path Length found so far. This value should never be changed by the code; it is auto adjusted only by the SSS shader and should be passed directly to the subshaders (see example code above). |
|
virtual |
To ensure SDK compatibility Private.
|
virtual |
Extended OpenGL mode. This mode is not documented. See c4d_gl.h for definitions.
|
virtual |
Extended OpenGL mode. This mode is not documented. See c4d_gl.h for definitions.
|
virtual |
Extended OpenGL mode. This mode is not documented. See c4d_gl.h for definitions.
|
virtual |
Called before the preview image for the shader is calculated.
[in] | sh | The BaseShader connected with the ShaderData instance. Equal to static_cast <ShaderData*>Get(). Provided for speed and convenience. Cinema 4D owns the pointed shader. |
[in] | doc | The host document of the shader. Cinema 4D owns the pointed document. |
[in] | s | The exponent of the maximum texture size chosen in the Preferences or the Material Editor tab. (2 ^ s = maximum preview size) |
[in] | noScale | true if the user has selected the "No Scaling" option in the material. |
[in] | w | Assign the width for the preview image. |
[in] | h | Assign the height for the preview image. |