Recipes
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
- Read the current camera with
project_get_graph_snapshot, then patch fields withproject_add_component(project.entity.component.set) carrying the full discriminated value{ "type":"CameraComponent", ... }. - Framing:
fov(1..170; 60 default, 90 for FPS, 40 for a tighter cinematic look),near(>= 0),far(>= 0.01),projectionperspectiveororthographic,orthoSizefor ortho. - Follow response:
followSmoothing(0..1). Lower is snappier; 0.1..0.2 feels tight, 0.5+ feels floaty. - Color grade:
toneMappingone ofaces,agx,reinhard,neutral,linear;exposure(0..10).acesis a safe filmic default. - Background:
clearModeskybox,color, ornone;clearColora#rrggbbor#rrggbbaahex whenclearModeiscolor. - Depth and speed cues via
postProcessing:postProcessing.depthOfField{ "mode":"on", "quality":"medium", "focusDistance":8, "bokehScale":2 }(modeoff/auto/on) andpostProcessing.motionBlur{ "mode":"auto", "quality":"medium", "samples":8 }. - 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
postProcessingand its sub-objects are optional, but if you supplydepthOfFieldyou must include its requiredmode; partial objects with a missing discriminator are rejected.depthOfField.focusDistanceis 0.001..1000,bokehScale0..4,motionBlur.samples2..32; out-of-range values fail validation.- Only ONE camera is used in Play: the highest
priorityamongactivecameras. Two active cameras at the same priority is ambiguous; give the hero camera a higherpriority. clearColormust match^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$.
Verify
engine_get_component_schemaonCameraComponentfor 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.