User Tools

Site Tools


This is an old revision of the document!


Binary Operation

Brickyard : Functions > Mathematical

A collection of mathematical operations that take 2 arguments. For mathematical operations that take 1 argument, see the Unary Operation brick.

Color operations are performed per color channel.

Snapshot

Parameters

Outputs

  • Binary Op Result : Variable - Description…

Inputs

Settings

  • Type : Sets the type of the Binary Op Result output parameter, as well as the Value and Value 2 input parameters to one of float, color, point, vector or normal.
  • Operation : Sets which binary operation to perform.
    • Add : Returns Value + Value 2
    • Subtract : Returns Value - Value 2
    • Multiply : Returns Value * Value 2
    • Divide : Returns Value / Value 21)
    • Min : Returns the lesser of Value and Value 2
    • Max : Returns the greater of Value and Value 2
    • Dot Product : Result = Value . Value 2
    • Cross Product : Result = Value ^ Value 2
    • Mod : Returns the remainder of Value / Value 2
    • Gain :
    • Step : Returns 0 if Value 2 < Value, otherwise 1
    • Smooth Step : Returns 0 if Value < 1, 1 if Value 2 > 1, and performs a smooth Hermite interpolation between 0 and 1 in the interval Value to Value 2
    • Filter Step : Returns an analytically antialiased version of Step
    • Pow : Returns ValueValue 2
    • Bias :

Examples

These examples show the result of a Binary Operation combining two test patterns, one with horizontal red stripes, the other with vertical blue stripes.

Add

Subtract

Multiply

Divide

1)
If Value 2 is 0, it is replaced by .0001 to prevent a divide by zero condition.