[Wall of text follows. I am going to include as much information as possible in the hopes that some clue will trigger an idea]
We have been having this problem for awhile and I have seen almost no reference to it in other threads/questions.
We first started noticing it when opening the Unity editor and loading a scene with a skybox that uses 4096x4096 textures. The editor hangs with a half-drawn UI for several minutes.
Here are a bunch of data points about this behavior:
*Removing the skybox from the camera, but leaving the material in existance
removed the hang*Adding a cube with the skybox material to the scene in view of the
initial camera position removed the
hang*Sometimes texture importing/converting uses multiple
cores, but during this hang, one core
is maxed out and the rest are
minimally utilized.*The hang happens maximum one time per Unity instance. Once you go through
the hang, it won’t happen again until
you reopen unity.*With no skybox material assigned, opening the “Select Material” dialog
(by clicking the circle-dot button
near “Custom Skybox None(Material)”
and simply clicking the material
causes the hang. This only applies to
assigning a material to a skybox, not
to other objects.*When viewing Process Explorer, it seams to be getting handles to files
in the Library cache*Minimal Disk I/O occurs during the hang, but RAM (Private working set) is
all over the board, changing by up to
+/- 60MB per second.*It seems to only happen with 4096x4096 imports. 1024x1024 does not
behave like this (I don’t mean a bit
faster… I mean ~1 second vs 3+
minutes). 2048x2048 takes about 10
seconds.*This only happens in the editor, not in a standalone compile (We aren’t
doing web or mobile stuff so I don’t
know how those fair).*The artist on the project uses an older MacPro (Dual Xeon 2.2Ghz,
GeForce 120) and has Photoshop
installed. He does not experience this
problem.*My machine is a Core i5-750, GeForce GTX570, 4GB Ram, Crucial m4 SSD 256MB
(Unity and the projects are on that,
but it happens on my platter drive as
well).*My drivers are up to date. I have also tried this with a Radeon HD4850.
*Also occurs on my Core i7, 6GB, Geforce 560M laptop.
*Problem exists in Unity 3.5 and 3.5.1.
*We are using Unity Free
*Problem exists using Meta files or not.
*The duration of the hang seems to scale with the number of textures.
*Having the game window hidden eliminates the hang until the game
window is shown. When the game window
is shown, the hang occurs, UNLESS you
view the material in the preview pane
first.
Here is my best guess of what is going on:
*When the game view window wants to render a 4096x4096 texture in a
skybox, it checks some flag in the
library cache and decides it needs to
reimport all textures.*When something else (The material preview pane, a mesh with the material
applied, etc…) causes the texture to
be rendered, it realizes it doesn’t
need importing and this flag is set.*From that point forth, the skybox renderer makes appropriate decisions
about whether to trigger a reimport.
I could be completely off.
Simple repro:
- Create new project.
- Import a set of skybox textures.
- Set their import settings to 4096x4096-compressed.
- Create a new material from these textures, using the skybox shader
- Make sure the material is NOT selected (and thus being previewed).
Select the Main Camera object instead.- Close the editor.
- Open the editor.
- Add a Skybox component to the Main Camera.
- Make sure the game view is displayed.
- Click the circle-dot (what is that anyway?) for the custom skybox field.
- Select the new skybox material in the “Select Material” dialog.
- This should hang. If not, try selecting the camera again (after the
material was assigned) and reopening
the editor.
Thanks very much for slogging through that giant wall of text!