diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-05-15 18:30:52 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-05-16 17:58:32 +0300 |
commit | a3f4c72ec9d431f65bf9f50b7849e22e2f213ad0 (patch) | |
tree | 231edd375b8e6c20cf5eec863b809a652c3e1310 /source/blender | |
parent | c332e6e0d62528bbe212f115b15bd8317e282f4c (diff) |
Eevee: Add support for Ambient Occlusion node.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 10 |
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 */ |