Hi,
I've searched the forum for the answer and it contains quite a lot of discussion about correct usage of BlendState but none solves my problem:-(
On the attached image there is a wooden background, 3 buttons on top of it and black rectangle on top of it all.
All objects are Quads.
Background and buttons have loaded texture from .png file. These .png files are trasparent at some places - like the round corners of the buttons.
Black rectangle is just a Quad with black color diffuse material and it has 0.5f alpha…
Question is - why those buttons are not visible behind the rectangle whilst the background is???
BlendState used for background, buttons and rectangle (the same one for all):
BlendState alphaState = DisplaySystem.getDisplaySystem().getRenderer().createBlendState();
alphaState.setBlendEnabled(true);
alphaState.setSourceFunctionAlpha(BlendState.SourceFunction.SourceAlpha);
alphaState.setDestinationFunctionAlpha(BlendState.DestinationFunction.OneMinusSourceAlpha);
alphaState.setTestEnabled(true);
alphaState.setTestFunction(BlendState.TestFunction.GreaterThan);
alphaState.setEnabled(true);
Material for black rectangle:
quad.setDefaultColor(new ColorRBGA(0, 0, 0, 0.5f));//transparent black
MaterialState ms = DisplaySystem.getDisplaySystem().getRenderer().createMaterialState();
ms.setColorMaterial(ColorMaterial.Diffuse);
quad.setRenderState(ms);
quad.updateRenderState();
Thanks for any input or hints.. I have already tried some ideas from other thread.. like adding ZBufferState or setting render queue at Renderer.QUEUE_TRANSPARENT, but none worked for me so far...
Thanks..