diff --git a/src/game/menu.hpp b/src/game/menu.hpp index dbfe553..39dbb69 100644 --- a/src/game/menu.hpp +++ b/src/game/menu.hpp @@ -35,7 +35,7 @@ static constexpr float4 active_color{1.0f, 1.0f, 1.0f, 1.0f}; static constexpr float4 inactive_color{1.0f, 1.0f, 1.0f, 0.5f}; /// Opacity of the menu background. -static constexpr float bg_opacity = 2.0f / 3.0f; +static constexpr float bg_opacity = 2.0f / 4.0f; /// Padding of the mouseover bounds, as a percentage of the font size. static constexpr float mouseover_padding = 0.1f; diff --git a/src/game/state/nuptial-flight.cpp b/src/game/state/nuptial-flight.cpp index e6fb47c..5c2619d 100644 --- a/src/game/state/nuptial-flight.cpp +++ b/src/game/state/nuptial-flight.cpp @@ -115,7 +115,7 @@ nuptial_flight::nuptial_flight(game::context& ctx): // Queue fade in ctx.fade_transition_color->set_value({1, 1, 1}); - ctx.function_queue.push(std::bind(&screen_transition::transition, ctx.fade_transition, 5.0f, true, math::lerp, true, nullptr)); + ctx.function_queue.push(std::bind(&screen_transition::transition, ctx.fade_transition, 5.0f, true, ease::out_sine, true, nullptr)); // Queue control setup ctx.function_queue.push(std::bind(&nuptial_flight::enable_controls, this)); @@ -217,7 +217,8 @@ void nuptial_flight::setup_camera() ctx.entity_registry->assign(camera_eid, constraint_stack); } - ctx.surface_camera->set_exposure(-14.0f); + float ev100 = 14.5f; + ctx.surface_camera->set_exposure(ev100); } void nuptial_flight::enable_controls() diff --git a/src/render/passes/material-pass.cpp b/src/render/passes/material-pass.cpp index 0374b8f..a3629be 100644 --- a/src/render/passes/material-pass.cpp +++ b/src/render/passes/material-pass.cpp @@ -133,7 +133,8 @@ void material_pass::render(const render::context& ctx, render::queue& queue) con clip_depth[1] = ctx.camera->get_clip_far_tween().interpolate(ctx.alpha); float log_depth_coef = 2.0f / std::log2(clip_depth[1] + 1.0f); - float camera_exposure = std::exp2(ctx.camera->get_exposure_tween().interpolate(ctx.alpha)); + float camera_exposure = std::exp2(-ctx.camera->get_exposure_tween().interpolate(ctx.alpha)); + //float camera_exposure = ctx.camera->get_exposure_tween().interpolate(ctx.alpha); int active_material_flags = 0; diff --git a/src/render/passes/sky-pass.cpp b/src/render/passes/sky-pass.cpp index e46930f..4462c5c 100644 --- a/src/render/passes/sky-pass.cpp +++ b/src/render/passes/sky-pass.cpp @@ -105,7 +105,8 @@ void sky_pass::render(const render::context& ctx, render::queue& queue) const float4x4 projection = camera.get_projection_tween().interpolate(ctx.alpha); float4x4 view_projection = projection * view; float4x4 model_view_projection = projection * model_view; - float exposure = std::exp2(camera.get_exposure_tween().interpolate(ctx.alpha)); + float exposure = std::exp2(-camera.get_exposure_tween().interpolate(ctx.alpha)); + //float exposure = camera.get_exposure_tween().interpolate(ctx.alpha); // Interpolate observer altitude float observer_altitude = observer_altitude_tween.interpolate(ctx.alpha); diff --git a/src/scene/camera.cpp b/src/scene/camera.cpp index ca92a9a..4ca83d8 100644 --- a/src/scene/camera.cpp +++ b/src/scene/camera.cpp @@ -144,9 +144,14 @@ void camera::set_orthographic(float clip_left, float clip_right, float clip_bott view_frustum.set_matrix(view_projection[1]); } -void camera::set_exposure(float exposure) +void camera::set_exposure(float ev100) { - this->exposure[1] = exposure; + exposure[1] = ev100; +} + +void camera::set_exposure(float f_number, float speed, float iso) +{ + exposure[1] = std::log2((f_number * f_number) / speed * 100.0f / iso); } void camera::set_compositor(render::compositor* compositor) diff --git a/src/scene/camera.hpp b/src/scene/camera.hpp index 981affc..713a01c 100644 --- a/src/scene/camera.hpp +++ b/src/scene/camera.hpp @@ -78,11 +78,20 @@ public: void set_orthographic(float clip_left, float clip_right, float clip_bottom, float clip_top, float clip_near, float clip_far); /** - * Sets the camera's exposure. + * Sets the camera's ISO 100 exposure value directly * - * @param exposure Exposure factor. + * @param ev100 ISO 100 exposure value. */ - void set_exposure(float exposure); + void set_exposure(float ev100); + + /** + * Sets the camera's ISO 100 exposure value given exposure settings. + * + * @param f_number F-number. + * @param speed Shutter speed, in seconds. + * @param iso ISO sensitivity value. + */ + void set_exposure(float f_number, float speed, float iso); void set_compositor(render::compositor* compositor); void set_composite_index(int index); @@ -113,7 +122,7 @@ public: /// Returns the camera's view frustum. const view_frustum_type& get_view_frustum() const; - /// Returns the camera's exposure. + /// Returns the camera's ISO 100 exposure value. float get_exposure() const; const render::compositor* get_compositor() const;