Use the Segmentation Processor patch group to soften or dilate the boundaries of person, hair or skin segmentation textures.
Segmentation processing can only be used in projects using the Render Passes capability.
First, create a project using hair, person or skin segmentation. For support, see our article on segmentation effects.
We have made a simple effect that uses person segmentation to seperate the user from a pink background:
To add the Segmentation Processor patch group:
This will add two new patches to your patch graph:
The Segmentation Processor patch contains two values that we can edit to change our effect:
However, to have these values applied in our effect, we must first change the segmentation mask texture that is being used to one that has been created by our new patch group:
You'll now see that adjusting the values in the Segmentation Processor patch changes how your effect looks.
The segmentation mask texture which you would like to modify.
The level of softening applied to the edges of the segmentation mask texture. The higher this value, the more blended the segmentation will be.
Dilation Kernal Width
The extent to which the segmentation mask texture extends beyond the bounds of the feature being tracked. A higher value will make your segmentation mask texture larger.
The modified segmentation mask texture. This can be applied by connecting this output to an input that consumes textures, or by selecting the new texture in the Inspector. In the inspector, the texture generated by this patch will be called Segmentation Mask Texture.
Here, you can see what happens as the EdgeSoftness is set to 0, 2.5 and 5:
And in this example, you can see what happens as the DilationKernalWidth is increased to 10, 20 and 40: