(Gold) Texture isn’t visible if alphaBlending=true

Software: Away3D 4.x

RIPI, Jr. Member
Posted: 18 July 2012 12:49 PM   Total Posts: 33

Hello!
I’ve just updated to the gold-release – now some textures are missing. I draw a custom BitmapData and assign it as TextureMaterial(Cast.bitmpapTexture..))
but it doesn’t appear.
I’ve figured out, that this is caused by alphaBlending = true.
I can see the Texture if i leave this line out – but i need the alphaBlending.. There is a plane of the same size with another transparent texture with z+1 in front of the plane. this second texture is also set to alphaBlending=true and does not appear, either..

Any ideas?

Thank you! wink

   

Richard Olsson, Administrator
Posted: 18 July 2012 01:10 PM   Total Posts: 1192   [ # 1 ]

What does the actual texture look like? I’m assuming it does have opaque pixels?

Is it possible that the objects could be occluded by another object because of faulty Z-sorting? Do you have any non-transparent objects in your scene, near the objects that should be blended?

 

   

RIPI, Jr. Member
Posted: 18 July 2012 01:22 PM   Total Posts: 33   [ # 2 ]

I’ve added two screenshots of the scene.

the two planes (256x512, on with a person, one with the white outline) have both transparent textures on it,
and a plane with a shadow at the bottom – the shadow is rendered with transparency. But overlapping shadows look wrong (not as good as they looked before…)

And this is some code:

private function _onAssembled(vo PersonVO) : void {
   _texture 
= new TextureMaterial(Cast.bitmapTexture(vo.assembledPerson.bitmapData));
   
_texture.alphaBlending false;
   
_texture.repeat=false;
   
_texture.mipmap=false;
   
_plane.material _texture;
   
_outline = new TextureMaterial(new BitmapTexture(_outFitModel.getOutlineFromId(_personVO.outfitID)));
   
_outline.alpha 0;
  
// _outline.alphaBlending = true;
   
_rollOverMesh.material _outline;
   
   
   
_hitTestMesh.mouseChildren true;
   
_hitTestMesh.mouseEnabled true;
   
//TODO: UPDATE MouseHitMethod
   //_hitTestMesh.mouseHitMethod = MouseHitMethod.MESH_CLOSEST_HIT;
   
_hitTestMesh.addEventListener(MouseEvent3D.MOUSE_OVER_onRollOver);
   
_hitTestMesh.addEventListener(MouseEvent3D.MOUSE_OUT_onRollOut);
   
_hitTestMesh.addEventListener(MouseEvent3D.MOUSE_DOWN_onMouseDown);
   
_hitTestMesh.addEventListener(MouseEvent3D.CLICK_onMouseUp);
   

   
_onArranged.dispatch();
   
visible true;
  

As an additional information – if it is important – this is the function where i reassign textures to my plane – the function is in a custom Mesh-Class, which contains those planes and the shadow, and some other information…

 

   

Richard Olsson, Administrator
Posted: 18 July 2012 01:34 PM   Total Posts: 1192   [ # 3 ]

I’m sorry but I don’t understand what is what in those screenshots. Is one before and one after the switch to Gold?

 

   

RIPI, Jr. Member
Posted: 18 July 2012 01:41 PM   Total Posts: 33   [ # 4 ]

i’m sorry for confusing you – both screenshots are after the gold release. I just wanted to show both textures - the person, and the white-outline-thing, which is kind of an overlay (z+1) for the person-graphic..

Here is a screenshot of how it SHOULD look wink
(and how it looked before the gold release)
when hovering the mesh the white ouline will appear..

 

   

Richard Olsson, Administrator
Posted: 18 July 2012 01:43 PM   Total Posts: 1192   [ # 5 ]

I see. Are you by any chance running this on a Macbook Air?

 

   

RIPI, Jr. Member
Posted: 18 July 2012 01:48 PM   Total Posts: 33   [ # 6 ]

No, it’s a Mac Pro… here the details:

Mac Pro 5,1
Mac OSX 10.6.8
2.8 GHz Quad-Core Intel Xeon
6 GB 1066 MHz DDR3
ATI RADEON HD 5770

Flex 4.6.0 with merged AIR 3.3 in FDT 5.5.2

if any of those information help..

 

   

Richard Olsson, Administrator
Posted: 18 July 2012 01:52 PM   Total Posts: 1192   [ # 7 ]

I see. Can you upload one of the textures that are being rendered as black somewhere for us to look at?

 

   

RIPI, Jr. Member
Posted: 18 July 2012 01:58 PM   Total Posts: 33   [ # 8 ]

yes, here is on of the 50 persons i use: LINK
I will do some research tonight with an empty project, just to try assigning the texture to a plane… i have to rush to a meeting now – but thank you for your time – i hope we can figure out what i do wrong wink

 

   

GiGBiG, Member
Posted: 18 July 2012 02:10 PM   Total Posts: 57   [ # 9 ]

Looks like I have a similar problem, even if I experienced it with the previous versions too (I have updated to the Gold): look at the attachment JPG.

I have a table with active areas and fiches on it: the fiches groups have a shadow, that is a 3D model with a simple texture on it, to simulate a very basic shadow effect. The texture has alphaBlending = true, obviously.
The active areas are plain models overlapping the table image, using a ColorMaterial with an alpha: when the mouse moves on them their color changes, and in some area of the table, about the top half of the stage an empty square appears around the fiches shadows.

In the image you can see a correct shadow on a highlighted area (green circle), and some wrong ones (red circles).

If I use a ColorMaterial without alpha this does not happen and the shadows overlap correctly.
Do I miss a setting?

 

   

Avatar
Matse, Sr. Member
Posted: 18 July 2012 02:29 PM   Total Posts: 149   [ # 10 ]

GiGBiG you shoudn’t need alpha for this : just set the shadow material’s blendMode to BlendMode.MULTIPLY.
No need for alpha in the texture either : black will be opaque black, white will be fully transparent.

Not sure what causes your problem though, but for shadows the multiply blendMode is perfect and it prevents any alpha issue. I didn’t check but I would guess that it’s lso better performance-wise.

 

   

GiGBiG, Member
Posted: 18 July 2012 02:34 PM   Total Posts: 57   [ # 11 ]

Nice idea, but I have to use alpha anyway, as in some cases I have to change the shadow opacity, as I use the same shadow for dices too: dices too cause the same problem.

 

   

Richard Olsson, Administrator
Posted: 18 July 2012 02:36 PM   Total Posts: 1192   [ # 12 ]

GiGBiG I don’t see how this is related. You are getting alpha in your use case, whereas RIPI is not getting alpha on his textures. Please create a separate thread for any issues you might be having.

 

   

GiGBiG, Member
Posted: 18 July 2012 02:43 PM   Total Posts: 57   [ # 13 ]

Ok, sorry.

 

   

Avatar
David Lenaerts, Administrator
Posted: 18 July 2012 02:54 PM   Total Posts: 80   [ # 14 ]

Hey,

I pushed a *possible* fix in the “dev” branch. Could you check out if that does fix it? It seems to be very system dependent.
If it still doesn’t work, to narrow down the problem, could you:
1) set material.alphaPremultiplied = false; (if this works for you, it’s *not* a fix, but just a means to verify the problem area)
2) send us a swf showing the problem, just for us to double-check if it occurs on our machines and we’re not just looking in the wrong place to get it reproduced.

Thanks!
David

 

   

GiGBiG, Member
Posted: 18 July 2012 06:00 PM   Total Posts: 57   [ # 15 ]

Are you talking to me or to RIPI? smile

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X