Away3D lighting

For 2 weeks straight I been busy with Away3D, a 3D engine for ActionScript 3. This makes it easier to create 3D applications for the internet.


At my internship at the <TheFactor.e> they put me on Away3D. Developed by Fabrice Closier, a colleague.

Today I was busy with a project and I struggled with lightning. I had a plane and I want to light it out from the rest of the planes, but the big problem of lightning is that the 3D engine is calculating how much light every vertex gets from a light source. For a sphere this works very well because it has many virtices, but for a plane with only 2 virtices it looks strange to use light.

I have here 2 examples that shows my point. A sphere in 3D with light:

sphere 3d light away3d

sphere 3d light

And now I put the same light (a little bit brighter) on a white plane:

plane 3d lighting away3d

plane 3d light

You see that it is ugly because it looks like 2 triangles against each other in a different colour. The right way would be if there is a gradient from the down left corner to the middle of the plane.

This problem is with every ActionScript 3 3D engine because if you calculate like I point out it gets to heavy to render and you get 2 frames per second. But Fabrice promised that in the future they are changing the lighting model at Away3D and lighting will look nicer. Till than I can’t use lighting for planes.

–small update–

At this links you can find the development of the smooth light, it looks awesome:

Author Bio

Leave a reply