Effects » DVE » Distortion » Regional zoom


Regional zoom
Author(s):
Release date: Dec. 4, 2018
Creation date: March 14, 2016
License: unknown

Lightworks user effect Regional zoom.fx

Regional zoom is designed to allow you to apply localised (focussed) distortion to a
region of the frame. Either zoom in or zoom out can be applied, the area covered can
be varied, and the amount of distortion can be adjusted. The edges of the image after
distortion can optionally be mirrored out to fill the frame.

Added subcategory for version 14, 18 Feb 2017 - jwrl.

Modified 7 April 2018 jwrl.
Added authorship and description information for GitHub, and reformatted the original
code to be consistent with other Lightworks user effects.

Update 4 December 2018 jwrl:
Added creation date.

Modified 10 December 2018 jwrl.
Changed category.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Parameters, which can be changed by the user in the effects settings.

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Inputs Samplers
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
For each 'texture' declared here, Lightworks adds a matching
input to your effect (so for a four input effect, you'd need
to delcare four textures and samplers)
/////////////////////////////////////////////
Definitions and declarations //
/////////////////////////////////////////////
Pixel Shader

This section defines the code which the GPU will
execute for every pixel in an output image.
XY Distance between the current position to the adjusted effect centering
Hypotenuse of xydistance, the shortest distance between the currently processed pixels to the center of the distortion.
Macro, Pick up the rendered variable ( "strengthCycle" (-1 to +1) , 16-bit color by using two 8-bit colors)
Creates the distortion
If the area = 1, then normal zoom works. Otherwise, a local zoom is active. "0.1" prevents a division by zero
Technique

Specifies the order of passes (we only have a single pass, so
there's not much to do)