- Home /
Shadows in Editor But Not in Build
Community,
I've searched for this on Google, Unity Forums, and Answers - nothing is helping and the problem seems widespread.
Search phrase: "unity shadows editor not build"
PROBLEM OUTLINE:
Everything looks perfect in the editor, but when a build is made, all shadows disappear.
PC Standalone on Windows 8.1 with dedicated AMD graphics card all fully updated drivers/updates on the entire system.
SOLUTIONS TRIED:
Going to Edit -> Project Settings -> Quality you get a 'QualitySettings' window. Clicking through the options in the window (from 'Fastest' through 'Fantastic') you can see in the editor various things change including shadows. From quality 'Good' through 'Fantastic' the shadows look perfect in the editor and when playing the game in the editor. Building the game, no shadows no matter what quality setting is chosen.
New quality setting created: 10x the Pixel Light Count from 'Fantastic' from 4 to 40, 10x the Shadow Distance of 'Fantastic' from 150 boosted to 1,500. Still with this new 'Insanity' setting and other options up, shadows are not working.
Inspector window when the directional light selected: Altered 'Render Mode' to 'Important'
Switched Inspector to Debug mode and tried setting the Directional lights from Range 10 to 100 (10x increase)
Edit -> Project Settings -> Player: Set Rendering Path from Forward to Deferred
Each of these options have been tried, all these options at once, and various combinations of these options together. Still shadows are working fine in editor (scene and game windows as well as playing) but no shadows when testiing a build (standalone PC).
Hardware might be discussed, but keep in mind Unity is showing everything PERFECT in the editor.
Again Windows 8.1 with AMD GPU and latest drivers/updates on the entire system.
Editor shows the shadows fine. Perfect. However when you build there are none.
I have multiple scenes setup, some have a couple directional lights, some have one, some have a few point lights..
I'm at the end of what I can find and try..
It's not in your tried solutions, so let's get one of the obvious things to check out of the way first. When you are running the build, have you ensured that a quality setting that produces shadows is actually selected in the launcher?
Answer to first question: Version: 5.0.1f1 Personal
Answer to second question: When running the build, have tried all quality settings. In the editor, quality settings from good upwards all show shadows properly. Dipping under Good in editor some shadows disappear. Running editor and build in Good or better, the editor shows shadows properly, the builds never show shadows.
I have the same issue; Shadows show in editor, but not the 'game window' or the build.
Were you ever able to find a solution?
Answer by PatHaugen · May 08, 2015 at 12:26 AM
Lighting Solution:
Point Lights with Mixed Baking, various intensities and bounce intensities. Shows fine in editor, playing with things, at some baking step (kicked off automatically when modifying things in scene) shadows will break.
Altered Point Lights from Mixed to Realtime Baking, then got a warning:
"Currently realtime indirect bounce light shadowing for spot and point lights is not supported."
Dragged the Bounce Intensity sliders to 0 for all Point Lights.
Added a few more lights just to see if this was indeed the issue.
Works.
SUMMARY:
Point Lights set to Realtime or Mixed with a Bounce Intensity greater than 0 will break your lighting, but lighting will actually work in the editor.
BUG:
Unity doesn't warn or understand that the lighting break caused as described above is what is breaking ALL your lighting. This issue should be detected and ERROR out as it completely breaks all lighting when the above conditions happen.
I've solved my own problem, and hopefully this solves it for many more who search for their issue and stumble across this.
So does that mean you can set it to baked and it will work in the build?
Your answer
Follow this Question
Related Questions
Shadows became ugly pixelated in Unity Editor 5 after an Android build 7 Answers
Note3 Shadows Gone 0 Answers
Distribute terrain in zones 3 Answers
No realtime Shadow after Build 0 Answers
Shadows are buged for me... 1 Answer