Compare Node


The Compare node offers you the ability to use a logical comparison operator as a way to combine textures. The node takes four inputs. The first two inputs are the textures that will be compared. The second two inputs are the result of the comparison, only one of which is ultimately used.
Compare 节点提供了使用逻辑比较运算符作为组合纹理的方法的能力。该节点接受四个输入。前两个输入是将要比较的纹理。第二个输入是比较的结果,最终只使用其中一个。

Compare Node 【比较节点】 - 图1

HOW TO USE

如何使用
The pixel values of the two textures to be compared are taken as reference and the result depends on your chosen logic operator. Let’s look at the simplest example below:
两个纹理的像素值作为参考值进行比较,结果取决于您选择的逻辑运算符。让我们看看下面最简单的例子:

“IF A>=B” or “IF A<B”

As shown in the following example, if the input “A” is equal to or greater than the input “B”, the orange color is active. The important thing here is the numeric pixel value of the data in the Input channel. In the example, each pixel value of the input “A” is 194. So, if we assign an RGB spectrum node to “If A> = B”, the result is orange. If you go through this logic and change the locations of 2 input nodes, the result will be blue.
如下面的示例所示,如果输入“ a”等于或大于输入“ b”,则橙色为活动颜色。这里重要的是 Input 通道中数据的数值像素值。在示例中,输入“ a”的每个像素值为194。因此,如果我们给“ If a > = b”分配一个 RGB 光谱节点,结果是橙色的。如果使用这个逻辑并更改2个输入节点的位置,结果将是蓝色的。

Compare Node 【比较节点】 - 图2
Compare Node 【比较节点】 - 图3