Apply anti-aliasing to shaderMaterial

I have succeeded in compositing 2 images using shaderMaterial.
I needed 3 images, and 1 is a mask image.
The composited image is rough.
How do I apply anti-aliasing?

If you apply antialiasing to the mask (ie. make edges grey and smooth), then in the shader multiply output color value by the mask value - it should auto-alias by itself. :sweat_smile:

1 Like

Does that mean I have to implement it myself?

In a way - it would be a bit easier if you shared your fragment shader code. It’s a matter of adding a single multiplication.

This document contains the source code.

I solved it by multiplying the transparency of the mask.

1 Like