当前位置:网站首页>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天。
边栏推荐
- Redis高可用与持久化
- First knowledge of database
- UnityShader——MaterialCapture材质捕捉效果 (翡翠斧头)
- Slam learning notes - build a complete gazebo multi machine simulation slam from scratch (III)
- Go language self-study series | golang switch statement
- [proteus simulation] 74hc595+74ls154 drive display 16x16 dot matrix
- pycharm错Error updating package list: connect timed out
- 半监督学习
- Client does not support authentication protocol requested by server; consider upgrading MySQL client
- 嵌入式开发:避免开源软件的7个理由
猜你喜欢

From the 18th line to the first line, the new story of the network security industry

Please be prepared to lose your job at any time within 3 years?

How to thicken the brush in the graphical interface

ASEMI整流桥UMB10F参数,UMB10F规格,UMB10F封装

半监督学习

App移动端测试【4】apk的操纵

Break through 1million, sword finger 2million!

Record a jar package conflict resolution process

Find mapping relationship

Microservice - fuse hystrix
随机推荐
Q2 encryption market investment and financing report in 2022: gamefi becomes an investment keyword
Microservice - Nacos registration center and configuration center
Client does not support authentication protocol requested by server; consider upgrading MySQL client
利用MySQL中的乐观锁和悲观锁实现分布式锁
Microservice API gateway
【OpenCV 例程200篇】217. 鼠标交互获取多边形区域(ROI)
Persisting in output requires continuous learning
SDNU_ ACM_ ICPC_ 2022_ Winter_ Practice_ 4th [individual]
子类隐藏父类的同名函数
[combinatorics] combinatorial identity (sum of variable upper terms 1 combinatorial identity | summary of three combinatorial identity proof methods | proof of sum of variable upper terms 1 combinator
请做好3年内随时失业的准备?
Pandora IOT development board learning (HAL Library) - Experiment 5 external interrupt experiment (learning notes)
Is it safe to open an account with tongdaxin?
Microservice API gateway zuul
Microservice - declarative interface call openfeign
【Proteus仿真】74HC595+74LS154驱动显示16X16点阵
《微服务设计》读书笔记(上)
Famous blackmail software stops operation and releases decryption keys. Most hospital IOT devices have security vulnerabilities | global network security hotspot on February 14
[proteus simulation] 8 × 8LED dot matrix screen imitates elevator digital scrolling display
Microservice - fuse hystrix