hendfiv balina blaize

0 views
Skip to first unread message

Tory Lattin

unread,
Aug 2, 2024, 10:36:44 PM8/2/24
to trosciataitril

The DCTL syntax is C-like with additional definitions. Users can define functions using DCTL code to create a video effect, save it to file, and run it in Resolve. Such an effect serves as a "pixel shader" program - i.e. it defines a process to generate one pixel of data at a time at each given frame's coordinates. DCTL code is GPU accelerated in DaVinci Resolve across different platforms and graphics sub-systems.

In Resolve, DCTL effects can be run as a color LUT, using the DCTL OFX plugin or the Transition Plugin. DCTL effects are commonly saved as a plain text .dctl files, but if needed, developers can further save an encrypted effect as a .dctle file for distribution. See Encryption under Types of DCTLs.

A Transition DCTL creates a scene transition, such as a dissolve blending between 2 clips (refer to DissolveTransition.dctl sample). Transition DCTLs can only be used in the OpenFX DCTL Transition Plugin (which is located in [ Resolve > Edit Page > OpenFX > Transition > ResolveFX Color > DCTL ]).The DCTL transition plugin is used in the same way as any other transition plugins (Resolve's Video Transitions, OpenFX transitions,...). After adding the plugin, users can select a DCTL file from the DCTL List and the corresponding transition effect will be applied.

In Resolve, users can encrypt a .dctl file with an expiry date to distribute an effect without revealing the content. The encrypted .dctle can be distributed and used normally in any of Resolve's systems until it expires.

To encrypt a DCTL: From the LUT browser, select the desired .dctl file, open context menu, choose "Encrypt DCTL" option. A helper dialog will appear for user to set name, expiration date and output folder for the encrypted DCTL. The encrypted DCTL will have a .dctle extension.

These qualifiers are usedDEVICE - qualifier to define a function.CONSTANT - qualifier to define a constant memory.CONSTANTREF - qualifier for a constant memory parameter passed to a function.

Each DCTL file must use a single main entry function called 'transform()' or 'transition()', with the function signatures shown below.NOTE: Use the function definition below exactly as-is - including parameter types and names.

Parameters:* p_Width and p_Height - the image resolution.* p_X and p_Y - the pixel coordinates where the transform function does the color transformation.* The (p_R, p_G, p_B) - input pixel's RGB values (in the first signature).* The (p_TexR, p_TexG, p_TexB) in the second signature - texture references to the RGB planes. The function can request the RGB values for any pixel from the image by calling _tex2D([textureVariable], [posX], [posY]), which returns a float value (posX and posY being the desired input pixel coordinates).

As the transition progresses, the DCTL logic selects the appropriate image from the 'From' and 'To' clips and calls this function for each blend request. The global read-only float variable 'TRANSITION_PROGRESS', ranging from 0 (transition about to start) to 1 (transition has ended), can be used from within the function to monitor the progress of the transition. See the "Other DCTL Keywords" section.

Parameters:* p_Width and p_Height - the output image resolution.* p_X and p_Y - output pixel coordinates where the blend results are stored.* (p_FromTexR, p_FromTexG, p_FromTexB) - RGB texture references for the 'From' clip's image at TRANSITION_PROGRESS.* (p_ToTexR, p_ToTexG, p_ToTexB) - RGB texture references for the 'From' clip's image at TRANSITION_PROGRESS.Similar to the second transform signature, the function can access RGB values for any pixel in the "From" and "To" textures using the _tex2D([textureVariable], [posX], [posY]) function.

Parameters:- The [LUT_Content] should be wrapped with curly brackets '' and needs to follow the CUBE LUT standard format.- These LUTs can be applied in the same way as a referenced LUT - using the APPLY_LUT function.

The following rules apply:- LUTs must be defined in the DCTL file before use.- Multiple LUTs can be defined and applied in a single DCTL.- Multiple CUBE LUTs can be defined in a DCTL file and can be placed before or after the DCTL's Main Entry function.- LUT files must be in .cube format, with 1D or 3D LUTs, with/without shaper LUTs.- 1D LUT/Shaper LUTs will be applied with LINEAR interpolation method.- 3D LUTs will be applied with TRILINEAR or TETRAHEDRAL interpolation, as set in Resolve with [ Project Settings > Color Management > 3D Lookup Table Interpolation ].

For Transition DCTLs, the TRANSITION_PROGRESS key holds the progress of the current transition state as a float value with range [0.0f, 1.0f]. During the transition, DaVinci Resolve updates the TRANSITION_PROGRESS value and calls the transition main entry function for each image. The DissolveTransition.dctl example illustrates how to use this key.

Custom DCTL effects (of the Transform DCTL type) can be added as plugins from Edit Page and Color Page effects libraries. To access them, double click or drag this plugin entry:- Edit page > Effects Library > OpenFX > Filters > ResolveFX Color > DCTL.- Color page > OpenFX > ResolveFX Color > DCTL.Once added, click the DCTL List combo box and select the desired DCTL effect to apply the effect.

To add new DCTL effects to this list, place the appropriate DCTL file in the DaVinci Resolve LUT directory.To edit a loaded DCTL effect,- navigate to the DaVinci Resolve LUT directory in a file browser.- load the appropriate DCTL file in a text editor to make changes.- Save the file.- In DaVinci Resolve's inspector, press "Reload DCTL" button to see the reflected result instantly.

DaVinci Resolve supports 5 types of UI elements. With the DEFINE_UI_PARAMS function, you can define custom controls for your DCTL plugins and link them to variables in the DCTL file.Float Slider: DEFINE_UI_PARAMS([variable name], [label], DCTLUI_SLIDER_FLOAT, [default value], [min value], [max value], [step])Int Slider: DEFINE_UI_PARAMS([variable name], [label], DCTLUI_SLIDER_INT, [default value], [min value], [max value], [step])Value Box: DEFINE_UI_PARAMS([variable name], [label], DCTLUI_VALUE_BOX, [default value])Check Box: DEFINE_UI_PARAMS([variable name], [label], DCTLUI_CHECK_BOX, [default value])Combo Box: DEFINE_UI_PARAMS([variable name], [label], DCTLUI_COMBO_BOX, [default value], [enum list], [enum label list])

Parameters:- The [variable name] is linked with the UI element. This variable can be used inside the transform function.- The [label] text appears alongside the control and describes the control to the user of the DCTL.- The third parameter - the ui element enum - allows DaVinci Resolve to construct the appropriate UI control.- The [default value], [min value], [max value] and [step] are int-based (except for the Float Slider, where they are float)- The [enum list] - defined in curly brackets "" is available for use in the Main Entry function.- The [enum label list] - defined as string inside curly brackets "" is used to indicate the enum value in the UI. It must contain the same number of items as [enum list].

ACES DCTLs allows user to define:- a standard color encoding (SMPTE ST 2065-1),- Input Transforms to convert different image sources to ACES,- Output Transforms in order to view ACES images on different types of displays.and use them to define the project's color science, or in Resolve FX ACES Transform for individual clips.

Applying ACES transforms from Project Settings:- Color Science: select "ACEScc" or "ACEScct"- ACES Version: select ACES version 1.1 or above.- ACES Input Device Transform: select the required ACES DCTL IDT.- ACES Output Device Transform: select the required ACES DCTL ODT.

Applying ACES Transform plugins to individual clips:- Double click or drag this plugin entry:- Edit page > Effects Library > OpenFX > Filters > ResolveFX Color > ACES Transform.- Color page > OpenFX > ResolveFX Color > ACES Transform.- Once added, select the required ACES DCTLs from the Input Transform or Output Transform combo box.

ACES DCTLs are written as transform DCTLs in one of three ways - using:- a non-parametric approach and hand-rolling your own transform functions.- a parametric ACES transform definition with standard ACES EOTFs.- a parametric ACES transform definition with custom EOTF functions.Example files for all three scenarios are available in the ACES Transform folder in the DCTL Developer documentation.

Parametric ACES transforms are supported under ACES version 1.1 or above. To write a parametric ACES transform following this standard, you need to define the following fields:- Y_MIN: black luminance (cd/m2) - float.- Y_MID: mid-point luminance (cd/m2) - float.- Y_MAX: peak white luminance (cd/m^2) - float.- DISPLAY_PRI: Display primaries - array of 8 floats inside curly brackets "".- LIMITING_PRI: Limiting primaries - array of 8 floats inside curly brackets "".- EOTF: Display device EOTF - integer in range [0-5] (see below)- INVERSE_EOTF: Input device EOTF - integer in range [0-5] (see below)- SURROUND: Viewing environment - integer (either 0,1) representing a boolean flag- STRETCH_BLACK: Stretch black luminance to a PQ code value of 0 - integer (either 0,1) representing a boolean flag- D60_SIM: Is user D60 adapted - integer (either 0,1) representing a boolean flag- LEGAL_RANGE: Output to legal range - integer (either 0,1) representing a boolean flag

Optional fields:- SKIP_STANDARD_ACES_RRT: Users can choose to run or skip standard ACES RRT (in output transform) or InvRRT (in input transform), and use their own custom RRT implementation.Integer (either 0,1) representing a boolean flag.By default, this value is treated as 0 and the standard ACES RRT (or InvRRT) is always used.

The second parameter in the custom functions is an input struct encapsulating the same parameters that you have defined using DEFINE_ACES_PARAM.typedef struct AcesTransformUserSettingParamsfloat yMin; // Black luminance (cd/m2)float yMid; // Mid-point luminance (cd/m2)float yMax; // Peak white luminance (cd/m^2)float displayPri[8]; // Display primariesfloat limitingPri[8]; // Limiting primariesint eotf; // Display device EOTFint surround; // Viewing environmentint stretchBlack; // Stretch black luminance to a PQ code value of 0int d60Sim; // Is user D60 adaptedint legalRange; // Output to legal rangeint skipRRT; // Skip the standard ACES RRT transform AcesTransformUserSettingParams;

c01484d022
Reply all
Reply to author
Forward
0 new messages