Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ float4 SSSSBlurCS(
float4 colorM = ColorTexture[DTid.xy];

#if defined(HORIZONTAL)
colorM.rgb = Color::GammaToLinear(colorM.rgb);
colorM.rgb = Color::GammaToTrueLinear(colorM.rgb);
#endif

if (sssAmount == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cbuffer PerFrameSSS : register(b1)
bool humanProfile = MaskTexture[DTid.xy].y == sssAmount;

float4 color = SSSSBlurCS(DTid.xy, texCoord, float2(0.0, 1.0), sssAmount, humanProfile);
color.rgb = Color::LinearToGamma(color.rgb);
color.rgb = Color::TrueLinearToGamma(color.rgb);
SSSRW[DTid.xy] = float4(color.rgb, 1.0);

#endif
Expand Down
14 changes: 12 additions & 2 deletions package/Shaders/Common/Color.hlsli
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,22 @@ namespace Color

float3 GammaToLinear(float3 color)
{
return pow(color, 1.6);
return pow(color, 1.8);
}

float3 LinearToGamma(float3 color)
{
return pow(color, 1.0 / 1.6);
return pow(color, 1.0 / 1.8);
}

float3 GammaToTrueLinear(float3 color)
{
return pow(color, 2.2);
}

float3 TrueLinearToGamma(float3 color)
{
return pow(color, 1.0 / 2.2);
}

float3 Diffuse(float3 color)
Expand Down
6 changes: 3 additions & 3 deletions src/Features/ScreenSpaceGI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ void ScreenSpaceGI::DrawSettings()

ImGui::Separator();

ImGui::SliderFloat("AO radius", &settings.AORadius, 10.f, 800.0f, "%.1f game units");
ImGui::SliderFloat("AO radius", &settings.AORadius, 10.f, 1024.0f, "%.1f game units");
if (auto _tt = Util::HoverTooltipWrapper())
ImGui::Text("A smaller radius produces tighter AO.");

{
auto _ = Util::DisableGuard(!settings.EnableGI);

ImGui::SliderFloat("IL radius", &settings.GIRadius, 10.f, 800.0f, "%.1f game units");
ImGui::SliderFloat("IL radius", &settings.GIRadius, 10.f, 1024.0f, "%.1f game units");
if (auto _tt = Util::HoverTooltipWrapper())
ImGui::Text("A larger radius produces wider IL.");
}
Expand All @@ -194,7 +194,7 @@ void ScreenSpaceGI::DrawSettings()
if (showAdvanced) {
ImGui::Separator();

ImGui::SliderFloat("Thickness", &settings.Thickness, 0.f, 500.0f, "%.1f game units");
ImGui::SliderFloat("Thickness", &settings.Thickness, 0.f, 128.0f, "%.1f game units");
if (auto _tt = Util::HoverTooltipWrapper())
ImGui::Text("How thick the occluders are. Only affects AO.");
}
Expand Down
16 changes: 8 additions & 8 deletions src/Features/ScreenSpaceGI.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,25 @@ struct ScreenSpaceGI : Feature
int ResolutionMode = 1; // 0-full, 1-half, 2-quarter
// visual
float MinScreenRadius = 0.01f;
float AORadius = 256.f;
float GIRadius = 256.f;
float Thickness = 16.f;
float AORadius = 512.f;
float GIRadius = 512.f;
float Thickness = 32.f;
float2 DepthFadeRange = { 4e4, 5e4 };
// gi
float GISaturation = 0.9f;
float GISaturation = 1.0f;
bool EnableGIBounce = true;
float GIBounceFade = 1.0f;
float GIDistanceCompensation = 0.f;
// mix
float AOPower = 1.0f;
float GIStrength = 1.5f;
float AOPower = 2.0f;
float GIStrength = 2.0f;
// denoise
bool EnableTemporalDenoiser = true;
bool EnableBlur = true;
float DepthDisocclusion = .1f;
float NormalDisocclusion = .1f;
uint MaxAccumFrames = 16;
float BlurRadius = 2.f;
uint MaxAccumFrames = 30;
float BlurRadius = 5.f;
float DistanceNormalisation = 2.f;
} settings;

Expand Down
2 changes: 1 addition & 1 deletion src/Features/Skylighting.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct Skylighting : Feature
float MaxZenith = 3.1415926f / 2.f; // 90 deg
float MinDiffuseVisibility = 0.1f;
float MinSpecularVisibility = 0.1f;
float SSGIAmbientDimmer = 1.0f;
float SSGIAmbientDimmer = 0.5f;
} settings;

struct SkylightingCB
Expand Down