New in version R13.016.
Represents a shader in the shader tree of a channel.
Initialize a new BaseShader in memory.
Parameters: | type (int) – The shader type : Shader Types. |
---|---|
Return type: | BaseShader |
Returns: | The new shader. |
Calls ShaderData.Output() for the corresponding shader plugin. The channel color for the point cd.p is calculated.
Note
This has to be done within a pair of InitRender() / FreeRender() calls.
Parameters: | cd (ChannelData) – The channel data to use. |
---|---|
Return type: | Vector |
Returns: | The calculated color. |
This function allows you to calculate bump mapping for a shader (and its children) with the same algorithm as CINEMA 4D does. The function returns the delta vector that is added to the normal. The resulting normal is calculated by:
n_dst = !(n_src + SampleBump(SAMPLEBUMP_0)); // normalize result
where n_src is the original normal and n_dst is the bumped normal.
Note
This has to be done within a pair of InitRender() / FreeRender() calls. Also the BaseVolumeData.ddu and BaseVolumeData.ddv vectors have to be initialized. Use GetDUDV() or set them manually.
Parameters: |
|
||||
---|---|---|---|---|---|
Return type: | |||||
Returns: |
The delta normal. |
Returns the bitmap of shaders of type Xbitmap, otherwise None.
Note
This has to be done within a pair of InitRender() / FreeRender() calls.
Here is an example:
material = doc.GetFirstMaterial()
shader = material[c4d.MATERIAL_COLOR_SHADER]
irs = render.InitRenderStruct()
if shader.InitRender(irs)==c4d.INITRENDERRESULT_OK:
bitmap = shader.GetBitmap()
shader.FreeRender()
if bitmap is not None:
bitmaps.ShowBitmap(bitmap)
Return type: | BaseBitmap |
---|---|
Returns: | The bitmap. |
Note
The returned bitmap must be accessed as read-only.
Calls ShaderData.GetRenderInfo() for the corresponding shader plugin. This retrieves information about what the plugin requires from the raytracer and what it will return.
Return type: | int | ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns: |
The return values are:
|
Calls ShaderData.InitRender() for the corresponding shader plugin. You have to do this before you can use the Sample(), SampleBump() or GetBitmap() functions.
Note
Remember to call FreeRender() afterwards. You aren’t allowed to call InitRender() multiple times without calling FreeRender() in between, even from multiple threads!
Parameters: |
is (InitRenderStruct) –
New in version R13.029. Information about the upcoming rendering. |
||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | int | ||||||||||
Returns: |
Result of the initialisation:
|
Frees all resources used by this shader, allocated by calling InitRender().
It checks if color managment is disabled for shaders within bump, alpha, displacement or normal channels when linear workflow is enabled.
Parameters: | doc (BaseDocument) – The document containing the shader to check if linear workflow is disabled in it. |
---|---|
Return type: | bool |
Returns: | True if color managment is disabled, otherwise False. |
Checks if this shader is similar to dst.
Parameters: | dst (BaseShader) – The shader to compare to. |
---|---|
Return type: | bool |
Returns: | True if the plugin shaders are the same, otherwise False. |