当前位置:网站首页>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)
边栏推荐
- C # basic 4-written examination question 1
- Redis 3.0源码分析-数据结构与对象 SDS LIST DICT
- Record an error in runtime. Getruntime().Exec ("command")
- Baklib | why do enterprises need to pay attention to customer experience?
- Space shooting Lesson 13: explosion effect
- C foundation 8-reflection and dependency injection
- dll反编译(反编译加密dll)
- Unity typewriter teaches you three ways
- Understanding of C # delegate
- JS picture hanging style photo wall JS special effect
猜你喜欢

Redis 3.0 source code analysis - data structure and object SDS list Dict

Prize essay solicitation | 2022 cloud native programming challenge draft activity opens

什么是数据中台?数据中台带来了哪些价值?_光点科技

如何平衡SQL中的安全与性能?

How do we do full link grayscale on the database?

Job CE
![[complete collection of common ADB commands and their usage (from a comprehensive summary of [wake up on Sunday)]](/img/63/91b53b0ba718537383a97df59fe573.png)
[complete collection of common ADB commands and their usage (from a comprehensive summary of [wake up on Sunday)]

JS win7 transparent desktop switching background start menu JS special effect

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

Thinking and summary of R & D Efficiency
随机推荐
mysql梳理复习内容--附思维导图
Fragment中使用ViewPager滑动浏览页面
GIS数据漫谈(六)— 投影坐标系统
《软件设计师考试》易混淆知识点
数据库--explain的使用
Explain the mobile control implementation of unity in detail
什么是数据中台?数据中台带来了哪些价值?_光点科技
企业如何成功完成云迁移?
【1331. 数组序号转换】
C # basic 5-asynchronous
Hangao database best practice configuration tool Hg_ BP log collection content
第六七八次作业
Space shooting Lesson 15: props
微信小程序的分包加载
System. ArgumentException: Object of type ‘System. Int64‘ cannot be converted to type ‘System.Int32‘
Unity foundation 6-rotation
Explain in detail the rays and radiographic testing in unity
什么是“安全感”?沃尔沃用它自己独特的理解以及行动来告诉你
【服务器数据恢复】HP StorageWorks系列存储RAID5两块盘故障离线的数据恢复案例
Is it necessary to disconnect all connections before deleting the PostgreSQL database?