当前位置:网站首页>Talking about canvas and three rendering modes in unity
Talking about canvas and three rendering modes in unity
2022-07-28 20:37:00 【_ Mr orange】
Talking about Unity Medium Canvas And three rendering modes
Catalog
Orange Preface
Doing in recently Unity Performance optimization , involves Canvas This aspect , Think of taking it out alone , Let's talk about Canvas This thing , What is it , In order to solve the doubts in the novice Xiaobai's heart .
Of course , If you are 0 Basics , Let's see how to use it first , This tutorial is suitable for entry level .
Tips : The following is the main body of this article , The following cases can be used for reference
One 、Canvas What is it? ?
Canvas: The interpretation after translation is : canvas
What I understand is : Use UGUI To carry out UI Development , Cannot do without Canvas Components , be-all UI Elements , Or include Canvas Components , Or Canvas Component location GameObject Child nodes of .
Two 、 How to create Canvas

you are here Hierarchy Right click the blank space of the view ->UI->Canvas You can create a Canvas, Then add others UI Element as its child node .
3、 ... and 、Canvas Component's RenderMode Parameters

1.Screen Space - Overlay Pattern
Canvas Cover the screen , And always cover the upper layer of other elements , in other words UI It will obscure other elements in the scene .
When RenderMode by Screen Space - Overlay when ,Canvas Other parameters of include :
- Pixel Perfect:UI Elements are aligned exactly to pixels , The edges are clearer , But in UI There will be more calculation when adjusting and adapting ( Personal understanding )
- Sort Order:Canvas The depth of the . Multiple There are multiple Canvas when ,Sort Order More valuable Canvas Will cover Sort
Order Low value Canvas - notes : Multiple Canvas When the depth values are equal ,Hierarchy Behind in the view Canvas Show below , This is related to UI
Elements ( Such as Image The rules are the opposite )
2.Screen Space - Camera Pattern
and Overlay Similar pattern ,Canvas Covering the whole screen space, the canvas also fills the whole screen space . The difference is ,Canvas Placed in front of the designated camera .
In this mode UI It may not be able to render in 3d Above the elements 
And
- It must be between the near and far planes of the camera to be rendered
- Even if the camera is Perspective Pattern ,Canvas The distance from the camera will still not affect its display size
- Other 3 Elements can be combined with Canvas Create occlusion relationship , Elements closer to the camera will cover Canvas above UI
- Zoom of camera / translation / rotate , as well as fov The change of , Does not affect the Canvas Show results ,Canvas
Always place it at a certain distance from the camera viewport , And perpendicular to the horizontal line of sight of the camera
Screen Space - Camera The parameters of include :
- Pixel Perfect : Same as Overlay Pattern meaning
- Render Camera : The specified is used to render Canvas The video camera
- Plane Distance:Canvas The distance between the plane and the camera
- Sorting Layer: instructions Canvas The depth of the , Can be added manually . When there are multiple modes, it is Screen Space Of Canvas
when ,Sorting Layer Determines the priority of display . - Order in Layer: Multiple Canvas Have the same Sorting Layer when , according to Order in Layer
To determine the display priority .
3.World Space Pattern
In this mode ,Canvas And other in the scene 3D There is no difference between elements 
here
- Canvas You can adjust RectTransform The numerical
- Camera translation, rotation, zoom and fov Will affect Canvas Display of
- need EventCamera To specify the camera that accepts the event
Four 、 summary
Different models of Canvas Between ,Screen Space - Overlay Of Canvas Always show in the front ,Screen Space
-Camera and World The display relationship of depends on World Canvas Distance from the camera and Screen Space - Camera Canvas Of Plane Distancesame Screen Space - Overlay Canvas : The display priority is determined by Sort Order determine
same Screen Space - Camera: The display priority is determined by Sorting Layer and Order in Layer determine
5、 ... and 、 Conclusion
Inferior to silicon step , A thousand miles .
Don't product the little stream , Beyond into the sea .
Make a little progress every day Thank you for watching .
Feel helpful to yourself , Welcome to your attention 、 Collection 、 forward ! See you next time
边栏推荐
- Classes and objects (medium)
- Network shell
- File lookup and file permissions
- Read JSON configuration file to realize data-driven testing
- CM4 development cross compilation tool chain production
- 太空射击第10课: Score (繪畫和文字)
- LVS load balancing cluster
- [C语言刷题篇]链表运用讲解
- 平均海拔4000米!我们在世界屋脊建了一朵云
- Raspberry pie 3b ffmpeg RTMP streaming
猜你喜欢

Raspberrypico analytic PWM

Classes and objects (medium)

一文了解 Rainbond 云原生应用管理平台

Quick sort template

js网页黑白背景开关js特效

读取json配置文件,实现数据驱动测试

[dynamic link library (DLL) initialization example program failed "problem]

Voice controlled robot based on ROS (II): implementation of upper computer
![Linxu [permission, sticky bit]](/img/57/ceacb5c67b97db8a4743cb319f81d7.png)
Linxu [permission, sticky bit]

Soft raid
随机推荐
[dynamic link library (DLL) initialization example program failed "problem]
The product power is greatly improved, and the new Ford Explorer is released
Introduction to seven kinds of polling (practice link attached)
一碰撞就自燃,谁来关心电池安全?上汽通用有话说
产品经理访谈 | 第五代验证码的创新与背景
User and group and authority management
Storage of C language data in memory (1)
File lookup and file permissions
h5微信射击小游戏源码
Network shell
Solutions to the environment created by Anaconda that cannot be displayed in pycharm
DHCP.DNS.NFS
Product manager interview | innovation and background of the fifth generation verification code
Data mining (data preprocessing) -- Notes
超大模型工程化实践打磨,百度智能云发布云原生AI 2.0方案
Nocturnal simulator settings agent cannot be saved
Raspberry connects EC20 for PPP dialing
Use of DDR3 (axi4) in Xilinx vivado (1) create an IP core
一文让你搞懂什么是TypeScript
华为云数字资产链,“链”接数字经济无限精彩