Docs Visual
ComplexMix
Combines two UV fields as complex numbers: add, subtract, multiply, divide or raise one to the other, optionally weighted by a third input, then samples an image through the result.
◧ Visual
Why use it
ComplexOp warps an image through one complex function. To get the sum of two such warps, their product, or one divided by the other, the arithmetic has to happen on the coordinates themselves, per pixel and as complex numbers, before the image is looked up. Compositing the two warped images does something else, so this takes a shader of its own.
ComplexMix is that step. Feed it the UV outputs of two ComplexOps, choose the operation, and the picture comes out warped by the combination. The combined coordinates also leave as a UV field, so you can keep chaining. The complex arithmetic is taken from Ricky Reusser's Shadertoy implementation, credited in the shader source.
Features
- Combine two UV fields as complex numbersTreats each pixel pair of two UV fields as complex numbers and adds, subtracts, multiplies, divides or raises one to the other.
- Weighting between the operandsFn Weight balances the two operands before they combine, so with Add one warp can morph into the other.
- Sample an image through the resultSamples the in1 image through the combined coordinates, so two ComplexOp warps become their sum, product or quotient.
- Transform the combined coordinatesMoves, rotates and scales the combined coordinates, with Aspect keeping rotation and scale round on a non-square output.
- Blend the effect inBlend fades from the plain image to the full combination; animate it to bring the warp in on a cue.
- Chain the combined UV fieldout2 outputs the combined UV field for chaining into another sampler.
How to use it
- Create it from the FNS tab of the OP Create dialog.
- Wire the image you want to see warped into in1.
- Make the two operands: two ComplexOps with different functions, their second outputs (the UV fields) wired into in2 (Op1) and in3 (Op2). The ComplexOps need no image of their own; with nothing wired in they work on a built-in UV map. Keep them on a float Pixel Format, or the coordinates are quantised.
- Choose the Operation. Op1 and Op2 pass one operand through on its own, which is the quickest way to check each warp. Add, Subtract, Multiply and Divide combine them, and the two power entries raise Op1 to Op2 or the other way round.
- To favour one operand, switch on Weighting and set Fn Weight: 0 is all Op1, 1 is all Op2. It is one value for the whole image. With Add, animating it morphs one warp into the other.
- Move the result with Trans, Rot, Scale and Pivot, in the order Transform Order sets. Switch on Aspect to keep rotation and scale round on a non-square output.
- Choose what shows where the coordinates leave the image with Extend: hold the edge, zero, repeat or mirror.
- Fade the effect with Blend: 0 is the plain image, 1 the full combination. Animate it to bring the warp in on a cue.
To keep going, take out2, the combined UV field, into another ComplexMix, a ComplexOp with Operand/Map off, or a Remap TOP.
Inputs and outputs
- in1 (TOP): the image that is sampled through the combined coordinates.
- in2 (TOP): the first complex operand (Op1), a UV map such as ComplexOp's second output.
- in3 (TOP): the second complex operand (Op2).
- out1 (TOP): the combined image.
- out2 (TOP): the combined UV field, for chaining into another sampler.
Get it
Tick it on the install page and it installs with the rest of your setup and stays up to date.
Download ComplexMix.tox Version 1.0.4, the tool on its own. It works in any project, and this copy never updates itself.
Parameters
Custom
| Control | Type / default | What it does |
|---|---|---|
OperationOperation |
menuAdd | How the two complex operands (input 2 = Op1, input 3 = Op2, read from their red/green channels) combine: either one alone, or complex add, subtract, multiply, divide or power. |
WeightingWeighting |
on / offoff | Scales Op1 by (1 - Fn Weight) and Op2 by Fn Weight before they combine. Not used by Op1 only / Op2 only. |
Fn WeightFnweight |
number0.5 | Balance between the operands when Weighting is on: 0 is all Op1, 1 is all Op2. |
AspectAspect |
on / offoff | Applies the transform in aspect-corrected space so rotation and scale stay round on non-square outputs. |
Transform OrderXord |
menuScale Rotate Translate | Order in which the transform applies scale, rotate and translate to the combined coordinates. |
TransMixtrans |
number0 | Moves the combined coordinates along x and y. |
RotRot |
number0 | Rotates the combined coordinates by this many degrees around the pivot. |
ScaleMixscale |
number1 | Scales the combined coordinates along x and y; larger values zoom in. |
PivotPivot |
number0 | Pivot (x, y): the point that rotation and scale happen around. |
ExtendMode |
menuMirror | How input 1 is sampled where the coordinates leave 0..1: Hold the edge pixels, Zero (transparent black), Repeat the image, or Mirror it. |
BlendBlend |
number1 | Mix between plain screen coordinates (0, input 1 unchanged) and the combined, transformed coordinates (1). |
Common
| Control | Type / default | What it does |
|---|---|---|
ResolutionResolutionread-only |
number1280 | Width and height of the built-in UV map used when nothing is wired into input 1. Disabled while input 1 is connected; the output then takes its resolution. |
Input SmoothnessInputfiltertype |
menuInterpolate Pixels | Filtering used when sampling the inputs. |
Viewer SmoothnessFiltertype |
menuInterpolate Pixels | Filtering used when the output is displayed at another resolution. |
Pixel FormatFormat |
menuUse Input | Pixel format of the outputs. Keep a float format when the UV output feeds another Complex tool or a Remap, or the coordinates are quantised. |