Material Texture: Normal/Specular

Software: Away3D 4.x

Avatar
SharpEdge, Member
Posted: 26 November 2012 06:25 PM   Total Posts: 94

Sorry but i’m a newbie with Away3D, i’m developing a 3d viewer and from what i’ve understood you have to assign manually normal and specular map, is it true?
I need some 3d format that loads automatically not only the diffuse map but also normal and specular maps and maybe also glossiness, specular, ambient parameters, is it possible?

Sorry for bad english, thank you in advance.

EDIT:
that’s what i’ve implemented to load dinamycally normal and specular maps

private function onAssetComplete(e:AssetEvent):void
  {   
   
if (e.asset.assetType == AssetType.MESH{
    
var mesh:Mesh e.asset as Mesh;
    
meshVec.push(e.asset.name);
    var 
nmurlReq:URLRequest = new URLRequest("Model/"+e.asset.name+"_NM.jpg");
    
AssetLibrary.load(nmurlReq,null,e.asset.name);
    var 
smurlReq:URLRequest = new URLRequest("Model/"+e.asset.name+"_SM.jpg");
    
AssetLibrary.load(smurlReq,null,e.asset.name);
   
}
   
else if(e.asset.assetType == AssetType.MATERIAL)
   
{
    
var material:TextureMaterial e.asset as TextureMaterial;
    
material.shadowMethod = new SoftShadowMapMethod(dirlight29);
    
material.lightPicker = new StaticLightPicker([dirlight]); 
    
   
}else if(e.asset.assetType == AssetType.TEXTURE)
   
{
    
if(e.asset.assetNamespace != "default")
    
{
     
var mesh:Mesh AssetLibrary.getAsset(e.asset.assetNamespace) as Mesh;    
     
     if(
e.asset.name.indexOf("NM") != -1)
      
TextureMaterial(mesh.material).normalMap e.asset as BitmapTexture;
     else if(
e.asset.name.indexOf("SM") != -1)
      
TextureMaterial(mesh.material).specularMap e.asset as BitmapTexture;
    
}
   }
  } 
   

Avatar
SharpEdge, Member
Posted: 27 November 2012 06:25 PM   Total Posts: 94   [ # 1 ]

No one? could you just tell me: “no it’s not possible”

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X