Question

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)?

Many thanks.

Was it helpful?

Solution

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.

http://jsfiddle.net/vuQ9R/10/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top