mirror of
https://github.com/lubosz/overte.git
synced 2025-04-12 01:22:10 +02:00
Removed falloff distance as we're directly using the radius
This commit is contained in:
parent
acc6d0b79e
commit
a2abf33669
4 changed files with 7 additions and 17 deletions
|
@ -176,18 +176,17 @@ public:
|
|||
AmbientOcclusionEffectConfig::AmbientOcclusionEffectConfig() :
|
||||
render::GPUJobConfig::Persistent(QStringList() << "Render" << "Engine" << "Ambient Occlusion", false),
|
||||
#if SSAO_USE_HORIZON_BASED
|
||||
radius{ 0.1f },
|
||||
radius{ 0.3f },
|
||||
#else
|
||||
radius{ 0.5f },
|
||||
#endif
|
||||
perspectiveScale{ 1.0f },
|
||||
obscuranceLevel{ 0.5f },
|
||||
#if SSAO_USE_HORIZON_BASED
|
||||
falloffAngle{ 0.1f },
|
||||
falloffAngle{ 0.2f },
|
||||
#else
|
||||
falloffAngle{ 0.01f },
|
||||
#endif
|
||||
falloffDistance{ 0.3f },
|
||||
edgeSharpness{ 1.0f },
|
||||
blurDeviation{ 2.5f },
|
||||
numSpiralTurns{ 7.0f },
|
||||
|
@ -242,6 +241,7 @@ void AmbientOcclusionEffect::configure(const Config& config) {
|
|||
if (config.falloffAngle != _aoParametersBuffer->getFalloffAngle()) {
|
||||
auto& current = _aoParametersBuffer.edit().ditheringInfo;
|
||||
current.z = config.falloffAngle;
|
||||
current.y = 1.0f / (1.0f - config.falloffAngle);
|
||||
}
|
||||
|
||||
if (config.edgeSharpness != _aoParametersBuffer->getEdgeSharpness()) {
|
||||
|
@ -302,11 +302,6 @@ void AmbientOcclusionEffect::configure(const Config& config) {
|
|||
current.w = (float)config.borderingEnabled;
|
||||
}
|
||||
|
||||
if (config.falloffDistance != _aoParametersBuffer->getFalloffDistance()) {
|
||||
auto& current = _aoParametersBuffer.edit().ditheringInfo;
|
||||
current.y = (float)config.falloffDistance;
|
||||
}
|
||||
|
||||
if (shouldUpdateGaussian) {
|
||||
updateGaussianDistribution();
|
||||
}
|
||||
|
|
|
@ -63,7 +63,6 @@ class AmbientOcclusionEffectConfig : public render::GPUJobConfig::Persistent {
|
|||
Q_PROPERTY(float radius MEMBER radius WRITE setRadius)
|
||||
Q_PROPERTY(float obscuranceLevel MEMBER obscuranceLevel WRITE setObscuranceLevel)
|
||||
Q_PROPERTY(float falloffAngle MEMBER falloffAngle WRITE setFalloffAngle)
|
||||
Q_PROPERTY(float falloffDistance MEMBER falloffDistance WRITE setFalloffDistance)
|
||||
Q_PROPERTY(float edgeSharpness MEMBER edgeSharpness WRITE setEdgeSharpness)
|
||||
Q_PROPERTY(float blurDeviation MEMBER blurDeviation WRITE setBlurDeviation)
|
||||
Q_PROPERTY(float numSpiralTurns MEMBER numSpiralTurns WRITE setNumSpiralTurns)
|
||||
|
@ -80,7 +79,6 @@ public:
|
|||
void setRadius(float newRadius) { radius = std::max(0.01f, newRadius); emit dirty(); }
|
||||
void setObscuranceLevel(float level) { obscuranceLevel = std::max(0.01f, level); emit dirty(); }
|
||||
void setFalloffAngle(float bias) { falloffAngle = std::max(0.0f, std::min(bias, 1.0f)); emit dirty(); }
|
||||
void setFalloffDistance(float value) { falloffDistance = std::max(0.0f, value); emit dirty(); }
|
||||
void setEdgeSharpness(float sharpness) { edgeSharpness = std::max(0.0f, (float)sharpness); emit dirty(); }
|
||||
void setBlurDeviation(float deviation) { blurDeviation = std::max(0.0f, deviation); emit dirty(); }
|
||||
void setNumSpiralTurns(float turns) { numSpiralTurns = std::max(0.0f, (float)turns); emit dirty(); }
|
||||
|
@ -92,7 +90,6 @@ public:
|
|||
float perspectiveScale;
|
||||
float obscuranceLevel; // intensify or dim down the obscurance effect
|
||||
float falloffAngle;
|
||||
float falloffDistance;
|
||||
float edgeSharpness;
|
||||
float blurDeviation;
|
||||
float numSpiralTurns; // defining an angle span to distribute the samples ray directions
|
||||
|
@ -144,7 +141,6 @@ public:
|
|||
float getPerspectiveScale() const { return resolutionInfo.z; }
|
||||
float getObscuranceLevel() const { return radiusInfo.w; }
|
||||
float getFalloffAngle() const { return (float)ditheringInfo.z; }
|
||||
float getFalloffDistance() const { return ditheringInfo.y; }
|
||||
float getEdgeSharpness() const { return (float)blurInfo.x; }
|
||||
float getBlurDeviation() const { return blurInfo.z; }
|
||||
|
||||
|
|
|
@ -75,9 +75,6 @@ float getObscuranceScaling() {
|
|||
float isDitheringEnabled() {
|
||||
return params._ditheringInfo.x;
|
||||
}
|
||||
float getFalloffDistance() {
|
||||
return params._ditheringInfo.y;
|
||||
}
|
||||
float isBorderingEnabled() {
|
||||
return params._ditheringInfo.w;
|
||||
}
|
||||
|
@ -85,6 +82,9 @@ float isBorderingEnabled() {
|
|||
float getFalloffAngle() {
|
||||
return params._ditheringInfo.z;
|
||||
}
|
||||
float getFalloffAngleScale() {
|
||||
return params._ditheringInfo.y;
|
||||
}
|
||||
|
||||
float getNumSamples() {
|
||||
return params._sampleInfo.x;
|
||||
|
@ -296,7 +296,7 @@ float computeHorizonFromTap(vec3 tapPositionES, vec3 fragPositionES, vec3 fragNo
|
|||
float cosHorizonAngle = dot(deltaVec, fragNormalES) / (distance + epsilon);
|
||||
float radiusFalloff = max(0.0, 1.0 - (distance*distance / getRadius2()));
|
||||
|
||||
cosHorizonAngle = max(0.0, (cosHorizonAngle - getFalloffAngle()) / (1.0 - getFalloffAngle()));
|
||||
cosHorizonAngle = max(0.0, (cosHorizonAngle - getFalloffAngle()) * getFalloffAngleScale());
|
||||
cosHorizonAngle *= radiusFalloff;
|
||||
|
||||
return cosHorizonAngle;
|
||||
|
|
|
@ -38,7 +38,6 @@ Rectangle {
|
|||
"Num Taps:numSamples:32:true",
|
||||
"Taps Spiral:numSpiralTurns:10.0:false",
|
||||
"Falloff Angle:falloffAngle:0.5:false",
|
||||
"Falloff Distance:falloffDistance:2.0:false",
|
||||
"Blur Edge Sharpness:edgeSharpness:1.0:false",
|
||||
"Blur Radius:blurRadius:15.0:false",
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue