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:
-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 */