mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-08 16:29:29 +02:00
Fixing coding guidelines
This commit is contained in:
parent
402809fe2f
commit
8eddd52731
3 changed files with 11 additions and 7 deletions
|
@ -134,10 +134,10 @@ float getBlurEdgeSharpness() {
|
||||||
return params._blurInfo.x;
|
return params._blurInfo.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
// KEEP this dead code for eventual performance improvment
|
|
||||||
#ifdef CONSTANT_GAUSSIAN
|
#ifdef CONSTANT_GAUSSIAN
|
||||||
const int BLUR_RADIUS = 4;
|
const int BLUR_RADIUS = 4;
|
||||||
const float gaussian[BLUR_RADIUS + 1] =
|
const float gaussian[BLUR_RADIUS + 1] =
|
||||||
|
// KEEP this dead code for eventual performance improvment
|
||||||
// float[](0.356642, 0.239400, 0.072410, 0.009869);
|
// float[](0.356642, 0.239400, 0.072410, 0.009869);
|
||||||
// float[](0.398943, 0.241971, 0.053991, 0.004432, 0.000134); // stddev = 1.0
|
// float[](0.398943, 0.241971, 0.053991, 0.004432, 0.000134); // stddev = 1.0
|
||||||
float[](0.153170, 0.144893, 0.122649, 0.092902, 0.062970); // stddev = 2.0
|
float[](0.153170, 0.144893, 0.122649, 0.092902, 0.062970); // stddev = 2.0
|
||||||
|
@ -183,6 +183,8 @@ vec2 fetchOcclusionDepth(ivec2 coords) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const int RADIUS_SCALE = 2;
|
const int RADIUS_SCALE = 2;
|
||||||
|
const float BLUR_WEIGHT_OFFSET = 0.3;
|
||||||
|
const float BLUR_EDGE_SCALE = 2000.0;
|
||||||
|
|
||||||
vec2 evalTapWeightedValue(ivec3 side, int r, ivec2 ssC, float key) {
|
vec2 evalTapWeightedValue(ivec3 side, int r, ivec2 ssC, float key) {
|
||||||
ivec2 tapOffset = <$axis$> * (r * RADIUS_SCALE);
|
ivec2 tapOffset = <$axis$> * (r * RADIUS_SCALE);
|
||||||
|
@ -194,10 +196,10 @@ vec2 evalTapWeightedValue(ivec3 side, int r, ivec2 ssC, float key) {
|
||||||
vec2 tapOZ = fetchOcclusionDepth(ssC + tapOffset);
|
vec2 tapOZ = fetchOcclusionDepth(ssC + tapOffset);
|
||||||
|
|
||||||
// spatial domain: offset gaussian tap
|
// spatial domain: offset gaussian tap
|
||||||
float weight = 0.3 + getBlurCoef(abs(r));
|
float weight = BLUR_WEIGHT_OFFSET + getBlurCoef(abs(r));
|
||||||
|
|
||||||
// range domain (the "bilateral" weight). As depth difference increases, decrease weight.
|
// range domain (the "bilateral" weight). As depth difference increases, decrease weight.
|
||||||
weight *= max(0.0, 1.0 - (getBlurEdgeSharpness() * 2000.0) * abs(tapOZ.y - key));
|
weight *= max(0.0, 1.0 - (getBlurEdgeSharpness() * BLUR_EDGE_SCALE) * abs(tapOZ.y - key));
|
||||||
|
|
||||||
return vec2(tapOZ.x * weight, weight);
|
return vec2(tapOZ.x * weight, weight);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,10 +41,12 @@ float getAngleDithering(in ivec2 pixelPos) {
|
||||||
return isDitheringEnabled() * (3 * pixelPos.x ^ pixelPos.y + pixelPos.x * pixelPos.y) * 10 + getFrameDithering();
|
return isDitheringEnabled() * (3 * pixelPos.x ^ pixelPos.y + pixelPos.x * pixelPos.y) * 10 + getFrameDithering();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const float TWO_PI = 6.28;
|
||||||
|
|
||||||
vec2 tapLocation(int sampleNumber, float spinAngle, out float ssR){
|
vec2 tapLocation(int sampleNumber, float spinAngle, out float ssR){
|
||||||
// Radius relative to ssR
|
// Radius relative to ssR
|
||||||
float alpha = float(sampleNumber + 0.5) * getInvNumSamples();
|
float alpha = float(sampleNumber + 0.5) * getInvNumSamples();
|
||||||
float angle = alpha * (getNumSpiralTurns() * 6.28) + spinAngle;
|
float angle = alpha * (getNumSpiralTurns() * TWO_PI) + spinAngle;
|
||||||
|
|
||||||
ssR = alpha;
|
ssR = alpha;
|
||||||
return vec2(cos(angle), sin(angle));
|
return vec2(cos(angle), sin(angle));
|
||||||
|
@ -133,12 +135,12 @@ void main(void) {
|
||||||
|
|
||||||
// Bilateral box-filter over a quad for free, respecting depth edges
|
// Bilateral box-filter over a quad for free, respecting depth edges
|
||||||
// (the difference that this makes is subtle)
|
// (the difference that this makes is subtle)
|
||||||
/* if (abs(dFdx(Cp.z)) < 0.02) {
|
if (abs(dFdx(Cp.z)) < 0.02) {
|
||||||
A -= dFdx(A) * ((ssC.x & 1) - 0.5);
|
A -= dFdx(A) * ((ssC.x & 1) - 0.5);
|
||||||
}
|
}
|
||||||
if (abs(dFdy(Cp.z)) < 0.02) {
|
if (abs(dFdy(Cp.z)) < 0.02) {
|
||||||
A -= dFdy(A) * ((ssC.y & 1) - 0.5);
|
A -= dFdy(A) * ((ssC.y & 1) - 0.5);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
outFragColor = vec4(packOcclusionDepth(A, CSZToDephtKey(Cp.z)), 1.0);
|
outFragColor = vec4(packOcclusionDepth(A, CSZToDephtKey(Cp.z)), 1.0);
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ protected:
|
||||||
int _drawStatus; // bitflag
|
int _drawStatus; // bitflag
|
||||||
bool _drawHitEffect;
|
bool _drawHitEffect;
|
||||||
bool _occlusionStatus { false };
|
bool _occlusionStatus { false };
|
||||||
bool _fxaaStatus = { false };
|
bool _fxaaStatus { false };
|
||||||
|
|
||||||
ItemsConfig _items;
|
ItemsConfig _items;
|
||||||
Tone _tone;
|
Tone _tone;
|
||||||
|
|
Loading…
Reference in a new issue