Efficient conversion of Kinect Player Index to Polygonal Outline

Hello everyone! I’ve been struggling to get this to work for days and could really use some help.

I am grabbing the Kinect Player Index, throwing on a Threshold and a Blur and then using the Trace SOP, a Resample, and an Extrude in order to get a polygon that I can use as an Actor in an Nvidia Flex Solver setup. This is a super inefficient way to get a 3D outline from a TOP but all of the other methods I’ve tried have been unsuccessful. I get good FPS for a while (60), but as time goes on, the frames just TANK (usually hovering around 14 but can go as low as 9 with the fluid simulations running). The bottleneck is clearly in the conversion to SOP being done on just a single processing thread that is also managing a bunch of other TD stuff.

There should be a few different ways to solve this problem but all of them have failed thus far.

I’ve tried creating a base to use within an Engine Comp that takes the Top In, does the work in Sops and then outputs a soptoChop, but when I take the Chop output and bring it back into Sop world, It draws a lot of weird extra lines through the geometry that ruins the fun.

I’ve tried similar workflows exporting the Top to Chop prior to working in Sops and it just draws a straight line in XYZ space. I tried using that line and instancing it in Geometry with p(0),p(1),p(2)/RGB and it instantly pegs my GPU at 100% and crashes TD.

What should be the best way to make this conversion is through a GLSL Mat and converting the RGB values from the Top into Vertices but I can’t seem to get it to work to save my life. I’m using uniform Sampler2D and pointing it at the Null Top then trying to adapt some code found here: [link]
but nothing is working.
~(I’ll upload files so you can see what I’m talking about.)

I have basically zero GLSL experience, so maybe I’m just doing it wrong but I seriously am at a dead end right now and any guidance would be greatly appreciated!!

edit: Uploaded file
TD HELP Top-Sop Workflows.toe (935.7 KB)

PC Specs:
CPU: Intel i9-12900H (12th Gen)
GPU: Nvidia RTX 3060
TD: 2023.11600