Cameras

From Unify Community Wiki
Jump to: navigation, search

Unity Cameras

There are many settings for the default Unity camera. Let's look at them all, one by one.

Let's take it from the top. First you see the standard stuff: name, tag, layer, etc. Look a little further down and you'll see the Camera component. This is the component we will be looking at.


The first property is the Clear Flags dropdown. There are four options here: Skybox, Solid Color, Depth only, and Don't Clear. What this does is simple: it takes any empty space in the game and fills it in with whichever option you have chosen. The default is Skybox, so any place where nothing is being drawn, the sky will be there. Depth only is useful for rendering objects even when they are behind other objects.

The next is Background. This sets the color for the Solid Color option in Clear Flags and the Skybox option when there is no skybox material set in Edit> Render Setting> Skybox Material. So the Background variable is somewhat part of Clear Flags, and if you choose Depth only or Don't Clear, the Background setting will disappear.

Next up is the Culling With the culling mask you can set certain layers (groups of models) to not be rendered by the camera.

Projection is all about dimension. You have two options here: Perspective and Orthographic. For a 2D game, you should probably set this to Orthograhic. Orthographic removes all depth from the scene. Objects will no longer diminish in size with distance. Perspective is how we humans see things. The closer we get to things, the larger they look. If you have this set to Perspective, you will see another option beneath it called Field of View. If you set it to Orthographic it will change to Size. Field of View and Size are pretty much the same, it's basically how much the camera can see. It can also be used as a zoom.

Clipping planes is how far the camera can see. There are two values: Near and Far. Near is where it starts rendering, and Far is where it stops rendering.

Onto the Normalized View Port Rect. Sounds very fancy. It is used when making a split-screen game. In this setting you can set four different floats: X, Y, W, H. What do these letters mean? You can probably guess: X and Y are the standard axises we all know about; they are where the camera outputs to the screen, and W and H are short for Width and Height (of the camera). It's not easy to explain, but just experiment around with these and you'll understand them perfectly.

Now, the Depth setting. It doesn't seem like it does anything, but it does. If you have multiple cameras in your scene, whichever camera has the higher Depth will render on top of the output of all the other cameras. It's like stacking them up, sorted by Depth. Whichever one has the highest Depth will be on top, and the one that has the lowest will be behind all the others.

Okay, the Rendering Path is a dropdown list of the different rendering methods a camera can use. The options are: Use Player Settings, Vertex Lit, Forward, and Deferred Lighting. I'm not going to explain what these are here, because it might get a bit lengthy, and you can read about these elsewhere, but just know that you should probably have it set to Use Player Settings.

The Target Texture takes the output of the camera (using a Render Texture) and displays it somewhere in the scene. You can use it for surveillance cameras, live video monitors, mirrors, and more. This feature requries Unity Pro.

And lastly, we have the HDR checkbox. HDR means High Dynamic Range.




An image for those who don't have Unity open:

Camera 1.jpg

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox