I've tried all types of fog, but nothing is showing up on my Samsung WP8 device. I noticed when I changed to Windows Phone as a target, fog had been unselected. Is it supported?
Hello. The default fog is indeed not supported on WP8. However, if it's really necessary, you can write your own shader for it.
Thanks for that. I'm not much of a shader programmer. My game looks good enough without it, but it definitely added atmosphere. I'll keep a look out on the Asset Store.
You could try using this shader from here http://docs.unity3d.com/Documentation/Manual/windowsstore-gettingstarted.html http://files.unity3d.com/tomas/Metro/Examples/MyCustomFog.shader
* Create a material * Attach that shader to your newly created material * Attach material to objects which supposed to have fog I guess that's not what you've expected, but that's how generic fog works, every object which is affected by fog, has to have shader with fog implementation. The other solution would be apply fog as post effect - http://docs.unity3d.com/Documentation/Components/script-GlobalFog.html, but you'll need Pro license, because it's an image effect.
Hi, Tomas. I haven't got fog effect on my lumia 720 device. I used your "MuCustomFog.shader" and "GlobalFog effect", but both of them were not effective. How to do this? Can you provide a example? Thank
Tomas, I had already tweaked Render Settings, but I don't get fog effect. https://www.dropbox.com/s/jz4mtil2oqnymqg/wp8fog.zip This is my test project. Can you help me to check it. Thanks.
You're right, for some reason it doesn't work on the phone. At first I only tested it on editor. I'll take a look at it.
Seems like depth textures aren't supported (even though the hardware does). Does qualcomm not expose the caps for d3d 9 or does unity just not support depth textures on wp8 yet? I'll have to keep that in mind for the time being, but do you guys expect depth texture support in a future release?
I would also like to know what the status is on this. And is "default fog" not going to be supported on wp8 at all, or is it something that might come later?
Yes! Fix is coming in Unity 4.5. Still, not everything works (there's a bug in Adreno 225 driver that makes it not able to properly sample shadow maps and depth textures), but it should mostly work.
Hey guys, So I checked and "standard" fog is still a no-go with Unity 4.5. I'm bulding a space sim and I wanted to have some missions set inside a nebula. On Android, I can get it too look fairly cool with fog and a few other effects, so its disappointing that its so difficult to get it to work on WP8. I mean, even Superman 64 had fog! (and not much else...) It seems like the only alternative is to add fog, manually, to the half dozen or so shaders I'm using (mostly Unity built-in mobile shaders) and then switch every material to those new custom shaders, correct? If so, this leaves me with a few questions. Since adding fog in the render settings is required, will this create "double fog" on devices that do support the built-in Unity fog? Does having this fog functionality in the shader affect performance in any way if fog is turned off? In other words, would I need to make separate shaders just for the fog levels and either switch them by script, or have separate "fog level" duplicate objects, so that the fog shader doesn't affect performance in other levels? I suppose a clever script could be written that properly switches shaders "on awake" depending on platform and if the level is a "fog level" or not if necessary. Do ALL windows phone 8 devices lack fog? And if not, and my above scenario does result in "double fog", is there a way to know if a device does so I can choose weather or not to switch shaders?
Is there a significant performance hit on using the global Fog image effect? Is that image effect suitable for mobile platforms?
The slightest post-effect is very expensive on mobile. Beyond that, it's still annoying not to have a single fog solution that works on WP (even global fog image effect solution does not work on Lumia 925) ...
I ran into this problem as well and noticed if you use the shader there is double fog in the editor. To get around this I removed the connection to the fog settings and added them to the shader instead. This way I know all devices, not just windows phone, will look the same because I don't have to turn on the fog settings. I have no idea if the shader method is slower than the built in fog though? but it seems to be working fine at the moment.
It definitely should not be slower. When you enable global fog, unity injects fog code to all your shaders, however, this isn't implemented for Feature Level 9.x. So if you're writing shaders yourself, the result should be identical.
Is there a way to test the feature level? How should I decide whether to implement custom fog on each device?