运算节点

    运算节点。

    运算节点 的功能是执行数学运算。

    The inputs of the node are dynamic. Some inputs are only available in certain operations. For instance, the Addend input is only available in the Multiply Add operator.

    Input Value. Trigonometric functions read this value as radians.

    Addend

    Input Addend.

    Base

    Input Base.

    Exponent

    Input Exponent.

    Epsilon

    Input Epsilon.

    Distance

    Input Distance.

    Min

    Input Minimum.

    Max

    Input Maximum.

    Increment

    Input Increment.

    Scale

    Input Scale.

    Degrees

    Input Degrees.

    Radians

    Input Radians.

    操作

    The mathematical operator to be applied to the input values:

    • Functions

      Comparison

      • Minimum

        Outputs the smallest of the input values.

        Maximum

        Outputs the largest of two input values.

        Less Than

        Outputs 1.0 if the first value is smaller than the second value. Otherwise the output is 0.0.

        Greater Than

        Outputs 1.0 if the first value is larger than the second value. Otherwise the output is 0.0.

        Sign

        Extracts the sign of the input value. All positive numbers will output 1.0. All negative numbers will output -1.0. And 0.0 will output 0.0.

        Compare

        Outputs 1.0 if the difference between the two input values is less than or equal to Epsilon.

        Smooth Minimum

        .

        Smooth Maximum

        Smooth Maximum.

      Rounding

      • Round

        Round the input value to the nearest integer.

        Floor

        Rounds the input value down to the nearest integer.

        Ceil

        Rounds the input value up to the nearest integer.

        Truncate

        Outputs the integer part of the value.

        Fraction

        .

        Modulo

        Outputs the remainder once the first value is divided by the second value.

        Wrap

        Outputs a value between Min and Max based on the absolute difference between the input value and the nearest integer multiple of Max less than the value.

        Snap

        Round the input value to down to the nearest integer multiple of Increment.

        Ping-pong

        The output value is moved between 0.0 and the Scale based on the input value.

      Trigonometric

      • The Sine of the input value.

        Cosine

        The of the input value.

        Tangent

        The Tangent of the input value.

        Arcsine

        The of the input value.

        Arccosine

        The Arccosine of the input value.

        Arctangent

        The of the input value.

        Arctan2

        Outputs the Inverse Tangent of the first value divided by the second value measured in radians.

        Hyperbolic Sine

        The of the input value.

        Hyperbolic Cosine

        The Hyperbolic Cosine of the input value.

        Hyperbolic Tangent

        The of the input value.

      Conversion

      • To Radians

        Converts the input from degrees to radians.

        To Degrees

        Converts the input from radians to degrees.

    钳制

    Limits the output to the range (0.0 to 1.0). See clamp.

    数值输出。

    最大值与最小值功能举例。

    此范例场景输入数据由 渲染层 节点提供,距离摄影机10BU左右有个矩形物体。在另一个渲染层节点底部的输入连接端口上连有一个覆盖视图左半部距离摄影机7BU单位的平面。两个渲染层节点通过映射值节点分离Z缓冲区(Z深度)为20(乘以0.5,输入框如图所示)并且最小值/最大值的范围限分别限定在 0.0/1.0。

    “使用最小值”功能是依据靠近摄影机的像素将Z深度值选择出来;也可以选择矩形部分的平面Z深度值。背景有个初始的Z深度值,值限定为1.0(显示为白色)。在“使用最大值”范例中,矩形的Z深度值比图像平面要大,因此更靠近左侧,但是图像平面(FlyCam)渲染层Z值初始在右侧(对应于1.0),因此他们被选择。

    ../../../_images/compositing_types_converter_math_sine.png

    使用正弦功能举例。

    This example has a Time node putting out a linear sequence from 0 to 1 over the course of 101 frames. At frame 25, the output value is 0.25. That value is multiplied by 2 × pi (6.28) and converted to 1.0 by the Sine function, since \(sin(2 × pi/ 4) = sin(pi/ 2) = +1.0\).

    因为正弦函数将数值输出限定在(-1.0 to 1.0)之间, 映射值 节点比例缩放原取值范围 (-1 to 1)到 0.0 到1.0,将极值通过offset(偏移量)选项加1操作(结果范围为 0 to 2),,将结果和size(尺寸)选项中0.5进行相乘运算(缩放输出范围在0-1范围之间)。 颜色渐变 默认将输出值转为灰度范围。因此用中性灰用数值0来表示,黑色和白色分别用正弦值-1和1来表示。由此得到数学公式表示形式 \(sin(pi/ 2) = 1.0\)。这就像有了用户自己的输出视觉颜色计算器,将这一系列前后相连的节点进行动画就得到了周期往复不断循环的灰度颜色范围序列。

    将这个功能引申,比如,图片的alpha通道形成渐入/渐出特效。改变Z深度通道的景深位置。改变颜色通道值使其有规律的进行色彩变化。

    比例缩放单一通道范例。

    范例中有一个 运算(相乘) 节点增加图像的亮度通道(Y)使其颜色变得更亮。使用 映射值 节点的 “使用最小值” 和 “使用最大值”复选框来限定颜色的输出值在合理的区间范围之内。用这个方法,用户可以在高动态范围图像(HDRI)上应用对数函数。在这个特定范例中,使用一个 亮度/对比度 节点 对亮度进行简单控制。

    ../../../_images/compositing_types_converter_math_posterization.png

    色调分离范例。

    此范例中,我们重新限定颜色值为以下数值中之一:0, 0.2, 0.4, 0.6, 0.8, 1。

    拆分一段连续数字范围,将其转换为特定常量值,用数学公式表示为:\(round(x × n - 0.5) / (n - 1)\),参数n表示将要输出的值具体个数,参数x表示输入的颜色像素值。.

    就彩色图像而言,用户需要使用 分离RGBA 节点分离RGB混合颜色值为单独的R,G,B颜色通道。