Bucket Managing

Hello Monkeys!

I have two problems that I think have to do with buckets. I have bloom objects that can be seen through walls (but not through terrain) and for some reason, water dissapears when seen from behind glass.

The attached pictures illustrate this quite well. “nehon” told me I have to use tranluscent bucket and add a “TranslucentBucketFilter” but I can’t get it to work.

Is there a rule of thumb for these buckets ? I have trouble grasping what I need to do. Sample code ??



Thanks in advance.

Not really… they are drawn in a particular order. That’s it.

We can’t see how you have your scene setup so anything we say here is wild guesses.

You should read up on sorting, alpha transparency, z-buffers, etc. so that you understand the issue… but basically if a pixel is drawn at z = n then nothing after is drawn at z > n whether the first thing was transparent or not. Order with transparency is critically important.

Sometimes it’s impossible to get things sorted right at the bucket level and so custom comparators are necessary (for example, Lemur has one that allows spatials to be tagged with layers to force a different sort order.)

2 Likes

Thanks pspeed,

I managed to get it to work by adding the water filter at the very end and then I added:

fpp.addFilter(new TranslucentBucketFilter());

I still have the Bloom going through all objects exept for terrain but it is nice to see the ocean view from inside the space ships now :smile:

Cheers!