#include <c4d_shader.h>
详细描述
The
InitRenderStruct
is usually filled by
Cinema 4D
and then passed to the shader or channel
InitRender()
.
However to evaluate a
BaseChannel
for own purposes then create an
InitRenderStruct
on the stack.
构造函数 & 析构函数文档编制
◆
InitRenderStruct()
[1/2]
Default constructor.
◆
InitRenderStruct()
[2/2]
Creates the structure accordingly to the passed document.
-
参数
-
[in]
|
t_doc
|
The document to initialize the structure. The caller owns the pointed document.
|
成员函数文档编制
◆
Init()
Initializes the structure accordingly to the passed document.
-
参数
-
[in]
|
t_doc
|
The document to initialize the structure. The caller owns the pointed document.
|
◆
GetThreadCount()
Int32
GetThreadCount
|
(
|
|
)
|
const
|
Retrieves the number of render threads.
-
返回
-
The number of render threads.
◆
TransformColor()
向量
TransformColor
|
(
|
const
向量
&
|
input
|
)
|
const
|
If linear workflow is enabled the passed color is transformed into the color profile specified by document_colorprofile.
-
参数
-
[in]
|
input
|
The color to transform.
|
-
返回
-
The transformed color.
Member Data Documentation
◆
version
The version of
Cinema 4D
.
◆
time
The current time.
◆
fps
The framerate.
◆
docpath
The path for the document.
◆
matname
The material name.
◆
errorlist
RootTextureString* errorlist
|
A private error list. Can be
nullptr
, always check.
◆
vd
The volume data. Can be
nullptr
, always check.
-
注意
-
When initializing an
InitRenderStruct
, if the following line is missing,
Cinema 4D
assumes that there will be only one render thread.
(Without
VolumeData
no multi-threaded calculation can be done.). Access to VolumeData::Sample() will then crash or overwrite memory.
Here is a safe initialization of
vd
:
irs.vd = render->GetInitialVolumeData(0);
-
警告
-
To accurately rebuild a host environment for shader, material or channel sampling all members that
VolumeData
offers need to be filled.
Any pointer that is not initialized can cause a crash. Members like
BaseVolumeData::recursion_data
,
BaseVolumeData::multipass
and
BaseVolumeData::intersection
can be set to
nullptr
.
◆
doc
The document to render. Can be
nullptr
, always check.
◆
thread
The current thread or
nullptr
for the main
Cinema 4D
thread.
◆
flags
The flags;
INITRENDERFLAG
.
◆
linear_workflow
Linear workflow enabled/disabled.
◆
document_colorprofile
Int32
document_colorprofile
|
The document color profile:
DOCUMENT_COLORPROFILE
.