I’m currently running into the issue that if I switch from gamma (default) to linear color space in Unity 5.6 b3, I’m getting massive lags in the editor while navigating the scene, as in rightclick+mouse move / WASD working only sluggishly. This is in/for a VR game with OpenVR enabled as a VR project.
Switching the color space might cause Unity to recompile shader variations. Unity isn’t doing that for all shaders in one go, but more on-demand.
Which means whenever the camera is looking at an object where the shader variation has not been compiled for yet, it will. The same applies to various editor features, such as if you toggle the scene view light option, Unity will compile missing shader variations or if you enter text in the hierarchy search.
I ran into this issue so many times already, often just directly after upgrading Unity. It’s really annoying, but if you run into the issue I described here, it fades away after having worked in the editor a while and all shader variations have been compiled.
But beware, this function can be slow and is blocking the main-thread, causing the game to freeze for the time the method is being executed.
We prewarmed shaders during the loading-screen, but depending on project size and hardware the game runs on, it can cause major waiting times. In one iOS project where I tried whether using WarmupAllShaders fixes a few of the hiccups we were noticing, it took more than a minute to complete. This is obviously unacceptable. But in other projects WarmupAllShaders completed fairly fast, so I would give it a try.
I navigated through my scene (which isn’t particularly big) for close to 30 minutes and looked at everything. There was no change at all to the sluggishness (we’re talking seconds of delay here). Switch back to Gamma after the 30 minutes, and it is buttersmooth again.
I guess I’m seeing a different issue than shader recompilation here. Any other ideas, anyone?
I think its related to the (VR) camera. If I remove the camera from the scene, I can immediately navigate smoothly in linear mode. The camera has standard settings (besides being VR). Why the scene camera should affect the editor mode is beyond me, though.
I can report that when doing Windows builds (x86_64) in Unity 5.6.0b10, the builds hangs most of the time at ‘Packaging assets - sharedassets2.assets’ with preparing bake progress sometimes near zero or 50 %. If you wait long enough, (in my case 60 minutes or so) it does complete but it’s really a pain. For Linux builds and Mac builds it works much faster. Note: I have removed support for DX9 when doing windows builds and that helps a bit. At least it does not hang every build. My machine has 16gb ram. HP Probook 4540s and runs ubuntu 16.04 LTS. CPU is intel Core i5-3230M @ 2.60 GHz x 4. Graphics: Intel Ivybridge Mobile. OS type: 64-bit. Since removing the Auto Graphics API for windows checkmark, and deleting Direct3d 9 support (keeping only Direct3d 11), I am able to ‘force’ my windows builds through, albeit slowly and sometimes have to run it twice (after hangs)