当前位置:网站首页>2022-04-20 unity introduction 5 - Camera
2022-04-20 unity introduction 5 - Camera
2022-07-18 02:30:00 【Sugarcane causes bitterness】
List of articles
One 、 Parameter panel

Two 、 Parameter Introduction
Clear Flags: Clear the background
Skybox: Sky box background ( Usually used to make 3D game )
Solid Color: Use Background Color fill ( Usually set to all black or all white ,2D Use )
Depth Only: Draw only this layer , The background is transparent ( Use when multiple cameras overlay rendering )
Don’t Clear: Do not remove the previous frame , Overlay rendering , Usually do not use
stay Game Cancel the following settings under the window , Moving objects , You will see a superimposed shadow :

Background: The background color , Match as above Clear Flags Use
Culling Mask: Selective rendering part Layer Hierarchy
You can set the Layer Hierarchy , And then in Camera Medium Culling Mask Set the level to be displayed .

Projection: Projection mode
Perspective: Perspective mode , The object is near big and far small
FOV Axis: Field angle 、 Axis
Decided the following Field of View Is it calculated horizontally or vertically , Generally, there is no need to change
Field of View: Viewport size
Physical Camera: Physical camera
2019 The new version features , When checked, simulate the focal length of the camera in the real world 、 Sensor size 、 Lens displacement, etc , Generally not used

- Focal Length: The focal length
- Sensor Type: Sensor type
- Sensor Size: Sensor size
- Lens Shift: Lens shift
- Gate Fit: Gate fit
Orthographic: Orthogonal mode , The objects displayed far and near are the same size
- Size: The range of settings
Clipping Planes: Clipping plane distance
The area shown by the camera is a pyramid , Not a pyramid .

Viewport Rect: Camera viewport range
Determines the position and size of the camera drawing on the screen , Mainly used in dual camera Games ,0 ~ 1 Expressed as a percentage


Depth: Depth of rendering order
Depth The bigger it is , The lower the priority , After being rendered , The higher the picture is
Can cooperate with Clear Flags Medium Depth Only Use (UICamera)
Rendering Path: Render path
You can ignore it at present
Target Texture: Render textures
Project the picture of the camera onto a picture , The drawing needs to be in Project Right click to create Render Texture
Mainly used for making small maps


Occlusion Culling: Whether to enable culling occlusion
Occluded objects will not be rendered , Usually check , To save performance
HDR: High dynamic range rendering
You can ignore it at present
MSAA: Anti-Aliasing
You can ignore it at present
Allow Dynamic Resolution: Whether to allow dynamic resolution rendering
You can ignore it at present
Target Display: On which display is the camera drawn
It is mainly used to develop platform games with multiple screens
Target Eye:VR Is it displayed in the left eye or the right eye
You can ignore it at present
Target Display: On which display is the camera drawn
It is mainly used to develop platform games with multiple screens
Target Eye:VR Is it displayed in the left eye or the right eye
3、 ... and 、 Code control
( One ) Important static members
- Get the camera
// If you use previous knowledge To get the camera
// Acquisition of main camera
// If you want to pass this way Get the camera quickly Then there must be one in the scene tag by MainCamera The video camera
print(Camera.main.name);
// Number of cameras acquired
print(Camera.allCamerasCount);
// Get all the cameras
Camera[] allCamera = Camera.allCameras;
print(allCamera.Length);
- Rendering related delegates
// Delegate function for camera culling pre-processing
Camera.onPreCull += (c) => {
};
// The camera Delegate before rendering
Camera.onPreRender += (c) => {
};
// The camera After rendering Processing delegation
Camera.onPostRender += (c) => {
};
( Two ) Key members
- Interface parameters
// Parameters on the interface Can be in Camera Get to the
// such as The following code Is to get the main camera object The depth of the Set it up
Camera.main.depth = 10;
- World coordinates to screen coordinates
// After conversion x and y The corresponding screen coordinates z Corresponding yes This 3D object How far is our camera in
// We will use this to do the function The most Is the function related to the blood bar on the top of the head
Vector3 v = Camera.main.WorldToScreenPoint(this.transform.position);
- Screen coordinates to world coordinates
// The reason for the change Z Axis Because If you don't change Z The default is 0
// Convert points in the past world coordinate system Always a point It can be understood as viewport Intersecting focus
// If it changes Z Then change the past Point of world coordinates It's relative to How many units in front of the camera are the world coordinate points on the cross section
Vector3 v = Input.mousePosition;
v.z = 5;
obj.position = Camera.main.ScreenToWorldPoint(v);
边栏推荐
- Svn download and Chinese package installation
- 【黑马早报】东方甄选CEO:董宇辉是总裁级主播;李亚鹏欠债4000万终审败诉;15家商业银行称停贷风险可控;红杉大幅减持美团...
- Experiment 3 Course selection system
- Golang problem summary
- QT connection MySQL
- 如何选择合适的自动化测试工具?
- H5打开微信小程序
- Configure the C locale of sublime
- Easy gene encode histone chip SEQ and transcription factor chip SEQ data standard and processing flow
- 许式伟:Go+ 演进之路
猜你喜欢

Deep understanding and recognition of C language symbols

Involve yourself? After imagen, it launched an image model generated by 20billion text, which stunned netizens!
![[dark horse morning post] Dongfang selects CEO: dongyuhui is the president level anchor; Li Yapeng owed 40million yuan and lost the final judgment; 15 commercial banks said the risk of loan suspension](/img/58/8d5c78d919ed60bc833ec4daa22e23.jpg)
[dark horse morning post] Dongfang selects CEO: dongyuhui is the president level anchor; Li Yapeng owed 40million yuan and lost the final judgment; 15 commercial banks said the risk of loan suspension

龙蜥社区招募推广大使&体验官啦!| 人人都可以参与开源

Latex數學公式

Beijing Institute of technology - spring 2021 - Digital Logic Experiment

Google 推荐在项目中使用 sealed 和 RemoteMediator

2022-04-20 Unity入门5——Camera

2022-04-21 Unity基础1——3D数学

Niu Wenwen: specialized in the new era, new models and new styles are needed
随机推荐
Yunna dynamic loop monitoring system realizes unmanned rapid fault handling
【综合笔试题】难度 2/5,递归运用及前缀和优化
2022-04-19 Unity入门4——重要组件与API
可落地的DDD(7)-战术设计上的一些误区
Deep understanding and recognition of C language symbols
Experiment 1 Security mechanism of SQL Server
云呐-动环监控系统实现无人化的快速故障处理
卷到自己?继 Imagen 之后,推出200 亿文本生成的图像模型惊呆网友!
开源实时数仓 Apache Doris 毕业了,未来如何走得更远?
[dark horse morning post] Dongfang selects CEO: dongyuhui is the president level anchor; Li Yapeng owed 40million yuan and lost the final judgment; 15 commercial banks said the risk of loan suspension
Career masters help you with interview and job search + career development
从底层结构开始学习FPGA----MMCM与PLL
three.js无限跑动VR小游戏
Redis使用管道PipeLine
Niu Wenwen: specialized in the new era, new models and new styles are needed
【NLP】一个支持低资源、长篇章、多模态的开源知识抽取工具——DeepKE
缓存雪崩、缓存击穿、缓存穿透
Iqiyi joins dragon dragon community to build a diversified video ecological base together
Easy gene encode histone chip SEQ and transcription factor chip SEQ data standard and processing flow
竟然如此简单,DataBinding 和 ViewBinding