Android spotlight

Hello!

I’m Rui.
This is my first post so i hope i’m making this questions in the right forum section!
I’m currently developing a game for Android. I’ve implemented self made culling scripts and reduced drawcalls with atlas textures and reduced models verts/tris and combined meshes for “room static objects” and i’m also using lightmap for static objects (i disable “static lights” when im compilling cause i noticed it improves performance) ending up boosting my fps to 800/900fps (with flashlight ON) on my PC development window. The problem is when i do the same on my mobile phones… When i compile it for my android phones i end up getting 56 to 62 fps with flashlight off (wich looks normal) and only 30 to 45fps with flashlight ON (it doesn’t feel smoth at all). I use a real time light (spot type) for this purpose and i specify the layers i want to be affected. Are this results somehow normal? can someone give me a clue on what should i look for?

the higher tris/verts value are due to the map walls (the whole map is in one single mesh (not the objects within… only floor,roof walls)… im currently splitting into modules/rooms), but, this is not the problem because i hided the map renderer and put a simple square with texture in the floor and it did the same fps drop!



with Pixel Light Count = 1 does the same… i only have this flashlight as real time light in game…

Rendering path: Forward
Dynamic Batching: on

i disabled all GUI stuff cause i read about it slowing down on mobile phones but the problem persists so i guess it is not related…

ps: do you know how do i change my forum name? i cant find the option and i mistook the name…

maybe i was not clear in my question. what i wanted to know is if there is some “special” setting that i probably forgot to change that could cause this fps drops… the tris/verts/drawcalls don’t seem that high compared to what i’ve been reading…

also. i would like to know if someone knows how many tris/verts can a mobile device handle (average approximate value… doesnt need to be real exact value!) when affected by one real time light without droping fps drastically.

currently tested on: quad-core Tegra 3, Quad-Core MT6589 (sgx 544), dual-core Tegra 2, snapdragon single core + adreno 205
does the same in all but smoother in Tegra 3. the above data is from MT6589 (my main device).

I have new interesting data… i think this is related to multi-core. On the multi-core devices it lags when i turn the light on. on single core it dropped more or less 5fps only and kept smooth)…
if i turn muzzleflash light ON + flashlight ON and fire the whole clip of my machine gun (multiple light sources at a time cause of muzzle+fast attack speed) i get interesting results:
Quad-core devices: (both tegra3 and Mediatek 6589) goes down to 15-17fps. it looks laggy!
Single core: minimum fps it reaches is 35 and keeps the playing “smooth”.

does someone have experience with this? a clue would be amazingly apreciated! i’ll keep searching meanwhile!

thank you…!
Rui

i’ll try to add some personal multithreading… it looks like this might be the problem!!! I guess it is only taking advantage of one CPU.
Althought my single core is only 1Ghz and quad-cores 1.2Ghz, this single core phone has lower screen resolution (480800 compared to 8001280) so it also has less pixels to handle lightning… thats probably the reason why fps dont drop so much in the single-core compared to quad-core (needs less calculations)… i thought unity engine was already doing this by default with each object.

if someone thinks i’m wrong and has a better explanation/solution please let me know! meanwhile i will try to add some multi-threading!

thank you once again and sorry for this messages/auto answers.
Rui

After hours working on this trying to figure out what could possibly make this i ended finding it is something really simple! I ended up disabling every single object ending up with only 1 spot light and 1 mesh (135tris) and camera on screen (all scripts disabled). the lag was still noticable! that made me see i have no script problem and multithread would not solve this issue! i will implement multithread anyway for performance boost on dual core+ devices but the problem for this particular issue seems to be the shader! i guess diffuse shader is using float. I’ve never programmed a shader so this will be a nice chance to improve my skills further.

thank for the help! (ironically)
i didnt ask others to solve this for me. i just asked for a “tip” where to look for. i’m disapointed with comunity support.
Rui

For the ones who have the same problem in the future here is what i found.

→ Shader is the problem. You need to buy / make a shader yourself to boost up performance (better do it in GLSL for android).
→ VSync every second VBlank can stop this! i’m using default Diffuse shader. i made a personal “extense Quality Settings in app changer” so i could try different settings in a fast way on my android phones and i managed to find that VSync droped my fps to constant 30/35 (i know it was over 30 but i dont remember exact values) but it got extremelly smooth even when im using the spotlight! without VSync with a Spot Light ON fps were about 45 to 55 but it was not smooth at all!

Demo version of my game will be launched in 2 days (after 1 month and half in closed beta). This was my only major problem so now that performance is nice&smooth i’m ready to go to “open beta”. Now i just need to fix some anims and behaviours and i’ll be ready to launch demo version!

Thanks,
Rui

*Edit: i said VSync but the one that make it smooth is the VSync every second VBlank