I create an Away3D (4.0.0 Beta) project with AIR 3.3 (Beta) for iOS.
I load a few colored objects and display them with a ColorMaterial. Everything works fine so far.
But If i change the alpha values of the materials to something below 1.0, they become gradually more and more green (while also fading out).
compare these screenshots:
image 1 rendered with alpha = 1.0
image 2 rendered with alpha = 0.5
it’s to note, that at 0.99 the colors are still fine (just some wrong z sorting occurs, which is as expected as the meshes get rendered without zbuffer) and get greener (and more transparent) the lower the alpha value goes.
I confirmed that the blendfactors used for rendering the meshes at alpha<1.0 are SOURCE_ALPHA and ONE_MINUS_SOURCE_ALPHA, as it should be.
Also I checked what happens if i set alpha=0.5, but force the blendfactors to be ONE and ZERO. In this case, the colors stay correct (but of course no blending happens) - this means that the fragmentshader doesn’t seem to be the cause of the greenish color, as it doesn’t change the RGB values of the fragments if the alpha value is changed. So - it has anything to do with the blending - but i can’t figure out what.
I observe the same behaviour if I compile with AIR 3.2.
It’s as if the blendoperation would apply different functions to the different color channels.. but I don’t know what could cause this.
Anyone knows this problem or has an Idea what could cause it?
//edit: interesting to note on the screenshots:
the only totally black item (the rail tracks) become green too (and visible over the black background) when the alpha is set to 0.5
//edit2: I use a postfilter (blur) on the scene, therefore the Filter3DRenderer is used, the scene gets first drawn into a texture and this texture gets then drawn to the backbuffer. If i don’t use the postfilter (blur) and therefore don’t use the Filter3DRenderer, the blended objects don’t get greenish