Target Textures, make PNG Texture transparent

Software: Away3D 4.x

dubletar, Member
Posted: 13 May 2012 09:37 PM   Total Posts: 73

Hi again All,

I am loading a 3d Object. However, the texture it uses is png. Its fine in 3DS Max, but when loaded in Away3D the [black] transparency is ignored.

Anyone know how to target the texture on load and make transparent?

private function initObjects():void
{

Parsers
.enableAllBundled();
loader = new Loader3D();
loader.load(new URLRequest(globals.vars.objectsPath 'orionPlanet.obj'));
   
loader.addEventListener(LoaderEvent.RESOURCE_COMPLETEonFullyLoaded);
   
}

/**
 Completely loaded
*/
private function onFullyLoaded (event:LoaderEvent):void
{
var object:ObjectContainer3D ObjectContainer3D(event.target);
theView.scene.addChild(object);
   

marronnier, Newbie
Posted: 14 May 2012 08:45 PM   Total Posts: 17   [ # 1 ]

You can use .png-file with alpha channel (transparency).
And use ‘alphaThreshold=0..1’ or ‘alphaBlending=true’ properties of TextureMaterial.

   

dubletar, Member
Posted: 15 May 2012 11:48 AM   Total Posts: 73   [ # 2 ]

Thanks, but I don’t know how to target the texture to do that.

Anyone?

   

Vice, Member
Posted: 15 May 2012 01:12 PM   Total Posts: 58   [ # 3 ]

map the material of the loaded mesh e.g.:

var mat:TextureMaterial = mesh.material as TextureMaterial;
mat.alphaThreshold = 0.5….

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X