Upgrade to Unity4 removes fog on android 2.3

Upgraded project to Unity 4 and now fog doesn’t work on my 2.3 test device. Other devices with android 4.0 > it’s showing up correctly.

Tried extracting the terrain shaders from unity 3 into the project but problems remains.

Any ideas?

Here is the confirmed fogbugz
https://fogbugz.unity3d.com/default.asp?545308_n5dn5avpvd69jjqf

Hope it will get sorted soon

Unlike the original bug report, I observe the same under Android 4.0.3 and 4.2.2 with Exp2 fog and Android “Minimum API Level” set to 2.3.1 (level 9) — even with 17 too, though, and also with Linear fog.

Basically, no kind of fog works on any Android version with Unity 4.2.0f4 as far as I can tell. Seems like there is no outrage — is no one using fog anymore? Am I using outdated techniques? Is everyone still using Unity 3.5? Is everyone doing 2D scrollers these days? Or what?

This is a big bummer! Hopefully they will push a hotfix update for this rather soonish. Pretty substantial bug if you ask me. Most of us need fog for sensible fading of almost-distance-culled objects. Already been 2.5 months since that bug was first reported and here I am, suffering from it… :frowning: :frowning:

Most folks dont use fog on mobile platforms.

Yeah probably not… but:

  • I see some slight distance fog in “Riptide 2” and some heavy fog in Subway Surfers

  • seems like it worked prior to Unity 4 (a great many folks are still on 3.5 and have never updated) so I do think it’s a pretty bad bug that should really be addressed soonish…

Yeah there are a few games on mobile that utilize it for sure. Overall I don’t think the majority do though, due to it’s performance overhead. If you can afford to have a team of industry experienced pros who can implement custom fog it’s doable. When I say this I mean using programmers to come up with neat much less expensive solutions like using custom shaders that work out the distance a vertex is away from the camera and then apply a fog color to the geometry.

This is what one of the most awesome-looking Unity mobile game’s developer had to say about mobile fog. Recommendation from ShadowGun creators about fog: Fog effects - avoided. Single planes that fade in and out are used to achieve cinematic fog effects without actually rendering any fog.
This is faster because the planes are few and far between, and it means that fog doesn’t have to be calculated on every pixel and in every shader.

For the most part the vertex shader implementation would work the same and be very optimal for mobile.

Well you’re totally right, all it takes is a custom vert shader. That’s not even a lot of black magic in my case. I kind of assumed that if there’s something “built-in” then probably it’s the most heavily optimized, fine-tuned implementation known to the industry. But on second thought, that’s actually a pretty handsome assumption on my part…

Well I do believe the fog Unity uses was initially built at it’s core for PC and Mac builds…much like the terrain engine. They more than likely modified a few things to get it to work on mobile devices, but I don’t know if it’s the most optimal solution for mobile. People still have issues with the terrain engine performance on mobile platforms. I would assume (dangerous I know) that the fog implementation is similar. You did address a serious bug though for mobile deployment and hopefully it gets sorted. In the mean time I suppose it means one can come up with more optimized creative solutions to fog on mobile :).

I can confirm that the fog issue is indeed a bug that our developers are looking at as we speak, hopefully the issue will be resolved soon.

You can also color a vertex based on it’s distance from camera fairly quickly.

I still use Unity 3.5, because of performance and Arm6 support, so this doesn’t affect me.

But since you guys are talking about Fog bad performance… Is that really a thing? You could always use shaders but you would have to use OpenGL ES 2 right? And would it be much better than fog?

Don’t a majority of devices today use OpenGL ES 2? I thought OpenGL ES 3 was the new cutting edge thing?

Yes. But a significant share of my user base only has Arm6 and OpenGL ES 1.x 澳门·350vip浦京集团(中国)有限公司

Since someone from Unity QA replied via email back to me enquiring about this issue, I should let this thread know about the fog status over here.

It’s really strange — at my end the problem persisted for a whole two days, for both HTC One V and HTC One M7, for all kinds of fog, with very visibly strong near-distance fog clearly visible in Game View. Nothing helped. Fog didn’t show on the phones.

Then all of a sudden the problem was gone from one day to the next! Same project, no changes to fog settings or phones or project settings.

As of yesterday fog is back for both Android 4.x versions and devices for me. Strange situation indeed, kind of a Heisenbug? Maybe it was the Windows restart that did it, no idea. Will let you all know if I do run into this again, which I hope I won’t.

One way or the other, in full resolution now that the fog started showing up, it also seemed to immediately eat some 10 FPS or so apparently, but oh well… that’s another oddity for another day :smile:

I have the same issue on both Xperia S and Samsung S3, but in my case the fog depends on the view angle (y) of the camera.

The report has been closed - hope it’s included in the next unity release

This hasn’t been fixed yet. Any news on that?