Particles must be rendered last, and without writing to zbuffer.
I just played with this a bit, and here some hackish C# code:
Code:
public override void Render(float time)
{
Camera.Update();
// hide only particles
h3d.setNodeFlags(particles.Node, (int)h3d.H3DNodeFlags.Inactive, true);
h3d.render(Camera.Node);
h3d.setNodeFlags(particles.Node, 0, true); // back to visible
// draw GL stuff
// remember push all attribs (states) first, draw, then pop attribs
// hide everything
h3d.setNodeFlags(h3d.H3DRootNode, (int)h3d.H3DNodeFlags.Inactive, true);
// set only particles visible
h3d.setNodeFlags(particles.Node, 0, true);
h3d.render(Camera.Node);
h3d.setNodeFlags(h3d.H3DRootNode, 0, true); // all visible
}
Then I had to modify forward.pipeline.xml,
Code:
<ClearTarget depthBuf="true" colBuf0="false" />
I changed colBuf0="true" to false so second h3d.render() doesnt clear screen.
With my scene this works because I have skybox, so clearing isnt necassary anyway.