Away Builder doesn’t export normal and specular maps

Software: Other

Boyan, Newbie
Posted: 15 August 2013 01:04 PM   Total Posts: 18

Hello to all,

That’s what I do:

In Material/Colors & Textures section I choose specular texture file and normal texture file. They are shown like a thumbnail in the corresponding slot.
Then in export settings I check Embed Textures, Include normal data and Include Tangent data.

In Away3D 4.1 Gold I have the following code:

Parsers.enableAllBundled();
loader = new Loader3D();
  loader.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onComplete_loader); 
loader.loadData(model1);
 
private function onComplete_loader(e:LoaderEvent):void
{   
for(var i:int = 0; i < loader.numChildren; i++)
{
var tMesh:Mesh =(loader.getChildAt(i) as Mesh);
 
if (tMesh && tMesh.material)
{
  trace((tMesh.material as TextureMaterial).normalMap);


The output of the trace is null and there are no normal and specular maps in the rendered scene.

Have I missed something?

Thank you in advance.

   

Avatar
80prozent, Sr. Member
Posted: 15 August 2013 02:07 PM   Total Posts: 430   [ # 1 ]

Hi

Have you tried to load the file back into awayBuilder ?

i just tried on a simple model (only specular and normal maps) and they reloaded fine in awayBuilder.

 

 Signature 

sorry…i hope my actionscript is better than my english…

   

Avatar
80prozent, Sr. Member
Posted: 15 August 2013 02:10 PM   Total Posts: 430   [ # 2 ]

trace((tMesh.material as TextureMaterial).normalMap);

ah…the material is only a TextureMaterial, if it has either a diffusetexture or a ambientTexture, but both Materials (textureMaterial and ColorMaterial) can have normal and specular map.

so you should try to trace out like this:

trace((tMesh.material as ColorMaterial).normalMap);

but that doesnt change the fact, that the both maps should be visible (you can only see them when having a light applied….)

hope that helps….

 

 Signature 

sorry…i hope my actionscript is better than my english…

   

Boyan, Newbie
Posted: 15 August 2013 02:22 PM   Total Posts: 18   [ # 3 ]

Well, the awd file reloads fine in AwayBuilder, with all the normal and specular maps, so maybe the title of my topic is wrong, but these maps still don’t load in Away3D, by unknown reason.

Sure I apply a LightPicker to the materials.

Until now I use some naming convention for my material names in 3ds max, and textures, so according to their names the specular and normal maps are added in a programmatic way, but that is clumsy and i hoped that AwayBuilder would make things significantly easier.

 

   

Avatar
80prozent, Sr. Member
Posted: 15 August 2013 02:29 PM   Total Posts: 430   [ # 4 ]

hm

the awayBuilder is using the AWD2parser from the Away3d engine, so if its load there, it should load fine in the engine too,

you can send me the file ? so i can have a look ?
80prozent[a]differentdesign.de

 

 Signature 

sorry…i hope my actionscript is better than my english…

   

Boyan, Newbie
Posted: 15 August 2013 03:06 PM   Total Posts: 18   [ # 5 ]

I sent you the file - tested it in Away3D 4.1 environment and no specular and normal maps are found, the light picker also is missing…

 

   

duckdoom5, Newbie
Posted: 11 September 2013 08:23 AM   Total Posts: 6   [ # 6 ]

I’ve got exactly the same problem, but not only with specular, but also with shadows.

Anyone any idea?

 

   

duckdoom5, Newbie
Posted: 11 September 2013 08:51 AM   Total Posts: 6   [ # 7 ]

Ok, I’ve found out, that you can’t put “0” as level or gloss because it will be automatically reset to specular level: 1 and specular gloss: 50.

The shadows are still weird, so I will find out whats wrong with that too.

 

   

Avatar
80prozent, Sr. Member
Posted: 11 September 2013 09:15 AM   Total Posts: 430   [ # 8 ]

Hi
Yes, the issue with gloss = 0 is known and allready fixed on github ( along with some other minor fixes for default values…). Should be fixed with the next release of awaybuilder. ...
I could not reproduce the issue with the not svaing normal/specular textures….
Can you tell me more about the issue you are having with the shadows ?

 

 Signature 

sorry…i hope my actionscript is better than my english…

   

duckdoom5, Newbie
Posted: 11 September 2013 08:42 PM   Total Posts: 6   [ # 9 ]

I’ve never had any issues with the normals/specular textures, just with those values not saving. Sorry for that, its probably not “the exact same issue” raspberry

About the shadows. (This might be better off in another topic cus it doesn’t seem to be any problem(s) with the builder saving / setting standard values.)


Ive uploaded a few screenshot showing my problem.


So the first one is a screen shot of the shadow in the builder (so as it should show up in the game itself right?).

The second one (top-right) is a screenshot of the shadow as it looks in game. (with far value 5000)

I’ve been looking around the forum and found out that the far value does actually affect the shadow quality, so I’ve set the far value to 1000 (bottom-left) (I’ve tried less, but it didn’t affect the quality anymore, so I kept it at 1000)

In the first 3 pictures I’ve been using a FilteredShadowMapMethod with a DirectionalShadowMapper with a depth value of 2048.

I should probably add here that the shadow of picture 3 looks kinda the same as the builder example BUT with a lower depth value, it looks as the second picture again.

The last picture was more of a “quick fix”. In the last picture I’ve used a DirectionalShadowMapper with a depth value of 2048 and the SoftShadowMapMethod values: Alpha: 0.9; Epsilon: 0.7; Samples: 24; Range:5; That made it kinda look the same.


This is the code for setting up the camera:

_view.camera.lens = new PerspectiveLens(80);
_view.camera.lens.far 1000;
_view.camera.lens.near 1


I hope I’ve informed you enough about the shadows. If the screenshots aren’t clear enough, I can send you more screenshots / an example build.

Thanks in advance,
Duckdoom5

 

   

Avatar
80prozent, Sr. Member
Posted: 15 September 2013 01:07 PM   Total Posts: 430   [ # 10 ]

Hi

sorry for late reply…

i didnt really had the time to have a closer look into this…

to me, the third picture (bottom-left) looks very much the same…

so i think the problem might be the camera settings.
as you said, the camera.lens.far/near seams to have a affect on the look of the shadow. i think atm there is no way to know the exact camera.lens.far/near of the awayBuilder-camera…

this issue will be much easier to inspect, once we have selectable cameras in awayBuilder (atm you can create cameras, but you cannot define them as active camera to view the awayBuilder-scene with)

 

 

 Signature 

sorry…i hope my actionscript is better than my english…

   

duckdoom5, Newbie
Posted: 16 September 2013 10:41 AM   Total Posts: 6   [ # 11 ]

Yeah as I said: “I should probably add here that the shadow of picture 3 looks kinda the same as the builder example BUT with a lower depth value, it looks as the second picture again.”

Thanks for you help anyway.

I’ve implemented a “quick fix”, by using the SoftShadowMapMethod. I’m checking if the depthmap value is 2048/1024/512 and then editing the shadow settings to get the best looking shadow for that depthmap.

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X