material issue. exported class prefab2.

Software: Away3D 4.x

su43berkut17, Newbie
Posted: 25 June 2012 05:06 PM   Total Posts: 6

Hello,

I’m working on an ar project in away 3d with in2ar. I exported my model in 3dsmax and imported it on prefab, fixed some maps/added a light and exported it as an actionscript file.

It works fine and the model loads perfectly into my application, however I see no specular reflections from the light.

I added a StaticLightPicker and added a pointlight to it, then i assigned the staiclightpicker to the lightPicker from the material on my mesh, now the specular reflections appear but the diffuse map is nowhere to be seen, its all black. I attach the screenshot of both cases and some code:

In this one i dont use the lightmap, and i can see the flat diffusemap.

var Female_Digestive_Liver_Geo_Bitmap:Bitmap Bitmap(new Female_Digestive_Liver_Geo_Bitmap());
   
material generateMaterial("mat1"NaN Female_Digestive_Liver_Geo_Bitmap.bitmapData);
   
TextureMaterial(material).mipmap true;
   
TextureMaterial(material).smooth true;
   
TextureMaterial(material).repeat false;
   
TextureMaterial(material).alpha 1;
   
TextureMaterial(material).alphaBlending false;
   
TextureMaterial(material).normalMap = new BitmapTexture(Bitmap(new Female_Digestive_Liver_Geo_NM_Bitmap()).bitmapData); 

in this one i can see the reflections but no diffuse map.

var Female_Digestive_Stomach_Geo_Bitmap:Bitmap Bitmap(new Female_Digestive_Stomach_Geo_Bitmap());
   
material generateMaterial("mat2"NaN Female_Digestive_Stomach_Geo_Bitmap.bitmapData);
   
TextureMaterial(material).mipmap true;
   
TextureMaterial(material).smooth true;
   
TextureMaterial(material).repeat false;
   
TextureMaterial(material).alpha 1;
   
TextureMaterial(material).alphaBlending false;
   
TextureMaterial(material).lightPicker cojedorLuz;
   
TextureMaterial(material).normalMap = new BitmapTexture(Bitmap(new Female_Digestive_Stomach_Geo_NM_Bitmap()).bitmapData); 

also this is the staticlightpicker

luz = new DirectionalLight(000);
   
luz.+= 40;
   
cojedorLuz = new StaticLightPicker([luz]); 

So far i added only 1 light to the staticlight picker, didnt find any ambient light to be added, maybe thats the issue?

Any help is appreciated, thanks! :)

 

   

su43berkut17, Newbie
Posted: 25 June 2012 07:34 PM   Total Posts: 6   [ # 1 ]

never mind, solved it ^^

apparently the lights have an ambient option and by default its 0, so thats why its black. changed the ambient option to .3 and now it works good ^^

   

Avatar
Fabrice Closier, Administrator
Posted: 26 June 2012 08:06 AM   Total Posts: 1265   [ # 2 ]

I’m about to push an update, I’ll look at this ambient default, as it shouldn’t be 0 (unless you set it this way).

Oh and one detail, try to post Prefab’s related threads into Prefab forum please.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X