Apply anti-aliasing to shaderMaterial

Hello.
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?
--2

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.

https://discourse.threejs.org/t/smoothing-shadermaterial/28421

I solved it by multiplying the transparency of the mask.
--4

1 Like