MoGraph
Redshift provides extensive integration with Cinema 4D's MoGraph tools. Generic object attributes as well as MoGraph clone attributes can be accessed in the ShaderGraph through User Data nodes. When combined with Redshift's powerful shading nodes, unique shading effects,as well as per-object shading variations can be implemented in a simple, logical way. Furthemore, Cinema 4D's Render Instances, are converted to Redshift's native instances, which permit rendering a large number of clones with minimal rendering overhead.
提供了与 Cinema 4 d 的 MoGraph 工具的广泛集成。通用对象属性和 MoGraph 克隆属性可以通过用户数据节点在 ShaderGraph 中访问。当结合红移的强大的阴影节点,独特的阴影效果,以及每个对象的阴影变化,可以实现在一个简单的,合乎逻辑的方式。此外,Cinema 4 d 的渲染实例被转换为红移的本地实例,这允许以最小的渲染开销渲染大量的克隆。
Basic Workflow
基本工作流程
Let's take a look at how to set up some random colors for a MoGraph Cloner object, using a Random effector to drive clone attributes. After that we'll use Redshift's User Data nodes to access this information in the Shader Graph through.
让我们看看如何为 MoGraph Cloner 对象设置一些随机颜色,使用随机效应器驱动克隆属性。之后,我们将使用 Redshift 的用户数据节点通过访问着色图中的此信息。
First of all let's create a basic cloner object with a sphere to demonstrate the basic workflow between MoGraph and Redshift.
首先,让我们创建一个球面的基本 cloner 对象来演示 MoGraph 和 Redshift 之间的基本工作流。
Cloner Object
克隆对象
Next we want to apply a Random Effector to our Cloner enable the color mode. We also disable the position parameter, because we only want to effect our colors. We now have a random color value assigned to each of the spheres from our cloner object, as seen in the viewport. We also want to make sure the Min/Max values of our random effector is set to 0 - 100%, so that we don't have any negative color values.
接下来,我们要应用一个随机效应器到我们的克隆启用颜色模式。我们还禁用了位置参数,因为我们只想影响我们的颜色。我们现在有一个随机的颜色值分配给每个球从我们的克隆对象,如视口看到。我们还要确保我们的随机效应器的最小/最大值设置为0-100% ,以便我们没有任何负的颜色值。
Random Effector
随机效应器
Lastly we want to apply a default RS Material to our cloner and set up a User Data node to read our clone data. Let's open up the Shader Graph Edtior and Renderview, drag in a Color User Data node and connect it to our diffuse channel of our material. We want to set our Attribute name, to one of the predefined options under the MoGraph sub-menu, to Color. Which in turn is RSMGColor, used specifically to retrieve the color of a clone. Our clones are now taking on the color driven by the Random effector.
最后,我们想应用一个默认的 RS 材料到我们的克隆,并设置一个用户数据节点读取我们的克隆数据。让我们打开着色器图形编辑器和 Renderview,拖动一个颜色用户数据节点,并连接到我们的材质漫反射通道。我们希望将属性名设置为 MoGraph 子菜单下的预定义选项之一,即 Color。它又是 RSMGColor,专门用于检索克隆的颜色。我们的克隆现在正在采取的随机效应驱动的颜色。
To find out more about the supported User Data attributes, please consult the User Data Reference section.
要了解更多关于支持的用户数据属性,请参阅用户数据参考部分。
Color User Data
彩色用户数据
We can also change the seed of our random effector to produce various colors. We can combine that with Redshift's Color Correct node, to shift the Hue of our colors as well.
我们也可以改变随机效应器的种子来产生各种颜色。我们可以结合红移的颜色校正节点,以改变我们的颜色色相以及。
Random Effector
随机效应器
Material Variations and Per-Object Shading
材质变化与每个物体的阴影
Typically a single material produces identical visual results when applied to distinct objects. In these cases we can achieve per-object shading through the use of alternative UVs, Weight-Maps, Vertex Colors or other per-vertex data. While Redshift supports such workflows, it also offers a number special User Data nodes which can access built-in or custom,per-object attributes and parameters in the Shader Graph, as well as Switch nodes which can be used to divert the shading of an object. We can combine these two types of nodes to create multiple shading variations from a single, common material graph.This is especially useful with MoGraph clones, and so Redshift offers all of the clone attributes through User Data. This allows us to recreate most of the Cinema 4D's Multi-Shader or Variation-Shader workflows right in the Shader Graph.
通常一种材料应用于不同的物体时,会产生相同的视觉效果。在这些情况下,我们可以实现每个对象的阴影通过使用替代 uv,权重地图,顶点颜色或其他每顶点数据。虽然 Redshift 支持这样的工作流,但它也提供了一些特殊的用户数据节点,可以访问着色图中的内置或自定义的、每个对象的属性和参数,以及 Switch 节点,可以用来转移对象的阴影。我们可以将这两种类型的节点组合起来,从一个普通的材质图形中创建多个阴影变体。这对 MoGraph 的克隆特别有用,因此 Redshift 通过用户数据提供了所有的克隆属性。这允许我们重新创建大多数的电影4D 的多着色器或变化着色器工作流程的权利着色器图。
To find out more about the supported User Data attributes, please consult the User Data Reference section.
要了解更多关于支持的用户数据属性,请参阅用户数据参考部分。
Using Object Attributes
使用对象属性
Let's take a look at how we can use a RS Color UserData node to drive the color of individual parts of our model from a single shader.
让我们看看如何使用 RS Color UserData 节点从单个着色器驱动模型各个部分的颜色。
First, let's apply a new Redshift material to our model and open up the RenderView and the ShaderGraph Editor. We want to drive our diffuse color from the Display color of each object. So we bring in a RS Color UserData node and connect it into the Diffuse Color input of the RSMaterial node.
首先,让我们将一个新的红移材质应用到我们的模型中,并打开 RenderView 和 ShaderGraph 编辑器。我们希望驱动漫反射颜色从每个对象的显示颜色。因此我们引入了一个 RS Color UserData 节点,并将其连接到 RSMaterial 节点的漫反射颜色输入中。
Color UserData
颜色/用户数据
Next we need to set the attribute name in the Color User Data node. We can use the attribute preset menu by selecting the Objects category and then Display Color option. Now the color we have assigned to each object will be coming through our RS material. There are a few other options such as Object Color and Layer Color in the Objects category. For more details see the User Data Reference section.
接下来,我们需要在 Color User Data 节点中设置属性名。我们可以使用属性预置菜单选择对象类别,然后显示颜色选项。现在我们已经分配给每个对象的颜色将通过我们的 RS 材料。还有一些其他的选项,如对象颜色和图层颜色的对象类别。有关详细信息,请参阅用户数据参考部分。
Display Color
显示颜色
Using MoGraph Attributes
使用 MoGraph 属性
Let's take a look at how to use Mograph UserData to add randomization to our Cloner setup.
让我们来看看如何使用 Mograph UserData 为我们的 Cloner 设置添加随机化。
Here we have a basic collider setup of some objects and a floor, and a basic material setup with the Redshift logo applied to our object in the Layer 1 channel of the RS Color Layer node. First we want to add a Random Effector to our Cloner setup to apply a random color our clones. We can disable any other randomization options, but we also need to set our Min/Max to 0-100% because we don't want any negative colors. Lastly we want to enable the Color Mode.
在这里,我们有一些对象和地板的基本碰撞器设置,和一个基本的材质设置与红移标志应用到我们的对象在第一层通道的 RS 颜色层节点。首先,我们要添加一个随机效应器到我们的克隆设置应用一个随机颜色我们的克隆。我们可以禁用任何其他随机选项,但我们也需要设置我们的最小/最大值为0-100% ,因为我们不想要任何负面的颜色。最后,我们要启用颜色模式。
Mograph Setup
Now we want to relay the MoGraph clone information to Redshift through UserData. So let's open up our Shader Graph and bring in a Color User Data node and connect this to our Base color of our Color Layer node. In the UserData node's Attribute Name parameter we open the preset menu and choose te Color (RSMGColor) option under the MoGraph category. We are getting random per-clone colors. We can go back to our random effector and change the seed to get different colors.
现在我们希望通过 UserData 将 MoGraph 克隆信息传递给 Redshift。因此,让我们打开我们的着色器图形和带来一个颜色用户数据节点,并连接到我们的基本颜色层节点。在 UserData 节点的 Attribute Name 参数中,我们打开预设菜单并在 MoGraph 类别下选择 te Color (RSMGColor)选项。我们得到随机每克隆的颜色。我们可以回到我们的随机效应器,并改变种子得到不同的颜色。
Color UserData
颜色/用户数据
For further customization options we can insert a Color Correct node between the Color User Data and the Color Layer node. Now we can use the Color Correct node's Contrast and Hue Shift parameters to tint the incoming clone color.
对于进一步的自定义选项,我们可以在 Color User Data 和 Color Layer 节点之间插入 Color Correct 节点。现在我们可以使用颜色校正节点的对比度和色相移参数来着色传入的克隆色彩。
Color Correct
颜色校正
Now let'ss take a look at how we can take advantage of some of the other attributes. Let's use a Scalar User Data node to add some variation to our RS Material's roughness. We drag in a Scalar User Data node and use Geometry ID Normalized attribute from the Object category. This User Data generates a pseudo-random floating point number from zero to one. Let's connect this to Roughness material input, and take a closer look through a Specular Lighting AOV to see the effect clearly.
现在让我们来看看我们如何利用其他一些属性。让我们使用标量用户数据节点添加一些变化,我们的 RS 材质的粗糙度。我们拖动一个标量用户数据节点,并使用来自对象类别的几何 ID 标准化属性。这个用户数据生成一个从0到1的伪随机浮点数。让我们连接到粗糙的材质输入,并采取一个镜面照明 AOV 仔细看清楚的效果。
Note
注意
While the Geometry ID UserData varies per object, the underlying geometry is shared when Render Instances are used, and so all instances will share the same Geometry ID value
虽然 Geometry ID UserData 因对象而异,但在使用 Render Instances 时,底层的几何图形是共享的,因此所有实例将共享相同的 Geometry ID 值
Scalar UserData
Let's take a look at how we can work around this using a Mograph Attribute. First let's enable Render Instances on our Cloner object and go back to the Shader Graph. Instead of Geometry ID we will repurpose the MoGraph Weight attribute.
让我们看看如何使用 Mograph 属性来解决这个问题。首先让我们在 Cloner 对象上启用 Render Instances,然后回到着色图。我们将改用 MoGraph Weight 属性来代替几何 ID。
Scalar UserData
So we need to adjust the MoGraph attribute that corresponds to this User Data. In our Random Effector we want to set our Weight Transform to a value above zero. Now we are getting different roughness values for our objects even though they are Render Instances.
因此,我们需要调整 MoGraph 属性,它对应于这个用户数据。在我们的随机效应器,我们要设置我们的权重转换值以上零。现在我们得到不同的粗糙度值为我们的对象,即使他们是渲染实例。
Random Effector
随机效应器
Multi-Shader
多着色器
Let's take a look at how we can use a Shader Switch node to apply multiple material or textures to our clones.
让我们来看看如何使用着色开关节点将多种材质或纹理应用到我们的克隆。
In the following scene we have some falling keys, set up as Render Instances through a Cloner object. We'd like to apply a different alternating materials to them. To do this, first add Shader Switch node to our material's Shader Graph.
在下面的场景中,我们有一些掉落的键,通过 Cloner 对象设置为 Render Instances。我们想给他们用一种不同的交替材料。要做到这一点,首先添加着色开关节点到我们的材质的着色图。
Shader Switch
着色开关
Next we are going to set up the different sub-materials that we will use in our setup. We are going to add four RSMaterial nodes, set up with diffrerent presets (Plastic, Copper, Gold, and Lead). Then we connect these to the Shader Switch node inputs Shader 0 through 3. We also want to connect our Shader Switch to the output. At this point we see only the blue plastic material coming through because, we have not setup the Shader Switch Selector input, and so by default it always uses the first input (Shader 0).
接下来,我们将设置不同的子材料,我们将在我们的设置使用。我们将添加四个 RSMaterial 节点,并设置衍射预设(塑料、铜、金和铅)。然后我们连接这些到着色开关节点输入着色0到3。我们还要连接我们的着色开关输出。在这一点上,我们看到只有蓝色塑料材质通过,因为,我们没有设置着色开关选择器输入,所以默认情况下,它总是使用第一个输入(着色0)。
Shader Switch
着色开关
Now let's take a look at how to distribute these materials randomly throughout our cloned objects. First we bring in an Integer UserData and select the Object ID (RSMGID) preset under the MoGraph category. We also need to add an RS Mod node. This will be used to limit the range and wrap-around the MoGraph IDs from our user data. We want to set the Divisor parameter to the number of shaders we are going to switch between, which in this case is 4, that is shader inputs 0, 1, 2 and 3). Then connect we connect the output of the RS Mod node to Selector input of the RS Shader Switch node.
现在让我们看看如何在我们的克隆对象中随机分配这些材料。首先,我们引入一个 Integer UserData,并在 MoGraph 类别下选择 Object ID (RSMGID)预设。我们还需要添加一个 RS Mod 节点。这将用于限制范围和从我们的用户数据环绕 MoGraph id。我们希望将 divisorparameter 设置为我们要切换的着色器数量,在本例中是4,即着色器输入0、1、2和3)。然后将 RS Mod 节点的输出连接到 RS 着色开关节点的选择器输入。
Shader Switch
着色开关
User Data Reference
用户资料参考
Common UserData
通用用户数据
RSObjectColor
- Value: The raw object color 值: 原始对象颜色
- Type: Color 类型: 颜色
- Availability: All objects 可用性: 所有对象
RSDisplayColor
颜色
- Value: The object or layer color depending the Use Color option 值: 对象或图层颜色取决于使用颜色选项
- Type: Color 类型: 颜色
- Availability: All objects 可用性: 所有对象
RSLayerColor
- Value: The color of the layer that contains this object Value: 包含此对象的图层的颜色
- Type: Color 类型: 颜色
- Availability: All objects 可用性: 所有对象
RSGeomIDColor
基础色
- Value: A pseudo-random color potentially unique for each object in the scene. Instances share the same geometry, and so will have the same value 值: 场景中每个对象可能唯一的伪随机颜色。实例共享相同的几何图形,因此具有相同的值
- Type: Color 类型: 颜色
- Availability: All objects 可用性: 所有对象
RSGeomIDColorAlpha
地理色彩 alpha
- Value: A pseudo-random color and alpha, potentially unique for each object in the scene. Instances share the same geometry, and so will have the same value 值: 一个伪随机颜色和 alpha 值,可能是场景中每个对象的唯一值。实例共享相同的几何图形,因此具有相同的值
- Type: Color 类型: 颜色
- Availability: All objects 可用性: 所有对象
RSGeomIDNorm
地理标准
- Value: A pseudo-random number as a zero to one value, potentially unique for each object in the scene. Instances share the same geometry, and so will have the same value. 值: 一个伪随机数作为0到1的值,可能对场景中的每个对象都是唯一的。实例共享相同的几何图形,因此具有相同的值
- Type: Scalar (Float) 类型: Scalar (Float)
- Availability: All objects 可用性: 所有对象
RSObjectID
- Value: The ObjectID of the object, set through the RSObject tag Value: 通过 RSObject 标记设置的对象的 ObjectID
- Type: Integer 类型: Integer
- Availability: All objects 可用性: 所有对象
RSGeomID
地质标志
- Value: A pseudo-random integer value, potentially unique for each object in the scene. Instances share the same geometry, and so will have the same value. 值: 一个伪随机整数值,场景中的每个对象可能都是唯一的。实例共享相同的几何图形,因此具有相同的值
- Type: Integer 类型: Integer
- Availability: All objects 可用性: 所有对象
RSGeomIDAbs
地理信息系统
- Value: A pseudo-random positive integer value, potentially unique for each object in the scene. Instances share the same geometry, and so will have the same value. 值: 一个伪随机正整数值,场景中的每个对象可能唯一。实例共享相同的几何图形,因此具有相同的值
- Type: Integer 类型: Integer
- Availability: All objects 可用性: 所有对象
MoGraph UserData
用户数据
RSMGColor
- Value: The clone color 值: 克隆色
- Type: Color 类型: 颜色
- Availability: MoGraph Clones 可用性: MoGraph 克隆版
RSMGIDRatioColor
图片来源: RSMGIDRatioColor
- Value: The index ratio of the clone as a grayscale color 值: 作为灰度颜色的克隆的索引比率
- Type: Color 类型: 颜色
- Availability: MoGraph Clones 可用性: MoGraph 克隆版
RSMGIDNorm
标准
- Value: The clone index as a zero to one value 值: 克隆索引作为0到1的值
- Type: Scalar (Float) 类型: Scalar (Float)
- Availability: MoGraph Clones 可用性: MoGraph 克隆版
RSMGIDRatio
电子信息系统
- Value: The index ratio of the clone as a zero to one value 值: 克隆的索引比率为0比1
- Type: Scalar (Float) 类型: Scalar (Float)
- Availability: MoGraph Clones 可用性: MoGraph 克隆版
RSMGWeight
- Value: The MoGraph Weight attribute as a zero to one value 值: MoGraph Weight 属性作为零对一值
- Type: Scalar (Float) 类型: Scalar (Float)
- Availability: MoGraph Clones 可用性: MoGraph 克隆版
RSMGCloneOffset
偏移量
- Value: The MoGraph Clone Offset attribute as a zero to one value 值: MoGraph Clone Offset 属性作为一个0到1的值
- Type: Scalar (Float) 类型: Scalar (Float)
- Availability: MoGraph Clones 可用性: MoGraph 克隆版
RSMGTimeOffset
时间偏移
- Value: The MoGraph Time Offset attribute as a zero to one value Value: MoGraph Time Offset 属性为零对一值
- Type: Scalar (Float) 类型: Scalar (Float)
- Availability: MoGraph Clones 可用性: MoGraph 克隆版
RSMGFalloffWeight
重量
- Value: The MoGraph Falloff Weight attribute as a zero to one value 值: MoGraph Falloff Weight 属性作为一个0到1的值
- Type: Scalar (Float) 类型: Scalar (Float)
- Availability: MoGraph Clones 可用性: MoGraph 克隆版
RSMGID
- Value: The clone's index as an integer value. 值: 克隆的索引为整数值
- Type: Integer 类型: Integer
- Availability: MoGraph Clones 可用性: MoGraph 克隆版
RSMGAltID
- Value: The clone's alternative id 值: 克隆的替换 id
- Type: Integer 类型: Integer
- Availability: MoGraph Clones 可用性: MoGraph 克隆版
RSMGSize
- Value: The clone's size attribute 值: 克隆的 size 属性
- Type: Vector 类型: Vector
- Availability: MoGraph Clones 可用性: MoGraph 克隆版
RSMGUVW
- Value: The clone's UVW attribute 值: 克隆的 UVW 属性
- Type: Vector 类型: Vector
- Availability: MoGraph Clones 可用性: MoGraph 克隆版
赶快留个言打破零评论!~