Placeholder Image

Subtitles section Play video

  • Cameras.

  • The camera is one of the most

  • essential components in Unity.

  • The camera takes the contents of our scene

  • and displays it to our users.

  • Every scene must have at least

  • one camera to render out scene objects

  • otherwise we have nothing to show.

  • When a new scene is created

  • one game object is always created.

  • This is the main camera.

  • The game view camera is a

  • component attached to a game object.

  • This means we can manipulate, or move our camera

  • like any other game object,

  • including parenting, scripting,

  • or physical interaction.

  • To create a first or third person camera,

  • including side scrollers,

  • we can use the player object as the parent.

  • For first person cameras, make sure the camera

  • is at the character's eye height

  • looking forward from the character's point of view.

  • For a third person view, make sure the camera is

  • above and behind the character.

  • For a simple puzzle game or top-down shooter

  • the camera would be static, simply

  • looking at and rendering the game.

  • In this example we are going to centre the camera,

  • remove any unwanted rotation,

  • point it straight down and lift it above

  • the game board to simulate a top-down game.

  • In this case we are using the orthographic

  • mode on the camera, which we will cover

  • later in this lesson.

  • We can have any number of cameras in our scene.

  • Each rendering different parts of the environment.

  • In this example we have three cameras.

  • One rendering all of the dynamic

  • objects in the scene. Another rendering

  • the static background and a third

  • rendering a User Interface overlay.

  • All three cameras can be brought together to

  • make a single presentation to our user.

  • We will talk about how to properly use all

  • three cameras at once later on in this lesson.

  • When a camera is selected in the hierarchy

  • we see a preview of the camera in the scene.

  • When we have multiple cameras in the scene

  • this helps us to see what the camera is rendering.

  • This preview is also helpful when we are in

  • full screen mode to see what the camera is rendering,

  • even if it's the only camera in the scene.

  • Cameras will render everything that's in

  • front of them and within their view.

  • How much of the scene is within their view

  • is shown in the scene view as a white outline.

  • This shape is a view frustum.

  • A view frustum is a pyramid, or cone,

  • with the top cut off.

  • The cut off top of the pyramid is the

  • near clipping plane and the base

  • is the far clipping plane.

  • The near and far clipping planes control

  • the draw distance from the camera.

  • Objects must be between the near and far

  • clipping planes to be rendered. The sides

  • indicate how much the camera can see

  • side to side and top to bottom.

  • and any part of the scene that's within

  • the frustum will be rendered.

  • Cameras have two different ways of

  • looking at the scene. Perspective mode

  • and orthographic mode.

  • These dramatically effect the shape and

  • size of the frustum and the

  • look of the scene through the camera.

  • In perspective mode the camera will render

  • the scene like a real world camera with

  • a sense of diminishing perspective.

  • We can see this in the scene view as the

  • white representation of the cameras

  • frustum gets larger as it extends

  • away from the camera.

  • This is the most common camera mode to use

  • when creating a game.

  • In orthographic mode there is no

  • diminishing perspective. All objects are

  • rendered using a form of parallel

  • projection from the camera. We can see this

  • in the scene view as the frustum is straight

  • and the front and back are the same size.

  • This mode is usually seen in isometric

  • games like some real time strategy or

  • board games, or for 2D

  • games, simple puzzle games and when using

  • an additional camera for rendering UI elements

  • on top of the game view, like mini

  • maps or heads-up displays.

  • To control what is being rendered in our

  • scenes, adjust the near and far clipping

  • planes and the size or shape of the frustum.

  • Field Of View controls how wide the view

  • of the camera will be. This is very much

  • like using the zoom on a real world camera.

  • When the camera is in orthographic mode

  • size replaces the field of view property.

  • This controls the size of the

  • orthographic viewport.

  • This is similar to field of view but

  • the value of the size property changes

  • the size of both the front and back planes

  • at the same time as there is no perspective

  • with an orthographic camera.

  • Our scenes must have some sort of a background.

  • This controlled by the Clear Flags and

  • Background properties.

  • The colour values set in the background

  • property will be what's drawn behind any

  • of the objects in our scene, if no other

  • settings have been changed. This is the

  • default blue colour we see in a new empty scene.

  • Clear Flags determines what the background

  • will be for a camera. This setting is particularly

  • important when using multiple cameras.

  • Each camera stores colour and depth information

  • when it renders it's view. The portions of the

  • screen that are not drawn upon are considered empty.

  • The Clear Flags property will determine

  • what is shown in this empty space.

  • If we have a skybox set in our render

  • settings the background will be a skybox.

  • Skybox is the default clear flag for any camera.

  • A skybox is a material that contains

  • several images that surround the entire scene

  • providing a textured background for that scene.

  • For more information on skyboxes and

  • render settings see the appropriate lessons.

  • If we don't have a skybox set, or we choose

  • solid colour as our clear flag.

  • The colour value from the background property

  • will be used behind any of our objects

  • in the scene.

  • Depth Only is primarily used for

  • multiple cameras. We will cover depth only

  • in a moment.

  • Don't Clear will result in each frame

  • being drawn over the last, creating

  • a smear effect. This setting isn't typically

  • used in games.

  • When using multiple cameras the most practical

  • setting for clear flags is depth only.

  • With this setting each camera is given a

  • value and depth and the contents of each

  • camera's view are layered on top of each other

  • in depth order, starting with

  • lowest depth first.

  • Normally the main camera is assigned

  • the lowest depth value

  • and has it's clear flag set to either

  • skybox or solid colour.

  • All of the other cameras have their clear

  • flags set to depth only. This way there is

  • one ultimate background, and the images

  • of all the other cameras are

  • layered on top of the main camera.

  • The content of what the camera is rendering

  • is limited by the Culling Mask property.

  • The Culling Mask drop down will list

  • all the layers available in the scene.

  • The camera will render only those objects

  • on the layers selected in it's culling mask.

  • For more information on layers and how to

  • use then see the appropriate lesson.

  • In the case of the User Interface overlay

  • we have the interface element set to the

  • UI layer. Our UI camera has it's culling mask

  • set to render only the objects on the User Interface layer

  • We have our clear flag set to depth only

  • and the depth set to the highest value

  • of all the cameras in the scene.

  • This way the UI camera only draws

  • the UI element based on the culling mask

  • setting and the UI element draws on top

  • of all of the other layers, based on the depth.

  • It is also worth noting that the camera is set to

  • orthographic to remove any possible

  • perspective on the UI element.

  • Typical uses of multiple cameras

  • are to render UI elements like

  • mini maps or heads-up displays over the

  • world view, make rear-view mirrors and

  • missile cameras, or to force the drawing order

  • of objects in the scene, like making

  • sure that a gun in a first person shooter

  • doesn't get drawn inside the level geometry.

  • The normalised viewport rect, render path,

  • target texture and HDR properties

  • are more advanced and will be covered in an other lesson.

