Particle mesh and alpha result

Another strange situations of mine.



Look at :



And this is my render cycle…



DisplaySystem.getDisplaySystem().getRenderer().clearBuffers();
SkyboxManager.getInstance().render();                        
DisplaySystem.getDisplaySystem().getRenderer().draw(scene);         
DisplaySystem.getDisplaySystem().getRenderer().renderQueue();
sPass.renderPass(DisplaySystem.getDisplaySystem().getRenderer());         
WaterManager.getInstance().render();                           
PhysicsDebugger.drawPhysics(physicsSpace, DisplaySystem.getDisplaySystem().getRenderer());
DisplaySystem.getDisplaySystem().getRenderer().displayBackBuffer();

The problem is the particles (with alpha) are showing before the shadow pass is applied to the frame buffer. Thus, when the final color of the transparent part of the particle is chosen it picks the color of the pre-shadowed terrain. You need to add the particle rendering after the shadows are displayed.

Thanks a lot!!!

So I changed my render cycle



                                                DisplaySystem.getDisplaySystem().getRenderer().clearBuffers();
         SkyboxManager.getInstance().render();                        
         
         DisplaySystem.getDisplaySystem().getRenderer().draw(scene);         
         
         DisplaySystem.getDisplaySystem().getRenderer().renderQueue();
         sPass.renderPass(DisplaySystem.getDisplaySystem().getRenderer());
         DisplaySystem.getDisplaySystem().getRenderer().draw(particles);
         DisplaySystem.getDisplaySystem().getRenderer().renderQueue();
         WaterManager.getInstance().render();                                             
         
         PhysicsDebugger.drawPhysics(physicsSpace, DisplaySystem.getDisplaySystem().getRenderer());
         DisplaySystem.getDisplaySystem().getRenderer().displayBackBuffer();



Where paticles is the node containing the particles

So the situation is better but.....do you think is right ?