Lights and performance on mobile devices

Software: Away3D 4.x

BojanCG, Newbie
Posted: 21 July 2014 01:21 PM   Total Posts: 9

Hello!

We’re developing Away3D + Starling based game. Until now we have been using textures for simulating (baked) lights, but we want them to be dynamic. I’ve been studying examples from Github and most of them works like a charm. However, when I add lights to our application I encounter two problems. To be exact, only one pointLight.

1. Performance on mobile devices goes way down. From 60 fps to only 15 max. There is between 12.000 and 25.000 polys on the scene. Data is from awayStats. Models are using same textureMaterial and this happens if I add only one light. It is same for directLight and pointLight.

2. Light reflection looks really bad. Mesh faces can be seen. I’m providing an image with an example. Models are AWD2. Tried AWD1, same thing. Tried to export them using Prefab3D and Away Builder. Only time they looked beautiful is when I subdivide the mesh in Blender, but then my poly count is 3-4 times bigger. I’m hopping that good result can be achieved in some different way than boosting poly count that would damage performance.
Another thing I tried was using a specularMethod, but with no success:

var specular:FresnelSpecularMethod = new FresnelSpecularMethod(true, new PhongSpecularMethod());
textureMaterial.specularMethod specular

Advices and corrections are more than welcome. Away3D 4.1.5/4.1.6 is used
I’ll provide additional info if needed.

 

   

Avatar
Fabrice Closier, Administrator
Posted: 21 July 2014 02:28 PM   Total Posts: 1265   [ # 1 ]

1: lighting (as programmed in away3d) on mobile is very (too) expensive.
you will have to look at writing dedicated shaders using simple operations if you really want some kind of dynamic lighting.

2: Your model needs to be welded. Try in Prefab to select/rightmouse-click Weld. Subdividing if not welded, will sure enhance by the subdivision factor, yet problem will remain and will add more data.

 

   

BojanCG, Newbie
Posted: 28 July 2014 11:12 AM   Total Posts: 9   [ # 2 ]

Thank you Fabrice.

I managed to get decent performance using only one light. The problem was that I was adding light picker to materials that were not really needing lights, so when I added light picker only to one material I needed to have lights, everything worked much better. However, lights really are too expensive on mobile, adding more than one light decreases performance significantly and I don’t see any more tricks that would give me good performance with 2 lights.

As for the second problem, welding didn’t help, it would say 0 vertices were removed. Since model and reflections were showing perfect in Away Builder I decided to export model together with light and it worked. Reflections are now smooth with same low poly count. You can see it in attachment. Not sure why though…

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X