message: ssao: fix a typo in the accurate normal reconstruction
diff: @@ -204,7 +204,7 @@ fragment {
  // Accurate view-space normal reconstruction
  // Based on Yuwen Wu "Accurate Normal Reconstruction"
  // (https://atyuwen.github.io/posts/normal-reconstruction)
  - highp vec3 computeViewSpaceNormalAccurate(const highp vec3 position, const highp vec2 uv) {
  + highp vec3 computeViewSpaceNormalAccurate(const highp float depth, const highp vec3 position, const highp vec2 uv) {
  precision highp float;
  vec3 pos_c = position;
  @@ -216,7 +216,7 @@ fragment {
  H.y = sampleDepth(materialParams_depth, uv + dx, 0.0);
  H.z = sampleDepth(materialParams_depth, uv - dx * 2.0, 0.0);
  H.w = sampleDepth(materialParams_depth, uv + dx * 2.0, 0.0);
  - vec2 he = abs((2.0 * H.xy - H.zw) - pos_c.z);
  + vec2 he = abs((2.0 * H.xy - H.zw) - depth);
  vec3 pos_l = computeViewSpacePositionFromDepth(uv - dx, linearizeDepth(H.x, materialParams.depthParams));
  vec3 pos_r = computeViewSpacePositionFromDepth(uv + dx, linearizeDepth(H.y, materialParams.depthParams));
  vec3 dpdx = (he.x < he.y) ? (pos_c - pos_l) : (pos_r - pos_c);
  @@ -226,7 +226,7 @@ fragment {
  V.y = sampleDepth(materialParams_depth, uv + dy, 0.0);
  V.z = sampleDepth(materialParams_depth, uv - dy * 2.0, 0.0);
  V.w = sampleDepth(materialParams_depth, uv + dy * 2.0, 0.0);
  - vec2 ve = abs((2.0 * V.xy - V.zw) - pos_c.z);
  + vec2 ve = abs((2.0 * V.xy - V.zw) - depth);
  vec3 pos_d = computeViewSpacePositionFromDepth(uv - dy, linearizeDepth(V.x, materialParams.depthParams));
  vec3 pos_u = computeViewSpacePositionFromDepth(uv + dy, linearizeDepth(V.y, materialParams.depthParams));
  vec3 dpdy = (ve.x < ve.y) ? (pos_c - pos_d) : (pos_u - pos_c);
  @@ -345,12 +345,13 @@ fragment {
  void postProcess(inout PostProcessInputs postProcess) {
  highp vec2 uv = variable_vertex.xy; // interpolated to pixel center
  - highp float depth = sampleDepthLinear(materialParams_depth, uv, 0.0, materialParams.depthParams);
  - highp vec3 origin = computeViewSpacePositionFromDepth(uv, depth);
  + highp float depth = sampleDepth(materialParams_depth, uv, 0.0);
  + highp float z = linearizeDepth(depth, materialParams.depthParams);
  + highp vec3 origin = computeViewSpacePositionFromDepth(uv, z);
  // todo: maybe make this a quality parameter of SSAO
  #if FILAMENT_QUALITY == FILAMENT_QUALITY_HIGH
  - vec3 normal = computeViewSpaceNormalAccurate(origin, uv);
  + vec3 normal = computeViewSpaceNormalAccurate(depth, origin, uv);
  #else
  vec3 normal = computeViewSpaceNormal(origin, uv);
  #endif
  