当前位置:网站首页>Unity3d tutorial notes - unity initial 03
Unity3d tutorial notes - unity initial 03
2022-07-28 21:00:00 【Small digital media members】
Here is finishing unity The third day of tutorial notes ! Another day full of harvest !!!
One sentence per day : Be a gentle person , Never be humble or arrogant, clear and kind
plug-in unit :Instant OC
[ link :https://pan.baidu.com/s/1A8IUPgpk8rGgzE7NnbY0DA?pwd=ufl2
Extraction code :ufl2( Free access to bloggers' online disks Instant OC plug-in unit , Don't forget Click the blog post to thank you )]
03DAY
Catalog
Make a small map of the game scene
The depth of the cache z-buffer:
Occlusion Culling Occlusion culling :
Three aspects of performance optimization :
Make a small map of the game scene
Make the model of the camera look like an object , Just put them in a unified parent object , Operate on the parent object ——> The camera can have multiple ,Audio Listener( Ears ) There can only be one

( Error prompt of two cameras )——> Depth adjustment value ——> Make a plane on the character , Used as a small map logo ,Main Camera Don't want to see the plane ,MipCamera Don't want to see people : New layer , use Culling Mask hide



( During actual development : The map camera doesn't let you see the terrain , Rendering costs a lot , The artist prepares a picture and puts it on the ground ,camera Just look at the character logo , Performance optimization )——> Remove the blank part of the small map :MipCamera—>Clear Flags—>Depth Only( Do not render blank space )
Render pipeline :
Graphic data in GPU After arithmetic processing , The process of finally outputting to the screen
CPU: a central processor
GPU: The graphics card , Make a rendering of

Draw Call(unity5 It's called Batches): Every time the engine prepares data and notifies GPU The process of . Popular speaking , The number of times the graphics card is called to render objects per frame
(Batches The bigger it is , Render more , To reduce Batches)

Vertex Processing :
Accept (GPU Send it ) Model vertex data ; Coordinate transformation
Primitive Assembly :
Assembly surface : Connect adjacent vertices , Draw triangular faces

Rasterize :
Calculate the pixels on the triangular plane , And provide reasonable interpolation parameters for the later coloring stage

Pixel processing :
Shade each pixel region , Write to cache
cache :
A storage pixel data Memory block , The most important caches are frame cache and depth cache
Frame cache :
Store the of each pixel color , namely Rendered image . The frame buffer is often in the graphics card , The graphics card constantly reads and outputs to the screen
The depth of the cache z-buffer:
Storing pixels In depth information , namely The distance from the object to the camera .
When rasterizing, the depth value of each pixel is calculated , If the new depth value is more than the existing depth value near , be Pixel color Written to Frame cache , And replace the depth cache .
Occlusion Culling Occlusion culling :
meaning ( advantage ):
Before the object is sent to the rendering pipeline , Remove objects that cannot be seen in the camera's perspective , This reduces the amount of rendering data per frame , Improve rendering performance ( advantage )
plug-in unit :Instant Occlusion Culling
[ link :https://pan.baidu.com/s/1A8IUPgpk8rGgzE7NnbY0DA?pwd=ufl2
Extraction code :ufl2( Free access to bloggers' online disks Instant OC plug-in unit , Please click the blog post to thank you )]

shortcoming :
Judge whether the object is covered ,CPU Using extra overhead
Applicability :
In the scene , Objects are densely distributed and there are a large number of blocked objects
step :
1. Create layers
2. Make a layer for the game ( Remove the participating occlusion ) And labels ( Will automatically attach IOClod Script )
3. Add Collider to the object Collider Components
4. Camera additional script IOCcam.
LOD
meaning ( advantage ):
Multiple levels of detail (Level Of Detail)
LOD Technology refers to the importance of the position of the nodes of the object model in the display environment , Determine the resource allocation for object rendering , Reduce the number of faces and detail of unimportant objects , Thus, efficient rendering operations may be obtained
It reduces the distance between the camera and the model to select high 、 in 、 Low model (Lod_0 Fine mold 、Lod_1 Medium model 、Lod_2 Simple model )
attribute :
lod 1distance: When the distance between the camera and the object is less than the current distance , Use Lod_0 Model
lod 2distance: The distance between the camera and the object is greater than Lod 1 And less than the current distance , Use Lod_1 Model , Greater than the current value , Use Lod_2 Model
step :
- Create layers
- Create an empty object and put the model (Loa_0、Loa_1、Loa_2) Add to
- Assign layers and labels to parent objects
- Add collider components to parent or child objects
- . Camera additional script IOCcam
Applicability :
Scene , There are high modes and the high modes will vary far and near
shortcoming :
CPU Consume 、 Take up memory ( The original one , Now three )、( Art works need to make three models )

Three aspects of performance optimization :
CPU Use 、 Rendering 、 Memory usage

(window——>Profiler)
边栏推荐
- 有奖征文 | 2022 云原生编程挑战赛征稿活动开启
- Huawei cloud digital asset chain, "chain" connects the digital economy, infinite splendor
- 图书馆借阅系统「建议收藏」
- 2 enjoy yuan mode
- Leetcode:2141. The longest time to run n computers at the same time [the maximum value is two points]
- NAT实验演示(Huawei交换机设备配置)
- Redis 3.0 source code analysis - data structure and object SDS list Dict
- Why on earth is it not recommended to use select *?
- mfc wpf winform(工业用mfc还是qt)
- 一文读懂Okaleido Tiger近期动态,挖掘背后价值与潜力
猜你喜欢

System. ArgumentException: Object of type ‘System. Int64‘ cannot be converted to type ‘System.Int32‘

Space shooting Lesson 15: props

云原生编程挑战赛火热开赛,51 万奖金等你来挑战!

Unity foundation 6-rotation

Redis入门一:Redis实战读书笔记

Subcontracting loading of wechat applet

如何用Redis实现事物以及锁?

LVS+KeepAlived高可用部署实战应用

Alibaba cloud MSE supports go language traffic protection

The 678th operation
随机推荐
Three deletion strategies and eviction algorithm of redis
图书馆借阅系统「建议收藏」
Laser slam:logo-loam --- code compilation, installation and gazebo test
什么是数据中台?数据中台带来了哪些价值?_光点科技
Redis 3.0源码分析-数据结构与对象 SDS LIST DICT
Explain in detail the rays and radiographic testing in unity
到底为什么不建议使用SELECT * ?
想画一张版权属于你的图吗?AI作画,你也可以
云原生编程挑战赛火热开赛,51 万奖金等你来挑战!
Space shooting Lesson 11: sound and music
Want to draw a picture that belongs to you? AI painting, you can also
“当你不再是程序员,很多事会脱离掌控”—— 对话全球最大独立开源公司SUSE CTO...
一文读懂Okaleido Tiger近期动态,挖掘背后价值与潜力
mysql还有哪些自带的函数呢?别到处找了,看这个就够了。
MoCo V1:视觉领域也能自监督啦
Lvs+keepalived high availability deployment practical application
Redis的三种删除策略以及逐出算法
ZCMU--5066: 黑暗长廊
JS drag and drop alert pop-up plug-in
第六七八次作业