No Fog After Build
Asked Answered
O

4

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?

Oodles answered 8/5, 2014 at 12:1 Comment(2)
Do you have the same QualitySettings set in the editor and for windows build?Revolutionize
Yes, I have everything checked. I also forgot, I have forced unity to run in DX11 to solve another problem due to windows 8.1Oodles
F
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.

Filing answered 15/6, 2015 at 21:36 Comment(0)
J
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

Joceline answered 13/3, 2020 at 14:55 Comment(0)
D
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; }

Divot answered 10/11, 2016 at 23:34 Comment(0)
E
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.

Enosis answered 7/1, 2023 at 10:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.