|
2 | 2 |
|
3 | 3 |  |
4 | 4 |
|
5 | | -**Camera** captures the scene and displays it to the user. It defines a view in screen space. A camera's position and rotaton define the *viewport* and *view direction*. Those properties are used to render scene objects and present them to the user. |
| 5 | +**Camera** captures the scene and displays it to the user. It defines a view in screen space. A camera's position and rotation define the *viewport* and *view direction*. Those properties are used to render scene objects and present them to the user. |
| 6 | + |
| 7 | +## Changing the active camera |
6 | 8 |
|
7 | 9 | Flax Engine allows to create an unlimited amount of cameras in scenes while the [main one](http://docs.flaxengine.com/api/FlaxEngine.Camera.html#FlaxEngine_Camera_MainCamera) is used for the final frame rendering. |
8 | 10 |
|
| 11 | +To change the camera used for rendering, you can use the following code, where `MyCamera` is the camera you want to change to: |
| 12 | + |
| 13 | +```cs |
| 14 | +Camera.OverrideMainCamera = MyCamera; |
| 15 | +``` |
| 16 | + |
9 | 17 | ## Creating a camera in the editor |
10 | 18 |
|
11 | 19 | In the *Scene* tree window, right-click and select **New -> Camera**. |
@@ -33,18 +41,20 @@ To learn more about the C# scripting API see the [Camera](http://docs.flaxengine |
33 | 41 |
|
34 | 42 | ## Camera properties |
35 | 43 |
|
36 | | - |
| 44 | + |
37 | 45 |
|
38 | 46 | | Property | Description | |
39 | 47 | |--------|--------| |
40 | | -| **Field Of View** | The vertical field of view (in degrees) used for perspective projection. | |
41 | 48 | | **Use Perspective** | If checked, camera will use perspective projection, otherwise orthographic. | |
| 49 | +| **Field Of View** | The vertical field of view (in degrees) used for perspective projection. | |
42 | 50 | | **Near Plane** | The nearest point the camera can see (near clipping plane). | |
43 | 51 | | **Far Plane** | The furthest point the camera can see (far clipping plane). | |
44 | 52 | | **Custom Aspect Ratio** | Custom aspect ratio you specify. Otherwise, automatically adjust the aspect ratio to the render target ratio. Use value 0 to disable it. | |
45 | | -| **Orthographic Size** | The orthographic projection view height (width is based on the aspect ratio). Use `0` for size to be based on the viewport size. | |
46 | | -| **Orthographic Scale** | Additional scale used for the orthographic projection size. This has the effect of zooming in and out. | |
| 53 | +| **Orthographic Size** | *Only visible when **Use Perspective** is false.* The orthographic projection view height (width is based on the aspect ratio). Use `0` for size to be based on the viewport size. | |
| 54 | +| **Orthographic Scale** | *Only visible when **Use Perspective** is false.* Additional scale used for the orthographic projection size. This has the effect of zooming in and out. | |
47 | 55 | | **Render Layers Mask** | The layers mask used for rendering using this camera. Can be used to include or exclude specific actor layers from the drawing. | |
| 56 | +| **Render Flags** | Frame rendering flags used to switch between graphics features for this camera. See [ViewFlags](https://docs.flaxengine.com/api/FlaxEngine.ViewFlags.html) api reference. | |
| 57 | +| **Render Mode** | Describes frame rendering modes for this camera. See [ViewMode](https://docs.flaxengine.com/api/FlaxEngine.ViewMode.html). | |
48 | 58 |
|
49 | 59 | ## Masking object layers |
50 | 60 |
|
@@ -106,7 +116,7 @@ Then, the renderer will use `R16G16B16A16` format for the image textures and pas |
106 | 116 |
|
107 | 117 | ## Override view |
108 | 118 |
|
109 | | -Flax uses an extensible RenderTask system for high-level rendering achitecture. By default a game uses the `MainRenderTask.Instance` to drive the scene rendering into the main game viewport. You can use it to plug into the rendering pipeline for custom effects, rendering or view override. |
| 119 | +Flax uses an extensible RenderTask system for high-level rendering architecture. By default a game uses the `MainRenderTask.Instance` to drive the scene rendering into the main game viewport. You can use it to plug into the rendering pipeline for custom effects, rendering or view override. |
110 | 120 |
|
111 | 121 | # [C#](#tab/code-csharp) |
112 | 122 | ```cs |
|
0 commit comments