Bucket Queue is Opaque but Geometry is still transparent!

I have some objects whichs Geometry I put into the bucket queue opaque or transparent, depending on a property. Problem is that they are all always transparent no matter what I change. The Material has Blendmode Alpha and is also in queue bucket Opaque. Even the holding Node is in the bucket (altough that one shouldnt matter I think). I have also searched for every call of the queue bucket in my application and I cant seem to find an instance where I would be changing the geometry or materials queue bucket again, in fact when debugging both say in their property that they are in the Opaque bucket. Something has to be happening tough because for a split second when the scene is loaded the Spatials are all opaque as they should be.

Anyone got any ideas what could be happening?

this ^

Buckets only manage the rendering order, alpha mode defines transparency. Even if you are in the opaque bucket your geometry maybe rendered after some other in the opaque bucket and if the blend mode is set to alpha then it looks transparent.

Hmm that would explain why it was working before the Spatials (square or rectangular blocks basically) length and width was exchanged as it was faulty. Altough I dont quite understand how that quite changed the situation. Still, the look I got then is completely different to the look I get with any other Blendmode, With Blendmode off I get a completely flat colour, with Blendmode Alpha there is a gradient Alpha value towards the edge on the Material which in the transparent queue makes it look transparent and in the opaque queue made it look like a shadow of sort.

well it’s hard to say without seeing your code.
There is a very good explanation on how transparency works and must be setup here Alpha/Transparency Sorting, Your Z-buffer, and You

2 Likes

Well upon thorough review of my code and that article I got the sorting order right now. I swap the Materials Blendmode whenever I change it from transparent to opaque and everything works fine now. I dont get that “shadow effect” i experienced first but I can only conclude that it was a bug as I cant see any reason why the transparent parts of the texture would ever be black if no other black texture was behind.

Either way thank you very much for that article it helped tremendously! Now I can understand the relation between the z-buffer, the bucket queue and the Blendmode.

What is the framebuffer background? Generally, it’s black.

So if those items are drawn first… they fill the Z-buffer and you get black.

You should reread that article again because there may be parts of it that you don’t understand.

What is the framebuffer background? Generally, it’s black.

I did not actually know that, seems logical but I never tought of it :smile:.

Given that the opaque bucket is drawn first and back to front, no matter how many Spatials are on top of each other they all get said ‘shadow’. Correct me if I got that wrong.

One more question, for spatials that do not have a bucket queue assigned in code what is the default? Inherit?

The opaque bucket is drawn FRONT to BACK… the TRANSPARENT bucket is drawn back to front (painter’s sort).

The bucket of their parent.

“Which parent?” Ahah…

1 Like

Yes, the default for Spatials is Inherit. You can see this in Spatial.java:

And anticipating your next question, if the spatial and all its ancestors are set to Inherit, the effect is Opaque.

1 Like