Material Vector Expressions not working on Android?
We have started testing our scene settings on mobiles, and I have just came across a strange problem. We have decided to go with totally unlit scene, no lightmaps and no post-processing for our lowest performance tier. But what the scene really needs to look nice is some cool atmospheric perspecitve. So instead of using the fog I have decided to mix some predefined Fog Color directly into the materials, based on the objects' distance from the camera. And it basically looks like this:
But when I built it on my Xperia M the "fog" effect got ignored. It simply does not calculate the Fog Color into the shaders, and besides that, everything works fine. I have tested all 3 options for the Feature Level Preview in the Editor, and all of them work fine with my "fog".
And this is how it looks on the phone:
So where is the catch?
Hey rimau -
This is probably do to the UV math begin done through a pixel pipeline which has limits on mobile. If you go into your material attributes you can add a customized UV channel (if you are using any Textures better to add 2 that way you can not effect UV0). Take all the math for your Fog color and the MPC Parameters and plug that clamp into Customized UV0 (or UV1 depending), then create a UV coordinate with the exact and mask it to just the R channel and plug that into your LERP Alpha.
It should work as intended on mobile now. This is forcing the math to run on the vertex shader which has more options in mobile.
answered Dec 09 '14 at 04:17 PM
Lovecraft_K ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here