当前位置:网站首页>Why setting application.targetframerate doesn't work
Why setting application.targetframerate doesn't work
2022-07-28 08:52:00 【UWA】
1) Set up Application.targetFrameRate There's no reason why it doesn't work
2)Unity How to monitor program exit , Including being backstage kill
3) Reduce Mesh LOD Whether it will reduce the execution times of slice functions
4)TMP SubMeshUI The reason for this
This is the first 304 piece UWA Push of technical knowledge sharing . Today we continue to select and develop a number of 、 Optimization related issues , Suggested reading time 10 minute , If you read it carefully, you will get something .
UWA Question answering community :answer.uwa4d.com
UWA QQ Group 2:793972859( The original group is full )
Performance
Q: Set in the code Application.targetFrameRate It didn't work , What's the reason, please ?
A1: You can check the engine settings VSync Set whether to turn on . Here's the picture , It can be adjusted to Don't Sync Try again. .
After testing ,VSync closed ,Application.targetFrameRate The lock frame effect of takes effect normally ;VSync On , The actual frame rate will always reach the maximum frame rate supported by the device , So that Application.targetFrameRate The lock frame of is invalid .
For example , The millet 10 Test on , Turn on VSync after , Although set in the code Application.targetFrameRate=60, But the actual frame rate will reach 90, Thus making the project GPU The pressure is higher than expected .
thank [email protected] The Q & a community provides answers
A2: Mobile platforms will be related to mobile phones , Will not exceed the maximum refresh rate . Take a look at the official documents :
Application-targetFrameRate - Unity Script API
thank [email protected] The Q & a community provides answers , Welcome to community communication :
Set in the code Application.targetFrameRate It didn't work , What's the reason, please ? -- UWA Question and answer | Game developer interactive Q & a community | Tiger Technology
Android
Q: If it's done MonoBehaviour.OnApplicationQuit This method , stay PC Or you can use it under the editor to listen , But what I found was that , Release Android This function will not be monitored .
Use Application.Quit Method exit can monitor , But if you are directly killed by the backstage , Then you can't monitor .
Is there any other way , Be able to ( Forced exit or background kill etc. ) Program exit detected ?
A: Export the project as Android project , The exported project directory unityLibrary\src\main\java\com\unity3d\player There is one below UnityPlayerActivity.Java file , The code inside is controlling UnityPlayer Life cycle of .
Android Life cycle :
According to the above cycle , The normal exit of the game will call Quit, System kill process will not trigger Quit.
So it may be suggested to consider some other ways . such as onSaveInstanceState() and onRestoreInstanceState() These two events , And by writing Servise Auxiliary detection Uniy Activity status of the project .
If you want to write Android direct interaction Unity Code for , You can also write like this :
mUnityPlayer.UnitySendMessage(“receiveObj”, “UnityMethod”, “This is args.”);
thank [email protected] The Q & a community provides answers , Welcome to community communication :
Set in the code Application.targetFrameRate It didn't work , What's the reason, please ? -- UWA Question and answer | Game developer interactive Q & a community | Tiger Technology
Rendering
Q: The lens is fixed , If the model uses Mesh LOD In addition to reducing the number of vertex function executions , It will also reduce the number of piecewise functions ?
Or what factors affect the execution times of slice functions ?
A1: Then you can only reduce the screen resolution or perform depth culling ,AlphaTest And other means of early elimination .
Thank ou Yuesong @UWA The Q & a community provides answers
A2: Add upstairs , Mainly to see Primitive The number of pixels on the screen after rasterization ( This is affected by the rendering resolution ). Of course, we should also consider the elimination of hidden surfaces ,Early-Z Etc. avoid Fragment Factors of calculation .
thank [email protected] The Q & a community provides answers , Welcome to community communication :
Set in the code Application.targetFrameRate It didn't work , What's the reason, please ? -- UWA Question and answer | Game developer interactive Q & a community | Tiger Technology
TextMeshPro
Q: Now in use Unity 2019.4.34f1 Version and TextMeshPro 2.1.6 Version development function , There are two fonts in the project ,Font_Main and Font_Main_Fallback.
If be in, Font_Main Set up Fallback Font Assets, Created TextMeshPro There will be a child node under the text component TMP SubMeshUI [Font_Test_1 Material + KaiTiJianCu Atlas], And it can't be deleted , After deletion, it will appear again automatically ; If not set Fallback Font Assets, Then the child nodes TMP SubMeshUI [Font_Test_1 Material + KaiTiJianCu Atlas] Delete , What is the function of this ? Will it affect performance ?

