How to fix artefacts with transparent shader material?

Hi,
I’m trying to create a transparent shader material with the param transparent: true and apply it on 2 objects
when I use depthWrite: false, and gl_FragColor = vec4( base, 1. ); I get this


when depthWrite: true, and gl_FragColor = vec4( base, 0. ); I get this
Screenshot_2
what to do?
thanks in advance

Transparency of overlapping objects is very difficult with rasterization. Try with pathtracing (GitHub - gkjohnson/three-gpu-pathtracer: Path tracing renderer and utilities for three.js built on top of three-mesh-bvh.) or tell us your use case so we can give advice on tweaking tricks.