Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-05-15 18:30:52 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-05-16 17:58:32 +0300
commita3f4c72ec9d431f65bf9f50b7849e22e2f213ad0 (patch)
tree231edd375b8e6c20cf5eec863b809a652c3e1310
parentc332e6e0d62528bbe212f115b15bd8317e282f4c (diff)
Eevee: Add support for Ambient Occlusion node.
-rw-r--r--source/blender/gpu/shaders/gpu_shader_material.glsl10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 236eddbb63f..04179787410 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -1227,6 +1227,16 @@ void node_bsdf_refraction(vec4 color, float roughness, float ior, vec3 N, out Cl
result.ssr_id = REFRACT_CLOSURE_FLAG;
}
+void node_ambient_occlusion(vec4 color, vec3 vN, out Closure result)
+{
+ vec3 bent_normal;
+ vec4 rand = texelFetch(utilTex, ivec3(ivec2(gl_FragCoord.xy) % LUT_SIZE, 2.0), 0);
+ float final_ao = occlusion_compute(normalize(worldNormal), viewPosition, 1.0, rand, bent_normal);
+ result = CLOSURE_DEFAULT;
+ result.ssr_normal = normal_encode(vN, viewCameraVec);
+ result.radiance = final_ao * color.rgb;
+}
+
#endif /* VOLUMETRICS */
/* emission */