Making games
Cameras
The game draws from a Camera component. A scene can have several (a player’s view, a security monitor, a cutscene angle), and the one with Active turned on is the one the game draws from. Scene → Camera creates one.
To follow something, make the camera a child of it, or move the camera from a
script each frame. The Escape example’s camera_follow.cog does the second.
Projection
| Property | What it does |
|---|---|
| Projection | Perspective for a normal 3D view, Orthographic for a flat one with no shrinking into the distance (strategy maps, 2D-style games). |
| Field of view | With perspective, how wide the view is, top to bottom, in degrees. 60 to start. |
| Size | With orthographic, how many units tall the view is. |
| Near clip, Far clip | The closest and farthest the camera can see. Keep near as large as you can get away with: a tiny near clip makes distant surfaces flicker against each other. |
The picture
| Property | What it does |
|---|---|
| Clear, Clear color | When on, the camera’s own background color behind everything, instead of the editor’s default. |
| Exposure | Brightens or darkens the frame before tonemapping. 1 is the scene as lit. |
| Tonemap | How a bright scene is fit onto a screen: ACES (filmic, the default), Reinhard (gentler), or None. |
| Bloom intensity | How much glow bright areas get. 0 turns bloom off. |
| Bloom threshold | How bright something must be to glow. 1 is “brighter than the screen can show”. |
Scripts can read the active camera’s direction as Camera.forward and
Camera.right (each a Vec3), which is how a third-person controller moves relative to the
view. See the Cog API.