Cameras.

Subtitles and vocabulary

Click the word to look it up Click the word to find further inforamtion about it

B1 UK camera scene view rendering render mode

Cameras - Unity Official Tutorials

  • 736 93
    朱瑛 posted on 2014/05/02
Video vocabulary

Keywords

perspective

US /pɚˈspɛktɪv/

UK /pə'spektɪv/

  • noun
  • The art of drawing solid objects on a two-dimensional surface so as to give the right impression of their height, width, depth, and position in relation to each other.
  • The art of drawing solid objects on a two-dimensional surface so as to give the right impression of their height, width, depth, and position in relation to each other.
  • Artistic method of creating a sense of distance
  • A sense of the relative importance of things; a sense of proportion.
  • The appearance of objects to an observer, especially concerning their relative distance and position.
  • Ability to understand what is important in life
  • A particular way of considering something; a point of view.
  • other
  • The art of drawing solid objects on a two-dimensional surface so as to give the right impression of their height, width, depth, and position in relation to each other.
  • The art of drawing solid objects on a two-dimensional surface so as to give the right impression of their height, width, depth, and position in relation to each other.
  • The capacity to view things in their true relations or relative importance.
  • The capacity to view things in their true relations or relative importance.
multiple

US /ˈmʌltəpəl/

UK /ˈmʌltɪpl/

  • adjective
  • Having or involving more than one of something
  • Capable of handling more than one task or user at a time.
  • Consisting of or involving more than one.
  • Affecting many parts of the body.
  • More than one; many.
  • Having or involving several parts, elements, or members.
  • noun
  • Number produced by multiplying a smaller number
  • A ratio used to estimate the total value of a company.
  • A number of identical circuit elements connected in parallel or series.
  • A number that can be divided by another number without a remainder.
  • pronoun
  • More than one; several.
scene

US /sin/

UK /si:n/

  • noun
  • Incident where someone behaves angrily, badly
  • View that looks like a picture
  • Place where something particular happened
  • Part of an act in a play
set

US /sɛt/

