当前位置:网站首页>Unity项目优化案例一
Unity项目优化案例一
2022-07-03 16:05:00 【听星】
针对工作中遇到的优化问题,记录一下,给大家优化自己的项目提供一些思路。
公司最近做了一个VR项目。即将交付的时候发现性能问题比较严重
使用环境
unity 2018.4.36
cpu i5 10400f
显卡 2060 6g
内存 16G
问题分析解决
程序运行起来每帧时间跑到100毫秒~
优化思路
1.对应电脑上装好开发环境
2.使用Profile进行调试定位性能问题
a.SkinMesh消耗过大。
b.有一个Depth相关的消耗也很大。影响每帧大概10~20毫秒
3.SkinMesh比较好处理,就是带动画的模型太多了,处理思路就是根据是否可见,把不需要的动画模型给隐藏掉,需要的时候再打开。
4.深度相关的没查到对应的调用函数,然后看了下调用次数大概在每帧50多次。然后猜测和相机有关,最后定位到是某个功能使用到相机渲染RenderTexture。然后创建了50多个相机。不过这个功能其实不需要相机一直处于激活状态,然后就把相机给改成反激活的状态。
5.通过FrameDebug发现阴影上的消耗也比较多,然后观察了下场景发现物体并没有产生阴影,生成阴影的选项已经关掉了(至于为啥把阴影都关了是另外话题~).然后既然场景当前的效果不需要阴影,但却会有阴影上的性能消耗,就把场景中的方向光上的阴影也给关了。
最终效果
最后效果从每帧100毫秒,优化到大部分场景5毫秒,个别模型动画多的场景12毫秒左右。总共花费时间程序2天,美术2天。
边栏推荐
- Detailed explanation of string function and string function with unlimited length
- A Fei's expectation
- 深度学习之三维重建
- Redis high availability and persistence
- Mb10m-asemi rectifier bridge mb10m
- Low level version of drawing interface (explain each step in detail)
- 初试scikit-learn库
- "Remake Apple product UI with Android" (2) -- silky Appstore card transition animation
- 找映射关系
- How to use AAB to APK and APK to AAB of Google play apps on the shelves
猜你喜欢

Microservices Seata distributed transactions

半监督学习

C language brush questions ~leetcode and simple questions of niuke.com

关于网页中的文本选择以及统计选中文本长度

Myopia: take off or match glasses? These problems must be understood clearly first

"Remake Apple product UI with Android" (3) - elegant statistical chart

Redis installation under windows and Linux systems

子类隐藏父类的同名函数

Microservices - load balancing ribbon

From "zero sum game" to "positive sum game", PAAS triggered the third wave of cloud computing
随机推荐
Chinese translation of Tagore's floating birds (1~10)
Function introduction of JMeter thread group
Slam learning notes - build a complete gazebo multi machine simulation slam from scratch (II)
用通达信炒股开户安全吗?
App mobile terminal test [4] APK operation
Redis high availability and persistence
相同切入点的抽取
2022年Q2加密市场投融资报告:GameFi成为投资关键词
近视:摘镜or配镜?这些问题必须先了解清楚
一些事情的反思
Problems of CString in multithreading
找映射关系
《微服务设计》读书笔记(上)
Project -- high concurrency memory pool
Go语言自学系列 | golang中的if else if语句
【Proteus仿真】8×8LED点阵屏仿电梯数字滚动显示
Download and install common programs using AUR
Expression of request header in different countries and languages
Wechat payment -jsapi: code implementation (payment asynchronous callback, Chinese parameter solution)
App移动端测试【3】ADB命令