I've just experienced a very strange issue on this device where ALPHA and MODULATE compositing mode blendings are reverting to REPLACE when another compositing mode is used with the REPLACE mode.
Here's a test summary.
I have a simple quad mesh with a 24-alpha texture applied to it. The texture is loaded as an Image to get around the Loader bug.
midpImg = Image.createImage("/tex.png"); image2d = new Image2D(Image2D.RGBA, midpImg); texture = new Texture2D(image2d); texture.setBlending(Texture2D.FUNC_REPLACE); compositingMode.setBlending(CompositingMode.ALPHA);
Another similar mesh has a non-transparent texture, loaded exactly the same way, the only difference being:
1) When I draw just the alpha mesh, it looks as expected - with the background showing through the transparent parts of the texture.
2) When I draw the solid mesh before the alpha mesh, the transparent parts become black which is the transparent colour value. The background colour is different - so it's not the background I'm seeing.
3) When I now stop drawing the solid mesh, the alpha mesh is still drawn non-transparent.
Even creating the transparent mesh on the fly during each render frame results in the same issue.
As a further test I changed the first mesh to use CompositingMode.MODULATE, to try and pin down the issue. The same problem occurs - 1) it's ok, 2) it reverts to REPLACE, 3) it gets permanently stuck in REPLACE mode.
These tests were done with a background colour clear only. Each compositing mode additionally has:
I'm not able to reproduce your problem. Does it make any difference what textures you are using or how you load them? Could you post a full code example, that demonstrates the bug?
I'll see if I can put some test code together. This kind of test app is starting to look useful with the amount of weird bugs I get I suspect there are underlying bugs in the device's software renderer that only become apparent when you have certain combinations of textures/appearances/compositing modes/polygon modes etc.
The textures are indexed but I also have an RGBA image for a different texture and this has the same problem. They're not being loaded with Loader.load().
It's very strange: W710, K800 are fine. K610, W810 are broken.
I've managed to solve this but there seems to be a bug with this firmware (R1AA049) as I don't need the workaround for a different K610 device I tried.
In my sample code I paint a quad with an opaque texture, then one with a transparent texture.
If depth writing is turned off for the opaque quad then the 2nd quad doesn't appear transparent unless FUNC_MODULATE is used for the blending mode
This is irrespective of whether a depth buffer is even used!
Can anyone explain why this would happen? Maybe then I can find a better workaround because I'd rather not use modulate unless I have to.
private static final void initTest1() { try { CompositingMode solidCompositing = new CompositingMode(); solidCompositing.setBlending(CompositingMode.REPLACE); solidCompositing.setColorWriteEnable(true); solidCompositing.setAlphaWriteEnable(false); solidCompositing.setDepthTestEnable(false); // solidCompositing.setDepthWriteEnable(false);