About
A InitRenderStruct element is used to initialize materials and shaders for rendering. It is typically created by Cinema 4D but it can be created on demand to sample materials or shaders. See Sampling a Shader .
Functionality
A InitRenderStruct element can be initiated and used with these functions:
if (irs.linear_workflow)
channelData.
d =
Vector { 1, 1, 1 };
channelData.
n =
Vector { 0, 1, 0 };
channelData.
vd =
nullptr ;
for (
Int32 y = 0; y < height; ++y)
{
for (
Int32 x = 0; x < width; ++x)
{
const Float64 u = xFloat / widthFloat;
const Float64 v = yFloat / heightFloat;
const Vector color = shader->Sample(&channelData);
}
}
shader->FreeRender();
Properties
The settings of InitRenderStruct are:
Further Reading
Int32 texflag
[READ ONLY] The texture flags: TEX
Definition: c4d_shader.h:965
Int32 SAFEINT32(Float32 x)
Definition: apibasemath.h:290
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:66
Float t
[READ ONLY] The current time in seconds.
Definition: c4d_shader.h:964
Vector p
[READ ONLY] The texture position in UVW coordinates.
Definition: c4d_shader.h:961
Float off
Definition: c4d_shader.h:967
Float Get(void) const
Definition: c4d_basetime.h:62
Definition: c4d_shader.h:176
Bool SetPixel(Int32 x, Int32 y, Int32 r, Int32 g, Int32 b)
Definition: c4d_basebitmap.h:689
Vector TransformColor(const Vector &input, COLORSPACETRANSFORMATION colortransformation)
INITRENDERRESULT
Definition: ge_prepass.h:389
Vector d
[READ ONLY] The MIP sample radius in UVW coordinates.
Definition: c4d_shader.h:963
maxon::Int32 Int32
Definition: ge_sys_math.h:45
Linear to sRGB color space transformation.
Vector n
[READ ONLY] The surface normal.
Definition: c4d_shader.h:962
Unstrided Clamp01() const
Returns a vector that is clamped to the range [0.0 .. 1.0].
Definition: vec.h:399
Int32 CALC_TEXINFO(Int32 texflag, Int32 channel)
Definition: c4d_shader.h:49
COLORSPACETRANSFORMATION
Definition: ge_prepass.h:477
Float scale
[READ ONLY] The MIP blur offset.
Definition: c4d_shader.h:967
VolumeData * vd
[READ ONLY] The volume information, can be nullptr.
Definition: c4d_shader.h:966
#define CHANNEL_COLOR
The color channel of a material.
Definition: c4d_shader.h:91
Everything is OK, there was no error.
Definition: c4d_shader.h:948
maxon::Float64 Float64
Definition: ge_sys_math.h:52