6

I've enabled a fog in the render settings on my scene. It works perfectly while testing it on the Unity editor, but after opening the game after building, the fog disappears. I'm not sure but according to some sources on the web, I found out that Unity3d has issues when running with Windows 8.1. Is there any way I can fix this?

Bart
  • 19,692
  • 7
  • 68
  • 77
user3616302
  • 61
  • 1
  • 2
  • 3
    Do you have the same `QualitySettings` set in the editor and for windows build? – kreys May 08 '14 at 12:07
  • Yes, I have everything checked. I also forgot, I have forced unity to run in DX11 to solve another problem due to windows 8.1 – user3616302 May 08 '14 at 15:18

4 Answers4

9

I have just had this issue, it's incredibly annoying. What worked for me was going to the Graphics settings and changing the "Shader Stripping" fog modes to manual. I hope this helps someone else in the future.

sraney
  • 91
  • 1
  • 2
1

To extend sraney's answer. Unity 2018 now look like this, if you change from "Automatic" to "Custom" it lets you select which shader to KEEP. In screenshot, I use only Linear mode so I only check that one.

Cause

This problem came from no scene in build list ever use fog setting (via Window -> Rendering -> Light Settings menu). Which happen to me because my game turn fog on/off via script.

>> Link to Unity official article

Project settings

Wappenull
  • 1,181
  • 13
  • 19
0

Works for me. Edit, Project Settings, Graphics, Shader stripping, Fog modes:Manual. I confirmed this works fine on Ubuntu with Unity 5.4.1f1 The problem only happens during a build. It works fine without otherwise.

Code snippet for fog: void Start () { RenderSettings.fogColor = Camera.main.backgroundColor; RenderSettings.fogDensity = 0.03f; RenderSettings.fog = true; }

0

Worth mentioning to try and create a new camera if it still does not work after modifying the RenderSettings.

No matter what changes I made, it would not update until I replaced the camera with a new one.