The Custom Vertex 3D node is an advanced custom node for 3D geometry that performs per vertex manipulations. If you have moderate experience with scripting or C++ programming, you should find the structure and terminology used by the Custom node familiar.
Using scripting math functions and lookup tables from images, you can move vertex positions on 3D geometry. Vertices can be more than just positions in 3D space. You can manipulate normals, texture coordinates, vectors, and velocity.
For example, Custom Vertex 3D can be used to make a flat plane wave like a flag, or create spiral models.
Besides providing a 3D scene input and three image inputs, the Inspector includes up to eight number fields and as many as eight XYZ position values from other controls and parameters in the node tree.
Custom Vertex 3D Node Inputs
The Custom Vertex 3D node includes four inputs. The orange scene input is the only one of the four that is required.
- SceneInput: The orange scene input takes 3D geometry or a 3D scene from a 3D node output. This is the 3D scene or geometry that is manipulated by the calculations in the Custom Vertex 3D node.
- ImageInput1, ImageInput2, ImageInput3: The three image inputs using green, magenta, and teal colors are optional inputs that can be used for compositing.
Custom Vertex 3D Node Setup
The object you want to manipulate connects to the orange scene input of the Custom Vertex 3D node. The output typically connects to a Merge 3D node, integrating it into a larger scene.
Custom Vertex 3D Node Vertex Tab
Using the fields in the Vertex tab, vertex calculations can be performed on the Position, Normals, Vertex Color, Texture Coordinates, Environment Coordinates, UV Tangents, and Velocity attributes.
The vertices are defined by three XYZ Position values in world space as px, py, pz. Normals, which define as a vector the direction the vertex is pointing as nx, ny, nz.
Vertex color is the Red, Green, Blue, and Alpha color of the point as vcr, vcg, vcb, vca.
Custom Vertex 3D Node Numbers Tab
- Numbers 1-8
Numbers are variables with a dial control that can be animated or connected to modifiers exactly as any other control might. The numbers can be used in equations on vertices at current time: n1, n2, n3, n4,… or at any time: n1_at(float t), n2_at(float t), n3_at(float t), n4_at(float t), where t is the time you want. The values of these controls are available to expressions in the Setup and Intermediate tabs. They can be renamed and hidden from the viewer using the Config tab.
Custom Vertex 3D Node Points Tab
- Points 1-8
The point controls represent points in the Custom Vertex 3D tool, not the vertices. These eight point controls include 3D X,Y,Z position controls for positioning points at the current time: (p1x, p1y, p1z, p2x, p2y, p2z) or at any time: p1x_at(float t), p1y_at(float t), p1z_at(float t), p2x_at(float t), p2y_at(float t), p2z_at(float t), where t is the time you want. For example, you can use a point to define a position in 3D space to rotate the vertices around. They can be renamed and hidden from the viewer using the Config tab. They are normal positional controls and can be animated or connected to modifiers as any other node might.
Custom Vertex 3D Node LUT Tab
- LUTs 1-4
The Custom Vertex 3D node provides four LUT splines. A LUT is a lookup table that will return a value from the height of the LUT spline. For example, getlut1(float x), getlut2(float x),… where x = 0 … 1 accesses the LUT values.
The values of these controls are available to expressions in the Setup and Intermediate tabs using the getlut# function. For example, setting the R, G, B, and A expressions to getlut1(r1), getlut2(g1), getlut3(b1), and getlut4(a1) respectively, would cause the Custom Vertex 3D node to mimic the Color Curves node.
These controls can be renamed using the options in the Config tab to make their meanings more apparent, but expressions still see the values as lut1, lut2,…lut8.
Custom Vertex 3D Node Setup Tab
- Setups 1-8
Up to eight separate expressions can be calculated in the Setup tab of the Custom Vertex 3D node. The Setup expressions are evaluated once per frame, before any other calculations are performed. The results are then made available to the other expressions in the node as variables s1, s2, s3, and s4.
Think of them as global setup scripts that can be referenced by the intermediate and channel scripts for each vertex.
For example, Setup scripts can be used to transform vertex from model to world space.
Custom Vertex 3D Node Intermediate Tab
- Intermediates 1-8
An additional eight expressions can be calculated in the Intermediate tab. The Intermediate expressions are evaluated once per vertex, after the Setup expressions are evaluated. Results are available as variables i1, i2, i3, i4, i5, i6, i7, i8, which can be referenced by channel scripts. Think of them as “per vertex setup” scripts.
For example, you can run the script to produce the new vertex (i.e., new position, normal, tangent, UVs, etc.) or transform from world space back to model space
Custom Vertex 3D Node Config Tab
- Random Seed
Use this to set the seed for the rand() and rands() functions. Click the Reseed button to set the seed to a random value. This control may be needed if multiple Custom Vertex 3D nodes are required with different random results for each.
- Number Controls
There are eight sets of Number controls, corresponding to the eight sliders in the Numbers tab. Disable the Show Number checkbox to hide the corresponding Number slider, or edit the Name for Number text field to change its name.
- Point Controls
There are eight sets of Point controls, corresponding to the eight controls in the Points tab. Disable the Show Point checkbox to hide the corresponding Point control and its crosshair in the viewer. Similarly, edit the Name for Point text field to change the control’s name.
Custom Vertex 3D Node Settings Tab
The Settings tab controls are common to many 3D nodes, and their descriptions can be found in Common Controls HERE
About the Author
Justin Robinson is a Certified DaVinci Resolve, Fusion & Fairlight instructor who is known for simplifying concepts and techniques for anyone looking to learn any aspect of the video post-production workflow. Justin is the founder of JayAreTV, a training and premade asset website offering affordable and accessible video post-production education. You can follow Justin on Twitter at @JayAreTV YouTube at JayAreTV or Facebook at MrJayAreTV