I am using libgdx version 0.9.9. I want to render a fire effect using ParticleEffect in 3D space along with other 3D models.
Logical flow of my code:
The problem: The fire effect is rendering fine at a point in 3D space. But when I rotate the camera so that a 3D model lies between the camera and the fire effect the fire effect renders over the 3D model instead of being hidden behind the 3D model.
Things that I have tried:
Has anyone faced similar problem? Any suggested workaround to make ParticleEffect behave as part of the 3D world so that it gets hidden when blocked by other 3D models? I have seen a video posted by Xoppa on youtube about 3D particles in libgdx but there are no steps / solution mentioned. Any help will be highly appreciated.
The reason SpriteBatch was not being displayed in the following rendering order:
was because the 3d models consisted of a Skydome that was overlapping the SpriteBatch, thus hiding it completely. I took out the Skydome from the set of 3D models rendered in step # 2 above and am rendering it before the particle effect.
Following rendering order is working fine for me:
With this the particle effect is in front of the sky but behind the 3d models.