AWD2 loading problem

Software: Away3D 4.x

seti3d, Newbie
Posted: 11 December 2012 04:49 PM   Total Posts: 19

Hi,
I’m using away3d 4.09 gold and for 3DS Max the awd-exporter.
When exporting a single model (without any animation) I activate in the export tool to generate HTML and Flash preview to see what I get. One example of the awd-export you can see in SOV2.jpg
Importing this model with away3d looks terrible (see SOV.jpg).

Has someone an idea why there is that big difference?

 

   

Avatar
Fabrice Closier, Administrator
Posted: 11 December 2012 08:24 PM   Total Posts: 1265   [ # 1 ]

It’s the same model with diffuse colors only. Light information is not saved into the awd file.
Add a lightPicker with light(s) to your materials. either on event received, using LightHelper or custom code. Take a look at the many examples, search this forum or use Prefab to see how its done if you never did it before.

   

seti3d, Newbie
Posted: 11 December 2012 11:06 PM   Total Posts: 19   [ # 2 ]

Thanks Fabrice!

You are right if you say it’s the same mode. It IS the same model. Both are the same awd-file shown with different viewers. The left one the exported awd-file shown with the generated “html - javascript - flash-addon” from 3DS Max awd-exporter and the right image shows the same awd-file imported in away3d and displayed via flashplayer.

When I create objects with 3DS Max I don’t use textures but create the materials with the mat-editor. I just use Max for designing objects without camera or lights as I export them and use the models in external programs like Quest3D (something like unreal engine or unity). So lights, cameras etc. I set in those applications.

That means I have no textures to set - it’s just material. The difference in both pictures is for example that the angles aren’t round and some forms are malformationed (best to see the blue part top of both models).
Later in the office I can attach both versions (html and swf) so you can see the difference live.

   

Avatar
Fabrice Closier, Administrator
Posted: 12 December 2012 09:54 AM   Total Posts: 1265   [ # 3 ]

The exporter preview that you are reffering to, sets default lights definition. Once declared (from the awd definition), like in Away3D, the materials are just diffuse with no lights. The player code assign one or more light once added to scene.
The awd file on itself does not hold light information at this state (specs 2.0). So when you load your project, unless you specifically assign lights, they will be displayed with no lighting. flat. Unlike in a controled environement such as your editor where lights are set to give you a better sens of volumes, away3d has no idea that you actually want to set lights. There are tons or cases where you do not need them. Even if an awd2 would hold light information, that does not even say you would want to use them.

For instance, imagine if a designer would create, sell a 3D model in a the awd format and add lights to make it look good so you buy it. Now in your scenery, you have already lights simulating another mood/daytime. Adding the file lights by default would certainly conflict with the ambiance that you try to create. You would even be forced to code some clean up routine to kill lights that you do not even need.

Your second remark is actually similar to the lights. The player probably has an antialiasing value set by default in its code, simply because the dev behind it decided that most projects do need AA. Away3D again, will not apply AA by default because you might not want to. For instance, if you dev for mobile, where AA is unsupported (on exception of few hardwares), you want during development to be able to see the exact same result on desktop as on the device.

Your project probably doesn’t have AA set, that’s why the shape is being “jigsaw” drawn, especially noticable on small viewports sizes such as the picts that you posted.

   

Avatar
SharpEdge, Member
Posted: 12 December 2012 09:59 AM   Total Posts: 94   [ # 4 ]

Fabrice is telling you that’s not a deformed model but just the effect of missing lights in you away3d scene. you must add them in your code.
Example:

var pointlight PointLight = new PointLight();
pointlight.200;

scene.addChild(pointlight);
var 
lightpicker StaticLightPicker = new StaticLightPicker([pointlight]);

model.material.lightPicker lightpicker

Without lights in your scene your objects will always look like this.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X