Hi, I just started using jme on Android and ran into a problem when I played around with transparency:
I have a simple .obj file with two cubes, this is my code:
ColorRGBA sky = new ColorRGBA(1f, 1f, 1f,1f); viewPort.setBackgroundColor(sky); Spatial cubes = assetManager.loadModel("models/cubes.obj"); Material cubesmat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); cubesmat.setColor("Color", new ColorRGBA(0f, 0f, 0f, 0.25f)); cubes.setMaterial(cubesmat); cubesmat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha); //stuff i tried to fix the problem cubes.setQueueBucket(RenderQueue.Bucket.Translucent); cubesmat.setFloat("AlphaDiscardThreshold", 0.05f); renderManager.setAlphaToCoverage(true); rootNode.attachChild(cubes);
When I look at it from one side it looks fine:
(Sorry, new users can only put one image in a post.) - see reply
But when I rotate the view and put the other cube in front the transparency doesnt work as expected:
Any help would be appreciated!