#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 GL_MESSAGE | GlMessage (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) |
Additional Inherited Members | |
![]() | |
NodeData () | |
GeListNode * | Get (void) const |
virtual Bool | Message (GeListNode *node, Int32 type, void *data) |
virtual void | GetBubbleHelp (GeListNode *node, maxon::String &str) |
virtual BaseDocument * | GetDocument (GeListNode *node) |
virtual Int32 | GetBranchInfo (GeListNode *node, BranchInfo *info, Int32 max, GETBRANCHINFO flags) |
virtual Bool | IsInstanceOf (const GeListNode *node, Int32 type) const |
virtual Bool | IsDocumentRelated (const GeListNode *node, Bool &docrelated) const |
virtual Bool | Init (GeListNode *node) |
virtual void | Free (GeListNode *node) |
virtual Bool | Read (GeListNode *node, HyperFile *hf, Int32 level) |
virtual Bool | Write (GeListNode *node, HyperFile *hf) |
virtual Bool | CopyTo (NodeData *dest, GeListNode *snode, GeListNode *dnode, COPYFLAGS flags, AliasTrans *trn) |
virtual Bool | GetDDescription (GeListNode *node, Description *description, DESCFLAGS_DESC &flags) |
virtual Bool | GetDParameter (GeListNode *node, const DescID &id, GeData &t_data, DESCFLAGS_GET &flags) |
virtual Bool | SetDParameter (GeListNode *node, const DescID &id, const GeData &t_data, DESCFLAGS_SET &flags) |
virtual Bool | GetDEnabling (GeListNode *node, const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc) |
virtual Bool | TranslateDescID (GeListNode *node, const DescID &id, DescID &res_id, C4DAtom *&res_at) |
![]() | |
BaseData () | |
virtual | ~BaseData (void) |
void | Destructor (void) |
![]() | |
GeListNode * | private_link |
|
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 |
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 |
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. |