Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 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 Pemu · Mar 20, 2015 at 01:15 PM · gameobjectobjectsslowlagsslowing

Objects are slowing game

Hello! I have a little problem. On my Planet (this is a big sphere, 50 units scale) I created a Trees Generator. It's generating 600 trees around my Planet. When I'm looking forward FPS is OK, but when I'm looking down I have big lags and 20 FPS (normal is 60). I know why - because when I look down all the trees are "visible" and this slow game. So - You have any idea to fix that? I want to create big planets with more trees, but I can't solve this problem.

Sorry for my english and Thanks in advance! :)

Comment
Add comment · Show 3
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 _dns_ · Mar 20, 2015 at 01:46 PM 0
Share

Hi, I'd check how to define occluders and place one in the center of the planet (I don't know more about this but there are new features in Unity 5 about occluders) I guess you could also try different values for tree LOD.

avatar image _dns_ · Mar 20, 2015 at 06:25 PM 0
Share

Hey, just got an idea: if your planet is a sphere and you have a list of the tree's gameobjects, you could go over the list of trees and check their transform.up vector against the vector between the camera origin and the tree origin using a dot product (vector3.dot). Then, the dot product result will tell you if you are looking at the tree "from under" or not (if the dot is negative and also with small positive values if vectors are normalized). You can disable the trees that are looked-at "by under"; as the planet is a sphere, it should disable half of the trees, being as good as an occluder. This involve a little knowledge of scripting and maths, I don't have tome to write the code but maybe someone here can help.

avatar image Pemu · Mar 20, 2015 at 09:25 PM 0
Share

Thanks guy! I make a distance between my Player and Tree and I can disable Tree renderer when Player is away from Tree! :) So that was simple and it's working :D Thanks again.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by tigertrussell · Mar 20, 2015 at 03:46 PM

"Removed objects as requested." Sorry. Had to make a bug-resolution joke.

You should look into Occlusion Culling, I think.

Comment
Add comment · Show 2 · 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 Pemu · Mar 20, 2015 at 05:45 PM 0
Share

How can I use OC with my runtime created trees? Can you give me code maybe?

avatar image tigertrussell · Mar 20, 2015 at 06:04 PM 0
Share

I've never set it up myself; it only just became free due to Unity 5.

avatar image
0
Wiki

Answer by Nitin_jain · Mar 20, 2015 at 05:03 PM

I think you should check it out about Level of Detail (LOD) which may be solve you problem or change your approach.

Comment
Add comment · Show 1 · 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 Pemu · Mar 20, 2015 at 05:44 PM 0
Share

Not working :/

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

24 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Infinite Terrain Dilemma. (Chunk Based System... Not A Minecraft Clone) [FIXED! PLEASE USE AS A REFERENCE.] 1 Answer

Version Control and Unity Assets 0 Answers

Who to make the game more fast and with better resolution? 1 Answer

How can i modify the hirarchy of a game object 1 Answer

GameObject.Find() work on inactive objects 16 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