Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Vigeous · Apr 21, 2012 at 11:13 AM · renderingtextureshangskyboxes

Strange hang on load with skybox.

[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. 2. Import a set of skybox textures. 3. Set their import settings to 4096x4096-compressed. 4. Create a new material from these textures, using the skybox shader 5. Make sure the material is NOT selected (and thus being previewed). Select the Main Camera object instead. 6. Close the editor. 7. Open the editor. 8. Add a Skybox component to the Main Camera. 9. Make sure the game view is displayed. 10. Click the circle-dot (what is that anyway?) for the custom skybox field. 11. Select the new skybox material in the "Select Material" dialog. 12. 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!

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image syclamoth · Apr 23, 2012 at 07:13 AM 0
Share

A wall of text is already better than a one-line "its not working" question. Have you submitted a bug report? It seems like this is the kind of thing we can't really help you with...

avatar image Kryptos · Apr 23, 2012 at 08:39 AM 0
Share

A good question is: do you really need a 4096x4096 set of textures for a skybox (i.e. 100+ millions of texels)? It looks like a useless overhead.

In the general case 1024x1024 textures for skybox (sometimes 512x512) are enough. I$$anonymous$$HO this hang is just your graphic card telling you that it is full (and fool?).

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by rudy.morin · Jun 12, 2012 at 04:51 PM

Hi,

We faced the same issue on Unity 3.5.2f2

After some tests, we managed to find a solution : load everything dynamically... First, you need to put your own skybox shader in the Resource folder...

Example :

     // load all skybox textures
     Texture2D sbFront = Resources.Load("Texture/Skybox/skybox_Front") as Texture2D;
     Texture2D sbBack = Resources.Load("Texture/Skybox/skybox_Back") as Texture2D;
     ...

     // Create new SkyBox material
     Material mySkyBoxMat = new Material(Resources.Load("Shaders/myOwnSkyboxShader") as Shader);

     // Assign all textures to the material
     mySkyBoxMat.SetTexture("_FrontTex", sbFront);
     mySkyBoxMat.SetTexture("_BackTex", sbBack);

     // Finally set the RenderSettings skybox variable
     RenderSettings.skybox = mySkyBoxMat;


Cheers, Spi

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by rudy.morin · Jun 12, 2012 at 02:55 PM

Hi,

We faced the same issue on Unity 3.5.2f2

After some tests, we managed to find a workaround : load everything dynamically... First, you need to put your own skybox shader in the Resource folder...

Example :

     // load all skybox textures
     Texture2D sbFront = Resources.Load("Texture/Skybox/skybox_Front") as Texture2D;
     Texture2D sbBack = Resources.Load("Texture/Skybox/skybox_Back") as Texture2D;
     ...

     // Create new SkyBox material
     Material mySkyBoxMat = new Material(Resources.Load("Shaders/myOwnSkyboxShader") as Shader);

     // Assign all textures to the material
     mySkyBoxMat.SetTexture("_FrontTex", sbFront);
     mySkyBoxMat.SetTexture("_BackTex", sbBack);
     ...
 
     // Finally set the RenderSettings skybox variable
     RenderSettings.skybox = mySkyBoxMat;


Cheers, Spi

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Do you need to mark metalness maps as "Alpha from greyscale" on the import settings 0 Answers

Used Textures stat.. what exactly does that mean ? 0 Answers

How to make the skybox in High Def Render Pipeline NOT influence lighting of things in the scene? 0 Answers

HDRP Texture issue with LitTesselation. Textures appear Blurry 1 Answer

Trying to make a texture fill an entire Plane 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges