Padding parameter on Stype TOP staying enabeled when Stype CHOP parameter is referenced

Hi All,

We are doing some tracking calibration but are a bit confused on how to combine the Stype CHOP and Stype TOP. Specifically when it comes down to the use of the padding parameters.

The documentation of the Stype TOP says the following about the padding parameter “padding - Only enabled when the CHOP Node parameter does not reference a Stype CHOP

However, if you have a look at the below screenshot you see that this parameter stays enabled.

Could you please advise if this is a bug and if not, how should we configure both padding parameters on both the Stype CHOP & TOP? Should they always match values?

Thanks in advance.

Gr,

Thomas

It seems the stype TOP is applying the needed lensdistortion and center shift but at the borders of the resulting image, we see some strange artifacts where the AR gets cropped/mirrored/repeated

is this normal behaviour? can this be fixed by using the padding parameters in a specific way?

currently the padding parameters on both the Stype CHOP and the Stype TOP are at zero.

Thanks in advance for clarifying this behaviour.

Gr,

Thomas

Think i solved the issue after some gemini-research:

Question: what is the padded_fov used for when doing AR with stype trackers in combination with touchdesigner?

Answer: When integrating Stype camera tracking with TouchDesigner for Augmented Reality (AR), the padded_fov parameter is specifically used to handle lens distortion (overscan).Why padded_fov is NecessaryReal-world optical camera lenses suffer from radial lens distortion (e.g., barrel distortion or pincushion distortion). To match the virtual 3D scene in TouchDesigner with the physical camera feed, you must apply the lens distortion profiles calculated by Stype ($k_1, k_2$, etc.) to your rendered CG graphics. The Problem: Edge ClippingWhen barrel distortion is applied to a standard 3D render, the edges of the 3D frame are pulled inward toward the center.If you only render at the physical camera’s exact FOV and resolution, warping the image leaves empty black gaps or clipped edges around the perimeter of your AR frame.The Solution: Overscan RenderingTo fix this, TouchDesigner renders a larger “overscan” area beyond the visible camera frame:padding parameter: Stype allows you to set a percentage increase (e.g., 0.1 for 10% extra area).padded_fov channel: The Stype CHOP calculates this expanded angle derived from your base FOV and padding setting. Padded Render: You assign padded_fov to your Camera COMP’s FOV angle and scale up your render node’s resolution accordingly. Distortion & Crop: The Stype TOP takes this oversized render, warps it using the lens parameters, and crops it back down to the final target broadcast resolution. Because you rendered the extra margins, no empty borders or stretched pixels appear after distortion.

Based on this i think the following setup does the trick:

  • bind Stype CHOP padding parameter to the Stype TOP padding parameter
  • use the padding value to upscale the rendered resolution
  • the Stype TOP now has some extra resolution to do its magic based on the other distortion paramerets it gets from the Stype CHOP

I’m glad you got it sorted out and sorry for the confusion there.

Yes, the padding value on the Stype CHOP is used to calculate an expanded field of view to be given to the renderer so that the lens distortion algorithm in the TOP has all of the necessary image data and doesn’t resort to wrapping, mirroring or other texture stretching techniques around the edges.

Normally, if you use the Stype CHOP and TOP together, the TOP will pull the padding value from the CHOP so that they are in sync. The padding parameter on the TOP is a backup for cases when the TOP is used alone, but that parameter is ignored when a CHOP value is available.

I’ll try to clarify that in the docs and look at automatically disabling it when not applicable.

Let us know if you have any other questions.

1 Like