aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlbavoil <[email protected]>2016-05-09 11:32:58 +0200
committerlbavoil <[email protected]>2016-05-09 11:32:58 +0200
commit5d606f2453e3fa8575aa06483288714735f9dfcf (patch)
treef4277027638078c42b1be68d3d44a67177d0bfc6 /src
parentEdit comment (diff)
downloadhbaoplus-5d606f2453e3fa8575aa06483288714735f9dfcf.tar.xz
hbaoplus-5d606f2453e3fa8575aa06483288714735f9dfcf.zip
HBAO+ 3.0.0.20735892
Diffstat (limited to 'src')
-rw-r--r--src/ConstantBuffers.cpp4
-rw-r--r--src/ConstantBuffers.h1
-rw-r--r--src/shaders/src/CoarseAO_PS.hlsl10
-rw-r--r--src/shaders/src/ConstantBuffers.hlsl6
-rw-r--r--src/shaders/src/DebugAO_PS.hlsl10
5 files changed, 15 insertions, 16 deletions
diff --git a/src/ConstantBuffers.cpp b/src/ConstantBuffers.cpp
index 1d9235b..0232cd0 100644
--- a/src/ConstantBuffers.cpp
+++ b/src/ConstantBuffers.cpp
@@ -77,8 +77,8 @@ void GFSDK::SSAO::GlobalConstants::SetAOParameters(const GFSDK_SSAO_Parameters&
m_Data.fNDotVBias = Clamp(Params.Bias, 0.0f, 0.5f);
const float AOAmountScaleFactor = 1.f / (1.f - m_Data.fNDotVBias);
- m_Data.fNearAOAmount = Clamp(Params.NearAO, 0.f, 4.f) * AOAmountScaleFactor * 2.f;
- m_Data.fFarAOAmount = Clamp(Params.FarAO, 0.f, 4.f) * AOAmountScaleFactor;
+ m_Data.fSmallScaleAOAmount = Clamp(Params.SmallScaleAO, 0.f, 4.f) * AOAmountScaleFactor * 2.f;
+ m_Data.fLargeScaleAOAmount = Clamp(Params.LargeScaleAO, 0.f, 4.f) * AOAmountScaleFactor;
}
//--------------------------------------------------------------------------------
diff --git a/src/ConstantBuffers.h b/src/ConstantBuffers.h
index 7fd9955..2bf3e07 100644
--- a/src/ConstantBuffers.h
+++ b/src/ConstantBuffers.h
@@ -27,7 +27,6 @@ public:
GlobalConstants()
{
ZERO_STRUCT(m_Data);
- m_Data.iTrue = 1;
// Can be useful for figuring out the HBAO+ version from an APIC or NSight capture
m_Data.u4BuildVersion = GFSDK_SSAO_Version();
diff --git a/src/shaders/src/CoarseAO_PS.hlsl b/src/shaders/src/CoarseAO_PS.hlsl
index b15736a..ffcd14c 100644
--- a/src/shaders/src/CoarseAO_PS.hlsl
+++ b/src/shaders/src/CoarseAO_PS.hlsl
@@ -143,8 +143,8 @@ float ComputeCoarseAO(float2 FullResUV, float3 ViewPosition, float3 ViewNormal,
#endif
const float Alpha = 2.0 * GFSDK_PI / NUM_DIRECTIONS;
- float NearAO = 0;
- float FarAO = 0;
+ float SmallScaleAO = 0;
+ float LargeScaleAO = 0;
[unroll]
for (float DirectionIndex = 0; DirectionIndex < NUM_DIRECTIONS; ++DirectionIndex)
@@ -167,7 +167,7 @@ float ComputeCoarseAO(float2 FullResUV, float3 ViewPosition, float3 ViewNormal,
float3 S = FetchQuarterResViewPos(SnappedUV);
RayPixels += StepSizePixels;
- NearAO += ComputeAO(ViewPosition, ViewNormal, S, Params);
+ SmallScaleAO += ComputeAO(ViewPosition, ViewNormal, S, Params);
}
[unroll]
@@ -177,11 +177,11 @@ float ComputeCoarseAO(float2 FullResUV, float3 ViewPosition, float3 ViewNormal,
float3 S = FetchQuarterResViewPos(SnappedUV);
RayPixels += StepSizePixels;
- FarAO += ComputeAO(ViewPosition, ViewNormal, S, Params);
+ LargeScaleAO += ComputeAO(ViewPosition, ViewNormal, S, Params);
}
}
- float AO = (NearAO * g_fNearAOAmount) + (FarAO * g_fFarAOAmount);
+ float AO = (SmallScaleAO * g_fSmallScaleAOAmount) + (LargeScaleAO * g_fLargeScaleAOAmount);
AO /= (NUM_DIRECTIONS * NUM_STEPS);
diff --git a/src/shaders/src/ConstantBuffers.hlsl b/src/shaders/src/ConstantBuffers.hlsl
index 4bcd0b1..d55ed32 100644
--- a/src/shaders/src/ConstantBuffers.hlsl
+++ b/src/shaders/src/ConstantBuffers.hlsl
@@ -56,10 +56,10 @@ CBUFFER GlobalConstantBuffer REGISTER(b0)
DECLARE_CONSTANT(float, fNegInvR2);
DECLARE_CONSTANT(float, fNDotVBias);
- DECLARE_CONSTANT(float, fNearAOAmount);
- DECLARE_CONSTANT(float, fFarAOAmount);
+ DECLARE_CONSTANT(float, fSmallScaleAOAmount);
+ DECLARE_CONSTANT(float, fLargeScaleAOAmount);
DECLARE_CONSTANT(float, fPowExponent);
- DECLARE_CONSTANT(int, iTrue);
+ DECLARE_CONSTANT(int, iUnused);
DECLARE_CONSTANT(float, fBlurViewDepth0);
DECLARE_CONSTANT(float, fBlurViewDepth1);
diff --git a/src/shaders/src/DebugAO_PS.hlsl b/src/shaders/src/DebugAO_PS.hlsl
index 4421f00..80c8ae7 100644
--- a/src/shaders/src/DebugAO_PS.hlsl
+++ b/src/shaders/src/DebugAO_PS.hlsl
@@ -121,8 +121,8 @@ float4 DebugAO_PS(PostProc_VSOut IN) : SV_TARGET
float3 N = normalize(cross(MinDiff(P, Pr, Pl), MinDiff(P, Pt, Pb)));
const float Alpha = 2.0 * GFSDK_PI / NUM_DIRECTIONS;
- float NearAO = 0;
- float FarAO = 0;
+ float SmallScaleAO = 0;
+ float LargeScaleAO = 0;
[unroll]
for (float DirectionIndex = 0; DirectionIndex < NUM_DIRECTIONS; ++DirectionIndex)
@@ -148,16 +148,16 @@ float4 DebugAO_PS(PostProc_VSOut IN) : SV_TARGET
if (StepIndex == 0)
{
- NearAO += ComputeAO(P, N, S);
+ SmallScaleAO += ComputeAO(P, N, S);
}
else
{
- FarAO += ComputeAO(P, N, S);
+ LargeScaleAO += ComputeAO(P, N, S);
}
}
}
- float AO = (NearAO * g_fNearAOAmount) + (FarAO * g_fFarAOAmount);
+ float AO = (SmallScaleAO * g_fSmallScaleAOAmount) + (LargeScaleAO * g_fLargeScaleAOAmount);
AO /= (NUM_DIRECTIONS * NUM_STEPS);
AO = saturate(1.0 - AO * 2.0);