当前位置:网站首页>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 )
边栏推荐
- Quickly build a gateway service, dynamic routing and authentication process, and watch the second meeting (including the flow chart)
- [activity registration] User Group Xi'an - empowering enterprise growth with modern data architecture
- Redis 基本知识,快来回顾一下
- Argocd Web UI loading is slow? A trick to teach you to solve
- leetcode刷题,我推荐B站这个妹子学霸的视频
- Kubernetes technology and Architecture (VII)
- 思迈特软件完成C轮融资,让BI真正实现“普惠化”
- Why is the text box of Google material design not used?
- Opengauss synchronization status query
- Win the bid! Nantah general gbase 8s won the bid for the 2022 database framework project of NARI Group
猜你喜欢

GBase 8a MPP与银河麒麟(x86版)完成深度适配

Alibaba internal interview materials

Shell编程规范与变量

Line generation (matrix)

You're not still using xshell, are you? This open source terminal tool is yyds!

Win the bid! Nantah general gbase 8s won the bid for the 2022 database framework project of NARI Group

分布式系统架构理论与组件

Leetcode brushes questions. I recommend this video of the sister Xueba at station B

NDK 系列(6):说一下注册 JNI 函数的方式和时机

解决:IndexError: index 13 is out of bounds for dimension 0 with size 13
随机推荐
Sparksql and flinksql create and link table records
机器学习如何做到疫情可视化——疫情数据分析与预测实战
There is a bug in installing CONDA environment
博客搭建七:hugo
When unity switches to another scene, he finds that the scene is dimmed
竞赛:糖尿病遗传风险检测挑战赛(科大讯飞)
Blog Building 9: add search function to Hugo
How to import and export Youxuan database
PHP Basics - PHP uses PDO
Opengauss synchronization status query
postgresql查询【表字段类型】和库中【所有序列】
Three ways to create threads
优炫数据库导入和导出方法
模型预测控制(MPC)解析(九):二次规划的数值解(下)
ciou损失
Network interface network crystal head RJ45, Poe interface definition line sequence
Shell编程规范与变量
PostgreSQL: cannot change the type of column used by a view or rule
阿里技术四面+交叉面+HR面,成功拿到offer,双非本科进不了大厂?
图片批处理|必备小技能


