当前位置:网站首页>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)
边栏推荐
- Alibaba cloud MSE supports go language traffic protection
- Space shooting lesson 14: player life
- 如何用Redis实现事物以及锁?
- C foundation 8-reflection and dependency injection
- 【1331. 数组序号转换】
- Confusing knowledge points of software designer examination
- C reads the data in the CSV file and displays it after importing the DataTable
- JS chart scatter example
- Establishment of flask static file service
- Explain mesh Collider in unity
猜你喜欢

JS drag and drop alert pop-up plug-in

MoCo V3:视觉自监督迎来Transformer

Alibaba cloud MSE supports go language traffic protection

阿里云 MSE 支持 Go 语言流量防护

Redis的三种删除策略以及逐出算法

Space shooting Lesson 13: explosion effect

Read the recent trends of okaleido tiger and tap the value and potential behind it

"When you are no longer a programmer, many things will get out of control" -- talk to SUSE CTO, the world's largest independent open source company

Confusing knowledge points of software designer examination

EfficientFormer:轻量化ViT Backbone
随机推荐
Redis 3.0 source code analysis - data structure and object SDS list Dict
C # basic 6-file IO and JSON
既要便捷、安全+智能,也要颜值,萤石发布北斗星人脸锁DL30F和极光人脸视频锁Y3000FV
Redis的三种删除策略以及逐出算法
[server data recovery] HP StorageWorks series storage RAID5 two disk failure offline data recovery case
Explain in detail the rays and radiographic testing in unity
The 678th operation
Alibaba cloud MSE supports go language traffic protection
研发效能的思考总结
7/27 training log (bit operation + suffix array)
远光软件获得阿里云产品生态集成认证,携手阿里云共建新合作
Meaning of disk status of EMC DataDomain
It is not only convenient, safe + intelligent, but also beautiful. Fluorite releases the Big Dipper face lock dl30f and Aurora face video lock y3000fv
Introduction to redis I: redis practical reading notes
Is it necessary to disconnect all connections before deleting the PostgreSQL database?
Use order by to sort
Explain several mobile ways of unity in detail
Introduction to redis II: RedHat 6.5 installation and use
微信小程序的分包加载
Why on earth is it not recommended to use select *?