¿El sistema de partículas Three.js como fondo forzado detrás de otros objetos?
Frecuentes
Visto 1,454 veces
1
I have a particle system that I am using to generate background stars - I have it tracking position with the camera but sometimes, the stars will render closer than the bodies which they are meant to be the background for.
Is there a way to force the particle system to always render behind the other meshes in my scene (almost as a background wallpaper - but moving with rotation)?
Muchas gracias.
1 Respuestas
2
This is relatively easily.
- create a renderer with autoclear = false
- clear your render with renderer.clear();
- render your particle system as a separate scene
- clear the depth of the rendering with renderer.clear(false, true, false);
- then render all other objects.
And voila, you have a particle system that always stays behind the scene.
Respondido el 07 de Septiembre de 12 a las 09:09
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas three.js particle-system or haz tu propia pregunta.
Even easier. With just one scene, you can set
depthWrite
afalse
in the particles material andparticles.renderDepth = 0
: jsfiddle.net/vuQ9R/13 - mrdoobyep I made it too damn hard again - Gero3
Haha, I would have done it like this some months ago too. But you learn tips and tricks every day. - mrdoob