Skip to content

Commit

Permalink
adding smoothstep
Browse files Browse the repository at this point in the history
Signed-off-by: Perminder Singh <[email protected]>
  • Loading branch information
perminder-17 authored Sep 25, 2024
1 parent 0c27224 commit 2f53aa4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions avogadro/rendering/solid_first_fs.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ vec4 applyBlur(vec2 texCoord) {
vec2 offset = (vec2(cos(angle), sin(angle)) * radius * 0.05 * inDofStrength) / pixelScale;
float z = depthToZ(texture2D(inDepthTex, texCoord + offset).x);
float sampleBlur = calcBlur(z, pixelScale);
float weight = float((z >= origZ) || (sampleBlur >= blurAmt * radius + 0.));
float weight = 1.0 - smoothstep(0.0, 1.0, abs(z - origZ) / blurAmt);
vec4 sample = texture2D(inRGBTex, texCoord + offset);
color += weight * sample;
total += weight;
Expand Down Expand Up @@ -181,4 +181,4 @@ void main() {
}

gl_FragDepth = texture2D(inDepthTex, UV).x;
}
}

0 comments on commit 2f53aa4

Please sign in to comment.