open all | close all

Color Parameters


In Cinema 4D, the values of color-fields and other color-based parameters such as Ramps, are not fixed, but are interpreted differently based on the Linear Workflow and Input Color Profile options found in the Project Settings. While Redshift emulates the gamma correction behaviour of the built-in renderers with respect to these settings, we recommend keeping the Linear Workflow option checked, and selecting Linear as the input color profile setting particularly when working in conjuction with other DCCs. These two settings ensure that no color-correction applied, and color values are processed as is.

在 Cinema 4D 中,颜色字段和其他基于颜色的参数(如坡道)的值并不固定,而是根据项目设置中的线性工作流和输入颜色配置文件选项进行不同的解释。虽然 Redshift 模拟了内置渲染器在这些设置方面的伽玛校正行为,我们建议保持线性工作流选项检查,并选择线性作为输入颜色配置文件设置,特别是在与其他 DCCs 一起工作时。这两个设置确保不应用颜色校正,并且颜色值按原样处理。

Special Nodes


C4D Shader

4 d Shader

The C4D Shader node allows the use of Cinema 4D shaders in conjunction with RS Shaders. The built in Cinema 4D Shaders will be converted (Baked) into texture files, and then used typically with a RSTexture node for sampling the texture file. The C4D Shader is limited shaders that can be encoded into a 2D Texture, so other types of shaders (for example 3D shaders) are not supported.

该 C4D 着色器节点允许使用电影院4D 着色器结合 RS 着色器。内置的 Cinema 4D 着色器将被转换(烘烤)为纹理文件,然后通常与 RSTexture 节点一起使用以取样纹理文件。C4D 着色器是有限的着色器,可以编码为2D 纹理,因此不支持其他类型的着色器(例如3D 着色器)。

C4D Shader

4 d Shader

Using Xpresso Nodes in the ShaderGraph

在 ShaderGraph 中使用 Xpresso 节点

XPresso can perform calculations based on the scene and can be used to drive shader parameters. XPresso nodes can connect to RS Shader Nodes, but RS Shader Nodes cannot connect to XPresso nodes. XPresso is evaluated once per-frame and will apply to all the objects that use the material.

XPresso 可以根据场景进行计算,并可用于驱动着色器参数。XPresso 节点可以连接到 RS 着色节点,但 RS 着色节点不能连接到 XPresso 节点。XPresso 每帧计算一次,并将应用于所有使用该材质的对象。

Example: Distance Based Roughness

例如: 基于距离的粗糙度

So lets take a look at how we can use Xpresso, to change the Roughness based of the distance of objects inside of the ShaderGraph.

所以让我们来看看如何使用 Xpresso,来改变基于 shader graph 内部对象距离的粗糙度。

To start off we have a simple Redshift Sky setup, with an animated sphere moving towards a stationary sphere.


Animated Sphere


Now let's create a new RS Material and adjust some of the parameters. We will disable the diffuse and set the IOR to 0 to simulate a chrome material. Also let's go into the Advanced Tab, and check "Convert From Glossiness to Roughness". Then we will apply the new material to our Ball object.

现在让我们创建一个新的 RS 材料和调整一些参数。我们将禁用漫反射和设置 IOR 为0,以模拟铬材质。也让我们进入高级标签,并检查“转换从光泽度到粗糙度”。然后我们将应用新材料到我们的球对象。

Material Setup


Now let's open up our ShaderGraph and start setting up our XPresso. First we want to drag and drop our two objects into our ShaderGraph, this will automatically setup our object XPresso nodes. Next we want to expose our Global Positions for both objects as well.

现在让我们打开我们的 ShaderGraph 并开始设置 XPresso。首先,我们需要将两个对象拖放到 ShaderGraph 中,这将自动设置对象 XPresso 节点。接下来,我们还要为这两个对象暴露我们的全局位置。


Shader graph

Next lets bring in a Distance XPresso node and plug our objects into the inputs. This will calculate the distance between the two objects. Also let's bring in a Result node to actually see the distance value.

接下来,让我们引入一个 Distance XPresso 节点,并将对象插入到输入中。这将计算两个物体之间的距离。另外,让我们引入一个 Result 节点来实际查看距离值。

XPresso - Basic setup


Now we need to remap this value to work with our Roughness Value. So let's bring in a Range Mapper node and we want to set the input Upper value to our result number, 2027.208. We can now plug our output into the roughness input.

现在我们需要重新映射这个值,以使用我们的粗糙度值。因此,让我们引入一个范围映射器节点,并且我们希望将输入 Upper 值设置为结果编号2027.208。现在我们可以将输出插入粗糙度输入。

XPresso - Remapping values

XPresso-Remapping values

We can now hide our Origin Sphere, and scrub through our timeline. As you can see the closer we get to our Origin sphere, the rougher our material will get.


Distance Based Roughness