TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl/llms.txt
Use this file to discover all available pages before exploring further.
Camera component is the entry point for all rendering in Prowl. Every frame, SceneManager.Draw() collects every active Camera in the scene, sorts them by their Depth property, and calls the camera’s associated RenderPipeline.Render() — producing a fully composited image including lighting, shadows, post-processing, and GUI. Understanding how cameras work is fundamental to building anything visual: from a simple single-view game to a split-screen HUD, a minimap, or a cinematic cutscene system.
Adding a Camera
Add aCamera component to any GameObject from the Rendering → Camera menu in the editor, or do it in code:
Camera.Main returns the first camera tagged "Main Camera", or the first Camera found in the scene if no tag match exists. The result is cached with a WeakReference and re-queried automatically when the reference becomes invalid.Projection Modes
Cameras support two projection types controlled byCamera.projectionType.
- Perspective
- Orthographic
Perspective projection simulates natural depth — objects further away appear smaller. This is the standard mode for 3D games.
Core Camera Properties
FieldOfView
Vertical field of view in degrees (perspective mode only). Defaults to
60f. Typical values range from 50° to 90°. Use Camera.IsOrthographic to check the active mode.NearClipPlane / FarClipPlane
Objects closer than
NearClipPlane or farther than FarClipPlane are not rendered. Keep the ratio Far/Near as small as practical to avoid depth precision issues.Depth
Render order among multiple cameras.
SceneManager.Draw() sorts cameras ascending by Depth. Cameras with lower Depth render first (i.e., behind higher-depth cameras). Defaults to -1.CullingMask
A
LayerMask that controls which object layers this camera renders. Use it to exclude UI objects from a world camera, or to dedicate a second camera purely to UI.RenderScale
Scales the internal render resolution relative to the target framebuffer.
1.0 is native resolution; 0.5 renders at half resolution for performance; 2.0 for supersampling.HDR
When enabled, the forward buffer uses a 16-bit float format (
R16_G16_B16_A16_Float) instead of 8-bit (R8_G8_B8_A8_UNorm), enabling physically based lighting ranges and Bloom. Defaults to false.Clear Flags
CameraClearFlags controls what happens to the framebuffer before rendering begins each frame.
| Value | Description |
|---|---|
Skybox | Clears depth and color, then renders the procedural sky (default) |
DepthColor | Clears both depth and color to ClearColor |
ColorOnly | Clears only color — depth persists from the previous frame |
DepthOnly | Clears only depth — reveals the previous color below this camera |
None | No clearing at all — stacks on whatever was rendered before |
Render Targets
By default a camera renders to the screen swapchain. Assign aRenderTexture to Camera.Target to redirect output — useful for minimap cameras, security-camera monitors, or reflection probes.
Render Pipelines
Every camera uses aRenderPipeline asset to define how the scene is rendered. If Camera.Pipeline is not assigned, DefaultRenderPipeline.Default is used automatically. The pipeline is called once per camera per frame by SceneManager.Draw().
Creating a Custom Render Pipeline
SubclassRenderPipeline and override Render to implement entirely custom rendering logic:
Multiple Cameras and Render Order
Assign unique Depth values
Set
camera.Depth so cameras render in the correct order. For example, a world camera at Depth = 0 and a HUD camera at Depth = 10.Configure ClearFlags per camera
The HUD camera should use
CameraClearFlags.DepthOnly so the world render below shows through. The world camera uses CameraClearFlags.Skybox to paint the background.MonoBehaviour Camera Hooks
MonoBehaviour components on the sameGameObject as the camera receive rendering callbacks in the order the pipeline calls them. These hooks let effects and systems observe or modify each rendering phase.
| Callback | When it fires |
|---|---|
OnPreCull(Camera camera) | Before the camera culls renderables — use it to set DepthTextureMode flags |
OnPreRender(Camera camera) | After culling, just before geometry is drawn |
OnPostRender(Camera camera) | After all rendering for the camera is complete |
OnRenderImage(RenderTexture src, RenderTexture dest) | Post-processing — blit from src to dest |
GPU Projection Matrix
Prowl targets multiple graphics backends (OpenGL, Vulkan, Direct3D 11). Each backend has a different NDC (Normalized Device Coordinate) convention. UseGraphics.GetGPUProjectionMatrix() whenever you build a projection matrix that will be uploaded to the GPU:
Depth Texture Mode
Some post-processing effects (like SSAO and Motion Blur) need the camera to generate auxiliary buffers each frame. Request them viaDepthTextureMode flags — typically inside OnPreCull:
DepthTextureMode is reset at the end of each frame by the render pipeline. Components that need these buffers should set the flags every frame inside OnPreCull, not once in OnEnable.