Weird problem with particles

Hi. I found problem with particles. Well I tried to add a simple particle geometry to my scene but when I added it I saw something like this in the attached image. It look like it hasn't got any blending but it has alpha state (additive).

The texture is flaresmall from jmetests. I found also that if I disable z-buffer state which is applied to this particle (with function LESS EQUAL) it look as it should but then I can see that particle through walls! How to fix that?

Ouch… I fixed that :slight_smile: no more problems…

If you fix an issue yourself, would you please post a (brief) explanation; to help others that may be searching later.



Thanx :slight_smile:

I have the same problem. In my project it occurs only when a ParticleMesh is attached to the live node. When I attach the ParticleMesh before the parent node is live the alpha blending is OK. I just activate the ParticleController when it is time to show the effect. I'm also interested in to find better solution for this.

Ok. Sorry for lack of explanation. Solution is very simple:



I added one line of code:



ZBufferState state = ...
...
state.setWritable(false);
...
particleGeometry.setRenderState(state);
particleGeometry.updateRenderState();



that's all :)

Thanx [IR]Radek :slight_smile:



mazander: I wonder if you are missing an updateRenderState()…

Indeed it's very simple.



But I have one question, if you turn ZBufferState to off, does it mean that your particules will be always on top, so always visible, even if there are beside others objects ?

:slight_smile: updateRenderState() solved my case, thanks.

pitchonel said:

But I have one question, if you turn ZBufferState to off, does it mean that your particules will be always on top, so always visible, even if there are beside others objects ?


With a ZBufferState I find its quite undefinable what is visible before what else, it depends on the order of rendering.

A Geometry (or ParticleMesh) will always be visible before everything else if you set the TestFunction to:


zs.setFunction(TestFunction.Always);

dhdd said:


With a ZBufferState I find its quite undefinable what is visible before what else, it depends on the order of rendering.

A Geometry (or ParticleMesh) will always be visible before everything else if you set the TestFunction to:


zs.setFunction(TestFunction.Always);




Ok, it's what I thougth. So it does't seem to be a good solution tu disabled ZBufferState if you want to keep the correct Z rendering order.

for the correct Z-Rendering the ZBufferState has the the correct TestFunction set by default.

Anybody have any idea why this topic sticky??



(I am gonna un-sticky it if no one replies…)

Un-sticky-ed