当前位置:网站首页>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)
边栏推荐
- Explain the mobile control implementation of unity in detail
- prometheus配置alertmanager完整过程
- Beautiful blue background form input box style
- "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
- Redis入门二:redhat 6.5安装使用
- Network layer performance test
- C # basic 4-written examination question 1
- Record an error in runtime. Getruntime().Exec ("command")
- Subcontracting loading of wechat applet
- Explain prefabrication in unity in detail
猜你喜欢

Explain the life cycle function in unity in detail

What is data center? What value does the data center bring_ Light spot technology

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

不懂就问,快速成为容器服务进阶玩家!

Confusing knowledge points of software designer examination
![[server data recovery] HP StorageWorks series storage RAID5 two disk failure offline data recovery case](/img/7c/d5643d27c2ca7a7aed4eb02fd81042.jpg)
[server data recovery] HP StorageWorks series storage RAID5 two disk failure offline data recovery case

Beautiful blue background form input box style

Random talk on GIS data (VI) - projection coordinate system

Unity foundation 6-rotation

MoCo V2:MoCo系列再升级
随机推荐
Leetcode:2141. The longest time to run n computers at the same time [the maximum value is two points]
蓝队入门之效率工具篇
C foundation 8-reflection and dependency injection
Space shooting Lesson 16: props (Part 2)
Introduction to singleton mode
Seventeen year operation and maintenance veterans, ten thousand words long, speak through the code of excellent maintenance and low cost~
算法面试高频题解指南【一】
什么是“安全感”?沃尔沃用它自己独特的理解以及行动来告诉你
How can enterprises successfully complete cloud migration?
查询oracle视图创建语句及如何向视图中插入数据[通俗易懂]
什么是低代码?哪些平台适合业务人员?用来开发系统靠不靠谱?
C # basic 4-written examination question 1
Read the recent trends of okaleido tiger and tap the value and potential behind it
Unity foundation 6-rotation
prometheus配置alertmanager完整过程
Space shooting lesson 09: elf animation
NAT实验演示(Huawei交换机设备配置)
Space shooting Lesson 11: sound and music
“当你不再是程序员,很多事会脱离掌控”—— 对话全球最大独立开源公司SUSE CTO...
十七年运维老兵万字长文讲透优维低代码~