Bloom filter messes up node order

Hi guys,



when I use the bloom filter from the wiki:



[java]

FilterPostProcessor fpp = new FilterPostProcessor(assetManager);

BloomFilter bloom = new BloomFilter();

bloom.setBloomIntensity(0.4f);

fpp.addFilter(bloom);

viewPort.addProcessor(fpp);

[/java]



Then the order of the nodes which are rendered completely changes and are wrong (intead of without bloom).



Is this an expected behavior and I need to specify the order of the nodes manually or do I need an extra parameter?



Thanks.

jME3 makes no guarantees about the order in which nodes are rendered. Are you seeing any visual artifacts as a result of adding the bloom?

No, everything just looks fine, except of the messed up render order.



How would you handle this issue?

@openjonny said:
How would you handle this issue?

If you depend on the nodes being rendered in a specific order then you're doing something wrong.
@openjonny said:
No, everything just looks fine, except of the messed up render order.

How would you handle this issue?


Or put another way... why are you relying on the render order? There is always a better way.

I don’t know anything about the details of the engine, I only noticed for me an unexpected behavior not mentioned in the wiki using the bloom filter.



I have a ring which surrounds a model which is just looking fine, but when I use the bloom filter the ring comes before the model ignoring its location in space.



I’m trying to understand why that just happens by using the bloom filter and so far the response was “we don’t guarantee anything”.

The ordering is different depending on the bucket that the geometry is in. Opaque bucket is sorted front to back, transparent bucket is sorted back to front… and so on.



We would need to know more about your scene setup to say why it is different with the bloom filter on.



The bloom filter renders things with an extra technique or something, I think. I’ve never had it affect any of my own stuff, though. Are you setting a glow color on some object?

Out of curiosity…



Would you post a screen shot of with and without the filter? The bloom filter does nothing to alter the order in which things are rendered, it just adds three extra render passes (Glow, Horizontal blur and Vertical blur) and then mixes the output from the frame buffer.



In particular… these calles in the initFilter…



[java]

extractPass.init(renderManager.getRenderer(), screenWidth, screenHeight, Format.RGBA8, Format.Depth, 1, extractMat);

postRenderPasses.add(extractPass);

[/java]



One render pass will use the same render order as the next unless you specify otherwise, which is not happening here.

@openjonny said:
I'm trying to understand why that just happens by using the bloom filter and so far the response was "we don't guarantee anything".

Nobody said that. Momoko said "the engine doesn't guarantee that". Thats a technical circumstance and not a personal decision or offense. That is why you do something wrong when you depend on that order.

The bloom filter does not change anything to the rendering order.Only the pre pass in “scene” glow mode is rendered before the actual render of the scene, but the scene is then rendered as usual.



Maybe there is a visual artifact that makes you think the order is messed up though, so please could you post a screen shot or some code, or both?



Thanks

Here’s an example with bloom dynamically enabled/disabled:







I’m afraid that I need to do call manually the comparator now for every object or something similar…



Thanks.

Are your transparent objects in the transparent bucket?



please post the code where you initialize the transparent objects

are the z locations similar? move that blue object further away and see what that does