Blending two textured quads problem

i think you need setRenderQueueMode(Renderer.QUEUE_TRANSPARENT); does that not help ?

If I set renderQueueMode to transparent only for X-textured quad  then it is OK. But we I set renderQueueMode to transparent for both (X-textured quad and the building-icon-textured quad behind it) then again it is the same problem.



If I am not mistaken transparent render queue is rendered after the queue of opaque objects, so putting only X-textured quad into the transparent render queue delays the rendering of that quad after rendering the building-icon-textured quad and that works.

However putting both quad in the same render queue (opaque or transparent) reestablish the problem because they seems to be rendered in the order of creation (or attachment to the rootNode, whatever) with seems to me causes this problem. And that is not good:) Not only there is enough queues for all my object but objects may change their z-coordinate ('z' says which object is in front of others)



It seems to my like I somehow misuse something or forgot something to enable. Because rendering transparent object should not be in the order of creation but it should take Z-axis into account, shouldn't it?

Basically I need two (or more) half-transparent half-opaque object laid one on top of other to be render according they position and not the order of creation.

This is part of your GUI right?

You should use setRenderQueueMode(Renderer.QUEUE_ORTHO); for every GUI object you have. And then when you set its location on screen, set also z coordinate of it: setLocalTranslation(x, y, z); and make it different for both overlapping quads.

Hope this helps. :slight_smile:

It is hard to say what is still GUI and what is not:) This problem is not gui related, it can be reproduced with all my game objects.

Setting ortho however changed something, everything is shifted and nearly nothing can be seen:)



Putting both quad in the same queue (no matter which) makes incorrectness. Which makes me feel that problem is not in render queue mode. Because opaque object are render from the closest to the camera whilst transparent are rendered from the farthest and even this change do not affect the problem. Currently seems to me like incorrect ZBufferState or BlendState or… dunno:(

If you're using GUI then you should use QUEUE_ORTHO for it. You can then use the method setZOrder in Spatial to setup the order of gui objects.