Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by JGPicatoste · Aug 07, 2013 at 05:42 PM · editorlagslowqualitysettings

Unresponsive Unity Editor

Hey there!

Recently, since 4.2 I think, my Unity Editor has been behaving really weirdly. I created a test scene for our next project, and spread grass all over a newly created terrain.

The thing is, when I set the detail distance to 250, which is a correct minimum considering my system specs (i7 3770K, HD 7870, 8 GB RAM, W7 64 bits) and the amount of stuff in the scene, the Editor starts to be really unresponsive. It's impossible to work, since every action or command is proccesed with lots of lag.

Trying and testing, I stumble unto two curious things:

  • Considering the Editor in Scene view, as mentioned before, is very unresponsive, I went to the QualitySettings menu to try and look for a solution. There, before I even tweaked anything, I noticed that I could navigate the Scene without any lag or trouble! Zooming, moving, etc. Switching between the QualitySettings menu and the Scene tab, the performance difference became really apparent (and yes, I did try every quality setting available, with no result in my Scene).

  • The issue is far stranger, because I found out that the Editor is actually usable if I stick to make every action just under 2 seconds from the previous. I mean, the problem, apparently, is that my Unity Editor "disconnects", "goes idle" after 2 seconds have passed since the previous action. So (and I have tried it extensively, and it works) I could work with it if I could just make all actions at blazing fast speed, within that 2 second window between one another.

But I guess, I would just play Starcraft professionally if I could do so.

Thanks!

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 MicroGSD · Aug 07, 2013 at 08:55 PM 0
Share

What's your base terrain pixel error? $$anonymous$$ake sure its set to something around 5. Setting it to 1 will lag any computer. The only other thing I can think of is too many grass instances, but I doubt this is problem unless you're up in the multi-terrain, 500,000+ area. Have you tried using the profiler on the editor?

avatar image JGPicatoste · Aug 07, 2013 at 11:34 PM 0
Share

Thanks for responding! Pixel error is 5, absolutely. $$anonymous$$aybe there are too many grass instances, how should I check that? But I wonder, if that's the case, why I can certainly use the Editor at its full potential at such extremely odd circumstances.

Didn't check the profiler. Looks like I got to, to rule out any possible motive.

Thanks!

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by MicroGSD · Aug 08, 2013 at 12:26 AM

Try adding this to your assets: http://detail.microgsd.com/2013/08/these-functions-will-tell-you-total.html . It'll tell you how many grass / details you have. If you're in the millions range you will probably experience slowdowns, which would be the answer to why the editor is clunky.

 using UnityEngine;
 using UnityEditor;
 using System.Collections;
 using System.Collections.Generic;
 
 public class GSDEditor : ScriptableObject{
  //Get all terrains:
  [MenuItem( "GSD/Get grass count" )]
  public static void GetGrassCount(){
   Object[] tTerrains = GameObject.FindObjectsOfType(typeof(Terrain));
   //For each terrain:
   foreach(Terrain tTerrain in tTerrains){
    GetGrassCount_Helper(tTerrain);
   }
  }
  
  private static void GetGrassCount_Helper(Terrain t){
   // Get all of layer zero.
   int numDetails = t.terrainData.detailPrototypes.Length;
   int grasscount = 0;
   for(int i=0;i < numDetails;i++){
    //Get the detail layer:
    int[,] map = t.terrainData.GetDetailLayer(0,0,t.terrainData.detailWidth, t.terrainData.detailHeight, i);
    //For each pixel in the detail map:
    for (int y=0;y < t.terrainData.detailHeight;y++){
     for (int x=0;x < t.terrainData.detailWidth;x++){
      grasscount+=map[x,y];
     }
    }
   }
   Debug.Log("Grass #: " + grasscount);
  }
 }

Symptoms of millions of grass:

  • http://forum.unity3d.com/threads/90923-Terrain-CullAllTerrains-causes-stutter

  • http://forum.unity3d.com/threads/174761-In-Game-drawing-on-terrain-feels-slow

  • http://forum.unity3d.com/threads/177758-Moving-Unity-Terrain-causes-severe-lag

  • http://forum.unity3d.com/threads/117431-Terrain-performance-issues

You can get around it by temporarily setting the detail resolution and detail per patch very low, and then re-upping it during playtime or right before playtime. There's probably other solutions.

Edit: It seems you can improve the performance a bit if you set the detail resolution to the same resolution as the terrain. However you increase draw calls doing this.

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 JGPicatoste · Aug 08, 2013 at 11:38 AM

Sorry for not replying earlier. I'm gonna try and do all your solutions, I might be over millions of grass instances, yeh. Will reply with anything, positive or negative.

Edit:

1.640.000 is the actual amount. Are we to rule out any other possible reason, and assume it's just a matter of grass instances?

Thank you!

Comment
Add comment · Show 4 · 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 MicroGSD · Aug 09, 2013 at 08:24 AM 0
Share

I think it's purely based on the number of grass instances as looking into the profiler, the function calls increase as more grass patches are added. The only way to mitigate this currently that I know of, is to keep the detail resolution the same as the heightmap resolution, while keeping the detail per patch low.

I think the only real alternative is creating your own grass system for the terrain.

You might try posting about this problem on the unity forums and seeing if you get an answer there, as it really is just an editor issue.

avatar image JGPicatoste · Aug 09, 2013 at 02:07 PM 0
Share

Hm, what really grinds my gears is that I've tried it on another computer (actually, a less powerful one) and it works like a charm all the way.

It shouldn't be connected to the number of grass instances if that's the case.

Thank you, will keep on looking onto this!

avatar image MicroGSD · Aug 09, 2013 at 07:22 PM 0
Share

Really? That's interesting. I get the slow downs running on 8 cores @ 4.9 GHZ. I'll keep looking into it too, I'll post back here if I find anything.

avatar image JGPicatoste · Aug 11, 2013 at 03:38 PM 0
Share

Yeh haha, it's driving me nuts! I'm gonna try and install an earlier version of Unity, gonna see if that solves anything.

Edit: It solved nothing. I've prepared a video showing how it's sluggish in the Scene $$anonymous$$ode, but in the QualitySettings menu works perfectly in whatever quality.

$$anonymous$$ight upload it later.

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

15 People are following this question.

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

Related Questions

Strange Hierarchy Lag 1 Answer

Lag in Inspector 0 Answers

Unity is reacting really slow, and it opens a second instance of the Editor 2 Answers

Unity does not open or start properly 0 Answers

my unity 3d is too slow and crashes alot 1 Answer


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