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;
}
}
Properties
The settings of InitRenderStruct are:
Further Reading
Int32 texflag
[READ ONLY] The texture flags: TEX
Definition: c4d_shader.h:969
constexpr Unstrided Clamp01() const
Returns a vector that is clamped to the range [0.0 .. 1.0].
Definition: vec.h:399
Int32 SAFEINT32(Float32 x)
Definition: apibasemath.h:266
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:66
Float t
[READ ONLY] The current time in seconds.
Definition: c4d_shader.h:968
Vector p
[READ ONLY] The texture position in UVW coordinates.
Definition: c4d_shader.h:965
Float off
Definition: c4d_shader.h:971
void FreeRender(void)
Frees all resources used by this shader that were allocated by calling InitRender().
Definition: c4d_basechannel.h:110
INITRENDERRESULT InitRender(const InitRenderStruct &is)
Definition: c4d_basechannel.h:105
Float Get(void) const
Definition: c4d_basetime.h:66
Definition: c4d_shader.h:179
BaseTime GetTime(void) const
Bool SetPixel(Int32 x, Int32 y, Int32 r, Int32 g, Int32 b)
Definition: c4d_basebitmap.h:704
Vector TransformColor(const Vector &input, COLORSPACETRANSFORMATION colortransformation)
INITRENDERRESULT
Definition: ge_prepass.h:395
Vector d
[READ ONLY] The MIP sample radius in UVW coordinates.
Definition: c4d_shader.h:967
maxon::Int32 Int32
Definition: ge_sys_math.h:58
@ LINEAR_TO_SRGB
Linear to sRGB color space transformation.
Vector n
[READ ONLY] The surface normal.
Definition: c4d_shader.h:966
Int32 CALC_TEXINFO(Int32 texflag, Int32 channel)
Definition: c4d_shader.h:52
COLORSPACETRANSFORMATION
Definition: ge_prepass.h:483
Float scale
[READ ONLY] The MIP blur offset.
Definition: c4d_shader.h:971
VolumeData * vd
[READ ONLY] The volume information, can be nullptr.
Definition: c4d_shader.h:970
Vector Sample(ChannelData *cd)
Definition: c4d_basechannel.h:123
#define CHANNEL_COLOR
The color channel of a material.
Definition: c4d_shader.h:94
@ OK
Everything is OK, there was no error.
Definition: c4d_shader.h:952
maxon::Float64 Float64
Definition: ge_sys_math.h:65