Skip to content

Instantly share code, notes, and snippets.

@zeux
Created February 20, 2014 17:40
Show Gist options
  • Save zeux/9119256 to your computer and use it in GitHub Desktop.
Save zeux/9119256 to your computer and use it in GitHub Desktop.
SSAO loop
for (int i_3 = 0; i_3 < 8; i_3++) {
vec2 offsetDepth_14;
vec2 tmpvar_15;
tmpvar_15 = (rotation_8 * OFFSETS1_7[i_3]);
offsetDepth_14.x = texture2D (xlu_depthBuffer, (uv_1 + (tmpvar_15 * radiusTex_5))).x;
offsetDepth_14.y = texture2D (xlu_depthBuffer, (uv_1 - (tmpvar_15 * radiusTex_5))).x;
float tmpvar_16;
tmpvar_16 = (float((i_3 + 1)) / 10.0);
vec2 tmpvar_17;
tmpvar_17 = (((offsetDepth_14 - vec2(baseDepth_9)) / (0.006 *
sqrt((1.0 - (tmpvar_16 * tmpvar_16)))
)) + 0.5);
float tmpvar_18;
tmpvar_18 = clamp ((1.0 + min (tmpvar_17.x, tmpvar_17.y)), 0.0, 1.0);
occ_6 = (occ_6 + ((
clamp (tmpvar_17.x, 0.0, 1.0)
+
clamp (tmpvar_17.y, 0.0, 1.0)
) * tmpvar_18));
numSamples_4 = (numSamples_4 + (2.0 * tmpvar_18));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment