PCG - HLSL - How to use 2nd Output Pin

Trying to use PCG with HLSL for making a landscape-grass replacement. It’s going well.

However, I wanted to know if/how it’s possible to push points to a 2nd output in a custom HLSL node. I cull some points for grass not on the right landscape-layers. Looking to use the points I am currently rejecting for other-things. How do I get them over to the 2nd output?

I see some helper functions (yellow box), took a few whacks, but I ain’t getting it. Is there anyone that can offer a practical-example or a go-look-here?

Did you ever figure this out?

Not yet. I have a feeling it’s involved with the init function and then keep/remove but I don’t know enough about HLSL to make it work. I mean, I know C, C++, ANSI C, buncha other languages I have had to use over my career so I believe I can code, but I don’t understand the indices, elements, how that is all structured so I am guessing and the guesses aren’t working - lol

If I DO get this working, I will update the thread.

I also want to say I read/hear somewhere where a lot of the HLSL stuff is still early-stage, so I do wonder if I am jumping the gun at all, trying to do something that is not (yet) possible?

I got it figured out! So from my understanding the 2nd output gets initialized with the same amount of point elements as this input pin by default, you can change it to a fixed amount tho. But these points aren’t getting values assigned to them. So you have to copy data to them with the CopyElement function. I just have 1 input coming into mine with Regular (#1 output) and Golden (#2 output).

const float GoldenThreshold = 0.2;
Seed = ComputeSeed(Seed, ElementIndex);
float SplitRoll = FRand(Seed);

if (SplitRoll <= GoldenThreshold)
{
Golden_CopyElementFrom_In(Regular_DataIndex, ElementIndex, In_DataIndex, ElementIndex);
Regular_RemovePoint(Regular_DataIndex, ElementIndex);
}
else
{
Regular_CopyElementFrom_In(Regular_DataIndex, ElementIndex, In_DataIndex, ElementIndex);
Golden_RemovePoint(Regular_DataIndex, ElementIndex);
}

Does a roll and if it’s less than the threshold it’ll add it to the 2nd output ( Golden ) and remove it from the first ( Regular ). And it if’s greater it’ll copy it to regular and remove it from golden. Although the Regular_CopyElement might not matter because it seems the 1st output pin initializes fine.