Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 joshua-lyness · Jul 19, 2015 at 01:45 AM · graphicslagprofilerimage effects

Extreme lag in game

So I have had a few lag issues in my game. I have searched the internet, but with such a broad topic, its hard to find something relevant. So anyway, as usual I come to u guys for help :)

Before I added image effects, I had 180 frame per second, dipping to 60 at worst, but after adding, fps is approx. 3... eek. I don't know why its sooo bad! alt text Ive also added a screenshot of the profiler, looks pretty awful, huh? :D If you need anything else, just ask. I must be doing something wrong.

screenshot-3.png (374.6 kB)
Comment
Add comment · Show 7
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 FirePlantGames · Jul 19, 2015 at 04:52 AM 0
Share

Uhm. You should probably post some information on what's going on in the scene. And, image effects can be quite expensive.

avatar image joshua-lyness · Jul 19, 2015 at 09:26 PM 0
Share

There is a camera with a movement script that uses the horizontal and vertical axis. On right click and drag. The camera rotates around an empty game object. Also the camera can move in out out towards this empty game object.

avatar image joshua-lyness · Jul 19, 2015 at 09:29 PM 0
Share

There are about 100 columns that each have a value, which affects their position on the y axis. The script is quite messy, however after the first 3-4 seconds once they have reached the correct height, they don't change, unless the user clicks on one, followed by clicking on another one, that causes the first one to half in height, and the second one to add half the first ones height. Like I said, the scripts are very messy, but there are no repeating statements that would cause substantial lag.

avatar image joshua-lyness · Jul 19, 2015 at 09:32 PM 0
Share

Also just so you know, I have tried running the scene, trying it out without particular scripts and materials etc, but the lag barely changes. the funny thing is that it I make a new scene with the same camera, frame rate is about 10, however if I use the same scene with a new camera, frame rate is still too low. Could it be a project setting? I have turned off everything I can, anti-aliasing included, and shadows, and got rid of all camera effects and frame rate ranges from 40-80

avatar image maccabbe · Jul 19, 2015 at 09:37 PM 0
Share

GFX.WaitForPresent, which is what seems to be using the majority of your CPU, is actually just your CPU is waiting for your GPU. You need to exa$$anonymous$$e the GPU stats.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Vollmondum · Jul 19, 2015 at 07:43 AM

Usually that lag is caused by dozens of materials assigned within a scene. Combine them. Each of your Prefabs on load has a material assigned.

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 joshua-lyness · Jul 19, 2015 at 09:23 PM 0
Share

I have 9 materials that have to be assigned using code. Currently one material is applied in the start function, a black one that u can see if the photo. Of course, about 100 are being applied on start, which could very well be the issue. However, shouldn't this lag go away after it has been assigned? After the first frame, it should stabilise and recover back to high frame rate?

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

My game is lagging and i don't know how to fix 0 Answers

How to reduce Draw-Calls? 1 Answer

Weird android performance on high-end device 0 Answers

Volumetric Lighting Help 1 Answer

PROFILER: Texture.IntegrateLoadedImmediately over 150ms 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