SceneManager.LoadScene調用后新場景會變暗的問題


根據百度貼吧的帖子,來到http://answers.Unity3D.com/questions/919940/applicationloadlevel-changes-lighting-for-some-rea.html

 

這篇文章說他重新load場景后的渲染會變黑,和我們出現的問題一樣(不過根據內容,編譯成可執行文件就不會有問題了,這只是編譯器的問題)

回答

1.

To fix it in the Editor, Go to Window -> Lighting -> Lightmap Tab -> Disable Continuous Baking -> Press Build to bake the lighting once manually.

Note that if you add more lights or make some changes, you have to bake the lightmap again.

在編輯器Window -> Lighting -> Lightmap Tab -> Disable Continuous Baking -> Press Build 手工編譯光源一次,如果增加新光源,從新編譯一次,就會有新光源地圖了。

2.In both of your scenes go to Window --> Lighting --> Lightmaps and disable auto and manually click Bake. Leave the auto checkbox off. Do this for both of your scenes, the start menu scene and your game scene. In both scenes the auto checkbox must be off and have a lightmap snapshot up above in the lightmap snapshot field.

在你所有的場景中Window --> Lighting --> Lightmaps中去掉自動,手動點次Bake(Building)。所有的場景自動編譯都取消,手動編譯所有場景就好了。

Unity5.3

更改成如我上圖這樣,去掉下方Auto,點次Build,Lighting Data Asset從None變為現在有東西就好了,似乎就是場景光源沒編譯的問題,難道是自動無效?

 

 

 

 

 

/////個人設置Window --> Lighting --> Lightmaps中去掉自動,手動點次Bake(Building)  則可以恢復正常


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM