It’s probably more correct to say that you want a depth texture in the fragment shader so you can sample the depth of the scene. Unfortunately, this is not supported with the default materials. Ideally, you render the scene and save the depth information into a texture. A second render pass draws the particles and blends them onto the scene. To do this, you need a custom shader material. The following thread is related to this topic and might be helpful:
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Points transparent textures depth artifacts (soft particles) | 28 | 8790 | April 23, 2023 | |
Display sprites correctly with customized Points material? | 5 | 4151 | February 6, 2020 | |
Adding 3d volume | 2 | 1336 | March 19, 2021 | |
THREE.SpriteMaterial transparency not working on Shader with Depth Texture | 5 | 398 | August 1, 2023 | |
Problem when transparent points overlap | 8 | 2883 | September 17, 2020 |