Points transparent textures depth artifacts (soft particles)

Since we only need the depth texture from the first render, would setting the renderTarget's format to THREE.DepthFormat help the optimization a bit? Or maybe is that not at all, where the heavy lifting is, and the change wouldn’t be even noticable?

1 Like

Hey, I asked myself that very same question. I soon realized that since you need 2 passes anyway - it’s best to render both color and depth to a render target in the first pass, you use a depth attachment. Then you take the depth attachment and feed that into the particle rendering pass. I managed to gain a significant performance boost from that.

1 Like

Sounds good! Anyone wants to update the fiddle with this approach :innocent:

testing the jsfiddle and get some problem with the animation using chrome
[.WebGL-0x12ddcd309a00]GL ERROR :GL_INVALID_OPERATION : glDrawArrays: Source and destination textures of the draw are the same.

updated fiddle
https://jsfiddle.net/wfo5cvur/5/

@Mugen87 any idea why this is not working anymore with latest threejs builds? https://jsfiddle.net/wfo5cvur/5/

1 Like

without renderTarget
https://jsfiddle.net/wfo5cvur/9/

3 Likes

Updated fiddle with r124: https://jsfiddle.net/8k1325gL/1/

The way defines are handled has been fixed with r118 which affects the custom shader code in this example.

1 Like

In this example, the smoke can be seen out of the wall. So, I made some attempts. I set material’s depthTest to true, the smoke can’t be seen out of the wall, but the edges are occured again. In my options, it is not the real soft particles effect. Don’t know if my understanding is correct?

Can somebody update it to the last version?
It doesn’t works now

1 Like