Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Kiloblargh · Jun 02, 2011 at 07:52 AM · optimizationscalegpu

Does transform.LocalScale now use the GPU? Is it still slow on phones?

The manual still warns against scaling objects and suggests they be scaled in the external modeler, imported at 1.0 and left there or performance will suffer. Ok, what about things that need to get bigger and smaller to varying degrees in the game? I read a post from last year from a Unity person that they were 'working on it'. I see Aras said that in Version 3.0, it will use the GPU, but that was from before it came out. So... does it? I've just got to the point in my game where I need to make things scale, and it already chugs in the webplayer at 1024x768 resolution, and I can't afford the profiler, so freaking out a bit over this.

I was actually thinking of making a vertex shader to do my in-game scaling, but if that's essentially what the engine is doing now, I won't waste the time on it. (My first thought was that I could make a hundred or so versions of the mesh at different sizes and switch them on and off every few frames like a flip book; and could that really be faster than just setting the scale, and if so; wtf. )

So, is just setting transform.localscale good & kosher now in 3.0 or is some workaround still needed?

Comment
Add comment · Show 1
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 Jessy · Jun 02, 2011 at 02:12 PM 0
Share

How is using a vertex shader at all the same thing as scaling the Transform? Scale is used for a lot more than rendering.

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Paulius-Liekis · Jun 07, 2011 at 09:09 AM

Scaling object is not a problem in my experience. The only case that I'm concerned about is having a Collider on scaled object, because in that case it has to rebuild collider everytime you change your scale.

Otherwise just try it and see if it works.

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 spovf · Sep 21, 2011 at 10:39 AM

I ran into a similar problem. The slowdown issue is not the GameObject itself which you want to rescale, but its collider. Even if never using the collider, it is actually there and will be updated with a call to transform.localScale resulting in a more complex scaling.

The collider is used for physics and collision detection, if you do not need this, the solution is quite simple - just destroy the collider of your GameObject.

GameObject.Destroy ( myGameObjectrenderer.collider );

Happy Scaling!

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 syclamoth · Sep 21, 2011 at 11:00 AM 0
Share

Or, alternatively, don't put one on in the first place! If you're changing things as fundamental as that at runtime, you might run into problems.

avatar image spovf · Sep 21, 2011 at 12:18 PM 0
Share

Well, that is the strange thing. I didn't add it. I call myGameObject = GameObject.CreatePrimitive ( PrimitiveType.Plane ); Shouldn't be a problem if destroyed right after creating it.

avatar image
0

Answer by jonas-echterhoff · Sep 21, 2011 at 12:32 PM

Unity 3.0 does have GPU support for uniform scaling for mesh renderers. However, non-uniform scaling (different values for x/y/z), and colliders with scaling will still cause performance hits.

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

8 People are following this question.

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

Related Questions

Build GPU Performance 0 Answers

GPU (render time) increase if screen size increase 1 Answer

GPU spikes from SubmitVBO 0 Answers

Compute shader dispatch large spike in CPU and GPU profiler 0 Answers

Why CPU waits for GPU when there is not much work on GPU? 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