当前位置:网站首页>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 )
边栏推荐
- HCIP---LDP和MPLS技术(详解)
- (13) Simple temperature alarm device based on 51 single chip microcomputer
- PostgreSQL: cannot change the type of column used by a view or rule
- Gbase 8A MPP and Galaxy Kirin (x86 version) complete deep adaptation
- Blog Building 9: add search function to Hugo
- Line generation (matrix)
- Chapter 2-14 sum integer segments
- Data fabric, next air outlet?
- Let me teach you how to assemble a registration center?
- C轮融资已完成!思迈特软件领跑国内BI生态赋能,产品、服务竿头一步
猜你喜欢

Line generation (matrix)

思迈特软件完成C轮融资,让BI真正实现“普惠化”

Among China's top ten national snacks, it is actually the first

When unity switches to another scene, he finds that the scene is dimmed

微服务架构 Sentinel 的服务限流及熔断

GBASE亮相联通云巡展(四川站) 以专业赋能云生态

看完这12个面试问题,新媒体运营岗位就是你的了

Js继承方法
![第2章-2 计算分段函数[1]](/img/40/cad6bf92849624199af0fd1ba1d433.jpg)
第2章-2 计算分段函数[1]

Leetcode brushes questions. I recommend this video of the sister Xueba at station B
随机推荐
Quickly build a gateway service, dynamic routing and authentication process, and watch the second meeting (including the flow chart)
第2章-14 求整数段和
Recruiting talents, gbase high-end talent recruitment in progress
Image batch processing | necessary skills
Deployment of kubernetes
GBase 8s是否支持存储关系型数据和对象型数据?
Recycling of classes loaded by classloader
Solution: indexerror: index 13 is out of bounds for dimension 0 with size 13
You're not still using xshell, are you? This open source terminal tool is yyds!
Vk1620 temperature controller / smart meter LED digital display driver chip 3/4-wire interface with built-in RC oscillator to provide technical support
2018年1月西邻雪山自驾游攻略
I am a 27 year old technical manager, whose income is too high, and my heart is in a panic
GBase 8a MPP与银河麒麟(x86版)完成深度适配
Smart software completed round C financing, making Bi truly "inclusive"
Introduction of functions in C language (blood Book 20000 words!!!)
Can‘t connect to server on ‘IP‘ (60)
Machine learning how to achieve epidemic visualization -- epidemic data analysis and prediction practice
Day112. Shangyitong: Mobile verification code login function
C轮融资已完成!思迈特软件领跑国内BI生态赋能,产品、服务竿头一步
为什么 ThreadLocal 可以做到线程隔离?


