three.js - cannot view a sprite through a mesh wit

2019-02-20 14:47发布

问题:

I have a group of sprites, as well as some other meshes, and in front of them I've printed some text as a texture on a mesh. Everything is viewable through the text, except for the sprites which disappear whenever the text's tranparency is printed over them. Any ideas?

回答1:

Sprites are rendered last, so they will not work well with other transparent objects.

Your work-around is to set

renderer.autoClear = false;

and then to place the transparent text into scene2, and implement two render passes like so:

renderer.render( scene, camera );
renderer.clearDepth(); // optional, depending on use case
renderer.render( scene2, camera );

three.js r.68