UK /set/

  • verb
  • To put something in a particular place or position.
  • To fix or direct one's mind or attention on something.
  • To put a broken bone into the correct position for healing.
  • To put a broken bone into the correct position for healing.
  • To make a clock state or ring at a particular time
  • To decide upon or choose something
  • To start a journey or activity.
  • To make something ready for use (e.g. table)
  • To establish or decide on something.
  • To decide on a price for something
  • To become hard (of glue, concrete etc.)
  • To become firm or hard.
  • To be located in a specific place or time
  • To put words to music.
  • To prepare something for use.
  • To arrange type for printing.
  • To put (e.g. a vase) down carefully in a place
  • To put someone in a certain condition or state
  • (Of the sun) to go lower than the horizon
  • noun
  • A determined or resolute attitude.
  • Complete group of something
  • Place where a television show or movie is filmed
  • The scenery and props used for a play or film.
  • A television receiver.
  • Group of games in a tennis match
  • Device that receives radio or television signals
  • adjective
  • Prepared for something; ready
  • Fixed; not able to be changed.
property

US /ˈprɑpəti/

UK /'prɒpətɪ/

  • noun
  • Particular quality that someone or something has
  • A quality or characteristic of something.
  • A building or area of land.
  • A rule or fact in mathematics.
  • Buildings or piece of land owned by someone
  • A quality or characteristic of something.
  • An object used on stage or in a film.
  • An object used on the stage in a play or film; a prop.
  • other
  • Land and buildings.
  • The legal right to own something.
  • Something that is owned by a person or organization.
object

US /ˈɑbdʒɪkt/

UK /'ɒbdʒɪkt/

  • other
  • To express or feel disapproval or opposition.
  • To state one's reason for disagreement
  • To present as an object of meditation or contemplation.
  • To express or feel disapproval or opposition.
  • noun
  • A noun or noun phrase governed by a verb or preposition.
  • A purpose or aim.
  • A material thing that can be seen and touched.
  • Something you can see or touch, but is not alive
  • Goal or purpose of a particular plan or activity
  • A noun or noun phrase governed by a verb or preposition.
  • The aim or purpose of something
  • The thing that the action of a verb acts upon
  • A person or thing to which action, thought, or feeling is directed.
  • A purpose or aim.
  • A material thing that can be seen and touched.
  • verb
  • To disagree; to protest against an idea or plan
element

US /ˈɛləmənt/

UK /'elɪmənt/

  • noun
  • A substance that cannot be broken down into simpler substances by chemical means.
  • A basic part of something.
  • A distinct part of a whole, especially in a computer system.
  • A situation or environment that suits someone well.
  • Essential or particular part of something
clip

US /klɪp/

UK /klɪp/

  • noun
  • A metal holder used for keeping things together
  • Brief part of a television show or movie
  • verb
  • To attach things together using a metal pin
  • To cut a small section or piece out from something
  • To hit something briefly at an angle
top

US /tɑp/

UK /tɒp/

  • verb
  • To be higher or larger than a specific value
  • To arrive at the highest point of something
  • To be more or better than (something).
  • To put a cover or layer or over something
  • To kill; murder
  • To hold the highest position on a list
  • To be higher than (something else).
  • To be more important, successful or better than
  • To beat someone or win at a game
  • other
  • To put something on the top of something else.
  • To exceed or surpass.
  • To remove the top of something.
  • adjective
  • Best; most excellent.
  • The dominant partner in a sexual relationship.
  • Being good or great; excellent
  • In charge; in command.
  • Highest in position, rank, or importance.
  • Being the most in degree or quality
  • noun
  • Item of clothing covering shoulders to waist, hips
  • An item of clothing for the upper part of the body.
  • A lid or cover for a container.
  • A cover or lid
  • Part (e.g. road) that is the furthest away
  • Highest or upper part or point of something
  • Marijuana.
  • The highest rank or position.
  • A toy that spins on its point.
  • Best or highest status or position
  • The upper surface of something.
  • Flat upper surface or edge of an object
  • Child's toy that spins on its point
  • Upper section or leaves of fruits and vegetables
  • Winning in a sport or contest
  • other
  • To reach a maximum speed or level.
clear

US /klɪr/

UK /klɪə(r)/

  • adjective
  • Empty; without anything in it or on it
  • Being certain and without doubt
  • Being without any streaks, spots, or cracks
  • Easy to understand; well-explained; obvious
  • adverb
  • Completely; entirely; through the whole of
  • Away from; free from
  • verb
  • To recover from or remove a problem
  • To get rid of the entire contents of
  • To give permission for something to happen
  • To make a place or surface empty by removing
  • To prove that someone is not guilty or to blame