A: If there is no corresponding Unicode When writing , Will use Fallback The font shows .
Thank you Xiao Xiaojun @UWA The Q & a community provides answers , Welcome to community communication :
Set in the code Application.targetFrameRate It didn't work , What's the reason, please ? -- UWA Question and answer | Game developer interactive Q & a community | Tiger Technology
The cover map comes from the Internet
Today's sharing is here . Of course , There is no end to life but to know . In the long development cycle , The problems you see may be just the tip of the iceberg , We are already in UWA The Q & a website has more technical topics waiting for you to explore and share together . You are welcome to join us , Maybe your method can solve other people's urgent needs ; And he's a mountain “ stone ”, Can also attack you “ jade ”.
Official website :www.uwa4d.com
Official technology blog :blog.uwa4d.com
Official Q & a community :answer.uwa4d.com
UWA School :edu.uwa4d.com
Official technology QQ Group :793972859( The original group is full )
边栏推荐
- Vk1620 temperature controller / smart meter LED digital display driver chip 3/4-wire interface with built-in RC oscillator to provide technical support
- Service current limiting and fusing of micro service architecture Sentinel
- 为什么 ThreadLocal 可以做到线程隔离?
- Sliding screen switching on uniapp supports video and image rotation, similar to Tiktok effect
- Hcip day 9_ BGP experiment
- Redis basic knowledge, let's review it
- When unity switches to another scene, he finds that the scene is dimmed
- SQL Server查询结果导出到EXCEL表格
- Leetcode/ sum of two numbers in a sorted array
- Flink window & time principle
猜你喜欢

GB/T 41479-2022信息安全技术 网络数据处理安全要求 导图概览

博客搭建九:hugo添加搜索功能

Round C financing has been completed! Smart software leads domestic Bi ecological empowerment, and products and services are a step forward

Chapter 2-14 sum integer segments

49 opencv deep analysis profile

Solution: indexerror: index 13 is out of bounds for dimension 0 with size 13

bash-shell 免交互

Customer first | domestic Bi leader, smart software completes round C financing

SQL server time field sorting
![[soft test software evaluator] 2013 comprehensive knowledge over the years](/img/c5/183acabd7015a5e515b7d83c127b2c.jpg)
[soft test software evaluator] 2013 comprehensive knowledge over the years
随机推荐
5张图告诉你:同样是职场人,差距怎么这么大?
Recruiting talents, gbase high-end talent recruitment in progress
解决:IndexError: index 13 is out of bounds for dimension 0 with size 13
Recycling of classes loaded by classloader
阿里巴巴内部面试资料
MySQL how to add users and set permissions?
How to configure phpunit under window
HCIP---LDP和MPLS技术(详解)
Blog building 7: Hugo
Competition: diabetes genetic risk detection challenge (iFLYTEK)
Js继承方法
Chapter 2-2 calculation of piecewise function [1]
微服务架构 Sentinel 的服务限流及熔断
客户至上 | 国产BI领跑者,思迈特软件完成C轮融资
PHP基础知识 - PHP 使用 PDO
Explain cache consistency and memory barrier
博客搭建七:hugo
思迈特软件Smartbi完成C轮融资,推动国产BI加速进入智能化时代
PHP基础知识 - PHP 使用 MySQLI
Quickly build a gateway service, dynamic routing and authentication process, and watch the second meeting (including the flow chart)


