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 Zebbi · May 02, 2018 at 04:09 PM · cameraframerate

Limit framerate on just a camera, not whole application?

I'm using this script to bring my framerate down to 20fps for an aesthetic effect public int target = 20;

     // Use this for initialization
     void Start () {
         QualitySettings.vSyncCount = 0;
         //Application.targetFrameRate = 20;
     }
     
     // Update is called once per frame
     void Update () {
 
         if (target != Application.targetFrameRate) {
             Application.targetFrameRate = target;
         }
     }
 }
 

However, that also affects the cursor moves, and I want to keep the low framerate just to the camera. Is this possible? (Preferably whilst also having the same performance-saving of rendering a lower frame-rate on the whole application, if possible.)

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 the_genius · May 02, 2018 at 05:41 PM 0
Share

In your scripts where you don't want the framerate limited you could use FixedUpdate or a Coroutine.

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by JedBeryll · May 02, 2018 at 06:27 PM

Disable the camera component and manually call camera.Render in a coroutine.

Comment
Add comment · Show 5 · 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 Zebbi · May 02, 2018 at 07:48 PM 0
Share

If I disable the camera, does that break how the camera is working? I'm not familiar with co-routines, is that a script on the camera?

avatar image JedBeryll · May 03, 2018 at 03:41 AM 0
Share

If you disable the camera, it won't render automatically. Then you can call Render manually whenever you want, the camera's settings will still apply. $$anonymous$$ake sure you only disable the camera component not the gameobject. Read up on coroutines here.

avatar image Zebbi JedBeryll · May 03, 2018 at 11:49 AM 0
Share

How do settings like FOV, projection and clipping planes work if the camera component is disabled? I've not used a coroutine script before and I'm still learning the coding side (certainly from scratch), are there any examples that would do similar to what I'm attempting? I'm really not sure where to start!

avatar image Bunny83 Zebbi · May 03, 2018 at 03:12 PM 0
Share

A camera is nothing but the settings you've mentioned. When a camera is "rendered" Unity actually takes those settings, deter$$anonymous$$e which renderers are within the viewing frustum of the camera and will render all those renderers with the settings of the camera.


Note that rendering a camera at a slower rate than the actual framerate only makes sense when you render to a RenderTexture. If you have for example a $$anonymous$$imap camera that directly renders to the screen on top of the main camera you can't render it at a slower rate since you have to render it every frame after the main camera has rendered.

Show more comments
avatar image
0

Answer by SharkoFR · May 04, 2018 at 02:29 PM

you can limit framerate when the player are using a camera and remove limit when it use other

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 Zebbi · May 04, 2018 at 06:42 PM 0
Share

Trouble is I need the cursor to be software rendered, and that also gets limited so it has a draggy feel :/

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

136 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 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 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 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 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 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

How can I force FPS per camera? 1 Answer

Camera performance issue 0 Answers

How to make camera position relative to a specific target. 1 Answer

AddForceAtPosition not working? 1 Answer

Make camera only render LOD_2??? 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