Tri-Video Plane Shader
The Tri-Video Plane Shader is a shader written to make a plane into a video destination for 3 videos.
This allows for on-the-fly multi-camera video plates placement and adjustments. This will not cover techniques for video plate shooting and assumes that the video plate if functional.
While very powerful and dynamic, this shader does minor tweaks, saving time re-exporting and so on.
This shader also allows for color adjustments, vertical and horizontal offsets, rotational offsets and many more. See Features below for complete list of attributes.
If you are familiar with shader editing, the number of video destinations can be adjusted to meet the application.
This tutorial will not cover methods and “best practices” for shooting video plates, but, instead, focuses on the usages of this video shader. For advise and pointers shooting multiple videos with the intention of being “stitched” together, please contact support (at) lightcrafttech.com.
Downloading the Latest Sample Scene
This shader is applied in a sample scene for ease of use and editing. The FBX sample scene can be opened directly into Previzion or in Maya for customizing parameters.
To get started, log in Dashboard. Under “Download Center” download the latest version of the shader embedded in “Tri-Plane Video Sample Scene.”
This is an FBX scene and contains the shader applied to a plane.
Notes and Precautions
There are a few things to keep in mind as far as the technical parameters of this shader goes.
- Do not “Freeze Transformations” of object in Maya.
The bending, via the “Wall Curvature” attribute, happens inside the vertex shader. Freezing transformations resets the object transformations.
- To visualize in Maya “persp” window, press ‘6’ to view in Hardware Texture mode.
- The “Wall Curvature” parameter slider in Maya will “offset” the video plane and not necessarily curve the wall.
This is a known issue and is isolated to Maya. Wall Curvature works in Previzion.
Changing Placeholder Images (tex Sampler)
To align 3 videos shot together, forming the video plate “wall”, it is handy take screen grabs of each of the 3 videos at the exact same timecode address (or relative location) to use to align the videos.
Once the frames are extracted from each of the 3 videos, renamed them with memorable descriptions, like “right”, “center” and “left”, but also, make sure to add the prefix “video_” to the actual image file name. For instance, if “image_right.jpg” would need to be “video_image_right.jpg” to be identified in Previzion as a video destination.
To do this in Maya, once the scene is loaded, expand your “Attribute Editor” in Maya. This is usually collapsed as a tab on the right-hand corner of the screen.
Each of the default placeholder images will be stored in the parameters “tex1Sampler”, “tex2Sampler” and “tex3Sampler.” Click on the selection button to the right of that parameter line.
This will open the texture parameters.
To pick another image, select the little folder icon to open your file browser. Pick your image and make sure that it correspond to the correct video panel (i.e. video_image_center.jpg is assigned to the center panel).
Once this is done, ensure that “embed media” is checked in your FBX export settings.
Tri-Video Shader Features
- Per Video Color corrections
- Middle Grey
- 3-Channel Color Additive
- 3-Channel Color Multiplier
- Whole Shader Color Corrections
- Same controls as listed above
- Per Texture rotation and positional placement
- Each texture rotates from it’s own center
- Independent vertical and horizontal placement
- Left and Right texture vertical positioning parented to Center Texture vertical position
- Center texture Border Feathering
- Semi-Independent Left and Right border Feather:
- uses Global Master Feather
- Left and Right side independent feather adjustments
- Semi-Independent Left and Right border Feather:
Layered Compositing of Shader Breakdown
The Tri-Video Plane Shader composites the videos together into one single plane. This compositing takes place within the shader video assignment, prioritizing the center image as top-most element.
This illustration shows how the layering is calculated for the three textures. The Center texture is the top layer, being rendered over the left and right textures. All the blending functions are performed on the center texture which is then applied to the textures beneath to create the final image.
Tri-Video Plane Attributes
At first glance the attribute listing for this shader can look very daunting. This illustration shows that attributes are divided into 7 sections:
- Initial Settings
- Left Texture Placement and Color Correction
- Center Texture Placement and Color Correction
- Right Texture Placement and Color Correction
- Texture Blending
- Final Color Correction
- Miscellaneous Settings
These attributes are the identical in Previzion and any changes done in Maya can be saved and exported into Previzion as a new scene.
Changing Attributes in Previzion On-The-Fly
To make adjustments in Previzion, once the scene is loaded, select cgfxShader1 in the Scene tab and click on Edit.
This will open the shader parameters and all settings should correspond to their equivalent scene in Maya.
Setting the Stage
The attributes described here set some of the basic parameters for the video plane wall.
Use Maya Coordinate Transforms
Maya and Previzion handle some UV space transforms differently. Specifically, they often see the V, of UV, to be reverses of each other, or V¹ = 1-V;
When you have empty space after sliding the video plates together, this is the color that will fill in the empty space.
A slider value, from 0 -1, that defines the shape of the wall. At a value of 0.0 the wall is flat and at a value of 1.0 the wall is a semi-circle.
This switch will turn on, or off, the used of texture based LODs (mipmaps). For live filming, it is recommended that you leave off.
Textures 1 – 3, and Whole Object Color Corrections
Textures 1, 2 and 3 are very similar in their attribute listing; only texture 2 has no horizontal positioning attribute. In order from left to right the textures are:
- Tex1 → Left
- Tex2 → Center
- Tex3 → Right
- Final → Homogeneous color correction for the entire object
Textures 1, 2 and 3 Each texture has attributes that are categorized into two separate functions: placement, and color
- Placement → These attributes relate to rotating and moving each texture into place
- Color → Color correction functions include: contrast, brightness, desaturation, color addition and color multiplication
These per texture, or video, color correction controls are used when 3 cameras have different color temperatures and the colors are different per texture
The color correction math follows standard function transformations:
- colorout = ((colorin – middle grey) × contrast) + middle grey + brightness
- colorout = (colorout × (1.0 – desaturation)) + (((colorout.r + colorout.g + colorout.b)/3.0) × desaturation)
- colorout ×= Multipliercolor
- colorout += Additivecolor
Texture Handle: texSampler
Texture connection for left, center or right video plane
Placement: Horizontal Placement
Placement: Vertical Placement
Moves the textures along the vertical axis. The Left and Right vertical positioning of textures is parented to the center vertical positioning.
Color Correction: Contrast
Color Correction: Middle Grey
Color Correction: Brightness
Adds luminance to the overall texture
Color Correction: Desaturation
Removes saturation from the texture by averaging the red, green and blue channels.
Color Correction: Color Additive
Provides 3 channel support (RGB color) to color grade via addition
- imagenewred = imagered + colorred
- imagenewgreen = imagegreen + colorgreen
- imagenewblue = imageblue + colorblue
Color Correction: Color Multiplier
imagenewgreen = imagegreen × colorgreen
imagenewblue = imageblue × colorblue
Image Layer Blending
Alpha Blending from the Center Texture to the Right and Left textures is performed by edge blending on both sides of the center texture. To achieve the proper blending there are three components of the blending algorithms:
- Boundary Positions
- Defines where, on the left and right sides of the center texture, the feathering border is.
- Boundary Angles
- Defines how much the boundaries are rotated when defining feathering
- Boundary Feathering
- Defines how sharp or broad the blending boundary is
In order to clearly see where the blending boundaries are, the shader includes an attribute for displaying blending boundaries
Blend: Right/Left Boundary
These attributes move where the blending happens. When both values are set to 0, the boundaries are at the left and right edges of the center texture.
- zero values here are its default positions
Blend: Right/Left Angle
These attributes allow for fine tuning of blending by rotating the boundaries. The effective range of these attributes is from -90° ↔ +90°
Blend: Master/Right/Left Feather
These attributes are created in a manner that allows for semi-independent feathering amounts between the right and left edges of the center texture. The attributes are divided into three:
- Master Feather: both sides are feathered by this amount
- Right Feather: This is an offset feathering amount, allowing for more, or less, feathering on the right side
- Left Feather: This is an offset feathering amount, allowing for more, or less, feathering on the left side
Render Boundary Guides
Check this to render the left and right side boundaries.
There are two methods for rendering transparency:
- “Transparency” – Renders stencil alpha by default when turned on (set to 1).
- Stencil is a fast transparency render but creates aliased edges along transparency border
- “Alpha Blending” – Renders alpha blend when turned on (set to 1).
- Keeping Alpha Blending off will improve transparency sorting.