Gessa Docs
Recipes

Recipe

Camera feel field of view smoothing tone mapping and post

The camera already follows the right entity but the shot feels wrong: too wide, too twitchy, flat colors, no depth. Every knob is a field on CameraComponent.
engine v1.0.234since component-field-contract ecs.component-field-contract.v1, camera.v1Copy for LLM

Use this for

tuning how the camera looks and feels; field of view, follow smoothing, depth of field, motion blur, tone mapping, exposure, clear color

Not for

wiring which entity the camera follows (see third-person-and-platformer-movement); global world sky and fog (see atmosphere-sky-and-lighting)

Pairs with: First-person camera movement and mouselook controls, Third-person follow camera and platformer jump movement, Atmosphere sky lighting fog and time of day

The recipe

  1. Read the current camera with project_get_graph_snapshot, then patch fields with project_add_component (project.entity.component.set) carrying the full discriminated value { "type":"CameraComponent", ... }.
  2. Framing: fov (1..170; 60 default, 90 for FPS, 40 for a tighter cinematic look), near (>= 0), far (>= 0.01), projection perspective or orthographic, orthoSize for ortho.
  3. Follow response: followSmoothing (0..1). Lower is snappier; 0.1..0.2 feels tight, 0.5+ feels floaty.
  4. Color grade: toneMapping one of aces, agx, reinhard, neutral, linear; exposure (0..10). aces is a safe filmic default.
  5. Background: clearMode skybox, color, or none; clearColor a #rrggbb or #rrggbbaa hex when clearMode is color.
  6. Depth and speed cues via postProcessing: postProcessing.depthOfField { "mode":"on", "quality":"medium", "focusDistance":8, "bokehScale":2 } (mode off/auto/on) and postProcessing.motionBlur { "mode":"auto", "quality":"medium", "samples":8 }.
  7. For runtime feel driven by a script (recoil kick, look sensitivity change), use the camera host ops from a GessaScript body: ctx.camera.addLookInput, ctx.camera.setLookSensitivity, ctx.camera.setPitchClamp, ctx.camera.setViewTarget.

Pitfalls

  • postProcessing and its sub-objects are optional, but if you supply depthOfField you must include its required mode; partial objects with a missing discriminator are rejected.
  • depthOfField.focusDistance is 0.001..1000, bokehScale 0..4, motionBlur.samples 2..32; out-of-range values fail validation.
  • Only ONE camera is used in Play: the highest priority among active cameras. Two active cameras at the same priority is ambiguous; give the hero camera a higher priority.
  • clearColor must match ^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$.

Verify

  • engine_get_component_schema on CameraComponent for the exact post enums and numeric bounds.
  • qa_capture_renderer_viewport (qa.renderer.viewport.capture) before and after to see the grade and framing change.
Was this helpful?Report an issueContact support

On this page