TestJMEDesktop and translucent newbie question

Hi,



The example of TestJMEDesktop is really nice, thanks for that!



Was wondering how I can make the 3D rotating box in this example have a translucent color?  In this create3DStuff() I changed:



        box.setRandomColors();



to:



        box.setDefaultColor(new ColorRGBA(1, 1, 1, .2f));



But now when i rotate the JDesktop such that the rotating box overlaps over some of the swing widgets, it isn't behaving as expected.  I expected the rotating box over the swing widgets to be translucent b/c I specified a background color with a .2f alpha.  But it looks solid.  What am I doing wrong?



Thanks!

You need to apply an AlphaState/BlendState. (this has nothing to do with JMEDesktop, btw)

Ahh ok when I apply an alphastate to the rotating Box, I see this is now partially working.  It is transparant with respect to the JDesktopPane's background color.  But it is not with respect to the swing components (it paints directly over them).  Is this possible?



I can attach my code if it's helpful, let me know

It does not paint over them, actually but blocks the painting of the desktop via the zbuffer. Put the cube into the Renderer.QUEUE_TRANSPARENT. (forgot to mention that above, sorry)

I've already done that but still doesn't work.  The code is attached.  Thanks for your help with all this BTW!

I don't have the time to test-run your code. But probably it's a sorting problem due to those multiple transparent objects?

FYI this isn't "my code".  This is the jmetest.awt.swinggui.TestJMEDesktop.



Thanks for your suggestions, I'll play with it some more.

marksmithurbana said:

FYI this isn't "my code".  This is the jmetest.awt.swinggui.TestJMEDesktop.

I know, sorry. Maybe my statement sounds too harsh. I just meant, I would need to test it / look into it longer and don't have the time for it.
I'm not sure if there are transparency examples besides that render queue test... can someone else help out here?

Got it!!  You were correct, it looks like a sorting problem.  The parent node for my JMEDesktop had the cull mode set to CULL_NEVER, I changed it to CULL_DYNAMIC.



Appreciate your help, thanks!