Skip to content

Commit

Permalink
[Renderer] Exposure is now fed directly into FSR 2
Browse files Browse the repository at this point in the history
  • Loading branch information
PanosK92 committed Oct 23, 2023
1 parent 14a9adb commit 09f8634
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion runtime/RHI/RHI_AMD_FidelityFX.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ namespace Spartan
RHI_Texture* tex_output,
Camera* camera,
float delta_time,
float sharpness
float sharpness,
float exposure
);
};
}
5 changes: 3 additions & 2 deletions runtime/RHI/Vulkan/Vulkan_AMD_FidelityFX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ namespace Spartan
RHI_Texture* tex_output,
Camera* camera,
float delta_time_sec,
float sharpness
float sharpness,
float exposure
)
{
// transition to the appropriate layouts (will only happen if needed)
Expand Down Expand Up @@ -322,7 +323,7 @@ namespace Spartan
fsr2_dispatch_description.enableSharpening = sharpness != 0.0f;
fsr2_dispatch_description.sharpness = sharpness;
fsr2_dispatch_description.frameTimeDelta = delta_time_sec * 1000.0f; // seconds to milliseconds
fsr2_dispatch_description.preExposure = 1.0f; // the exposure value if not using FFX_FSR2_ENABLE_AUTO_EXPOSURE
fsr2_dispatch_description.preExposure = exposure; // the exposure value if not using FFX_FSR2_ENABLE_AUTO_EXPOSURE
fsr2_dispatch_description.renderSize.width = tex_input->GetWidth(); // the resolution that was used for rendering the input resources
fsr2_dispatch_description.renderSize.height = tex_input->GetHeight(); // the resolution that was used for rendering the input resources
fsr2_dispatch_description.cameraNear = camera->GetFarPlane(); // far as near because we are using reverse-z
Expand Down
3 changes: 2 additions & 1 deletion runtime/Rendering/Renderer_Passes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,8 @@ namespace Spartan
tex_out,
GetCamera().get(),
m_cb_frame_cpu.delta_time,
sharpness
sharpness,
GetOption<float>(Renderer_Option::Exposure)
);

cmd_list->EndTimeblock();
Expand Down

0 comments on commit 09f8634

Please sign in to comment.