当前位置:网站首页>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
边栏推荐
- Use of DDR3 (axi4) in Xilinx vivado (5) board test
- SQL审核工具自荐Owls
- MySQL error: specified key was too long; max key length is 767 bytes
- [task03: complex query methods - views, subqueries, functions, etc.]
- Pop up modal box
- 弹出模态框
- Speech controlled robot based on ROS (I): realization of basic functions
- js win7透明桌面切换背景开始菜单js特效
- 关于正则的两道笔试面试题
- Representation of base and number 2
猜你喜欢
![[C语言刷题篇]链表运用讲解](/img/44/1de4e3f0712780680fbdc904dfe39a.png)
[C语言刷题篇]链表运用讲解

类与对象(中)
![[fasttext -- Summary notes]](/img/4d/2871b2525bf0ea75ee958338b18013.png)
[fasttext -- Summary notes]

Related concepts of multitasking programming

七种轮询介绍(后附实践链接)

Configure Windows Server + install MySQL database on the server + Remote Access database
![[C language] comprehensively analyze the pointer and sort out the pointer knowledge points](/img/71/f4138b68c27d6447fbd5b5e0762929.png)
[C language] comprehensively analyze the pointer and sort out the pointer knowledge points

Raspberry pie 4B deploy yolov5 Lite using ncnn

Use of DDR3 (axi4) in Xilinx vivado (4) incentive design

Network shell
随机推荐
Durham High Lord (classic DP)
js飞入js特效弹窗登录框
Who cares about the safety of the battery when it ignites in a collision? SAIC GM has something to say
New fruit naming (DP is similar to the longest common subsequence)
Data mining (data preprocessing) -- Notes
【CodeForces】Educational Codeforces Round 132 (Rated for Div. 2)
太空射击第15课: 道具
同质化代币与 NFT 结合,如何使治理结构设计更灵活?
超大模型工程化实践打磨,百度智能云发布云原生AI 2.0方案
User and group and authority management
Database tuning - connection pool optimization
3D激光SLAM:LeGO-LOAM论文解读---简介部分
[POC - proof of concept]
[task03: complex query methods - views, subqueries, functions, etc.]
7/27 训练日志(位运算+后缀数组)
产品力大幅提升 新款福特探险者发布
DSACTF7月re
Anaconda creation environment
Common instructions of vim software
h5微信射击小游戏源码