I am working on a face tracking application that captures the scene including the alpha channel. During this, I noticed some strange interactions with MToon's cutout mode:
The alpha channel was not anti-aliased and the camera's clear color leaked into anti-aliased edge pixels for MToon cutout materials.
Eyebrows using a MToon cutout material would create alpha holes in the face for semi-transparent pixels above the cutout threshold.
This very simple patch fixes both issues. Setting the alpha to 1.0 after clip should be fine. Pixels are already discarded if they are below the threshold. Otherwise, it should be safe to assume that they should be considered opaque. If blending should take place, the first line in the following ifdef block resets the alpha anyways.
Hi!
I am working on a face tracking application that captures the scene including the alpha channel. During this, I noticed some strange interactions with MToon's cutout mode:
This very simple patch fixes both issues. Setting the alpha to 1.0 after
clip
should be fine. Pixels are already discarded if they are below the threshold. Otherwise, it should be safe to assume that they should be considered opaque. If blending should take place, the first line in the followingifdef
block resets the alpha anyways.