Differential D10390 Diff 33913 source/blender/gpu/shaders/material/gpu_shader_material_ambient_occlusion.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/material/gpu_shader_material_ambient_occlusion.glsl
| #ifndef VOLUMETRICS | #ifndef VOLUMETRICS | ||||
| void node_ambient_occlusion( | void node_ambient_occlusion( | ||||
| vec4 color, float distance, vec3 normal, out vec4 result_color, out float result_ao) | vec4 color, float distance, vec3 normal, out vec4 result_color, out float result_ao) | ||||
| { | { | ||||
| vec3 bent_normal; | vec3 bent_normal; | ||||
| vec4 rand = texelfetch_noise_tex(gl_FragCoord.xy); | vec4 rand = texelfetch_noise_tex(gl_FragCoord.xy); | ||||
| result_ao = occlusion_compute(normalize(normal), viewPosition, 1.0, rand, bent_normal); | result_ao = occlusion_compute(normalize(normal), viewPosition, rand, bent_normal); | ||||
| result_color = result_ao * color; | result_color = result_ao * color; | ||||
| } | } | ||||
| #else | #else | ||||
| /* Stub ambient occlusion because it is not compatible with volumetrics. */ | /* Stub ambient occlusion because it is not compatible with volumetrics. */ | ||||
| # define node_ambient_occlusion(a, b, c, d, e) (e = CLOSURE_DEFAULT) | # define node_ambient_occlusion(a, b, c, d, e) (e = CLOSURE_DEFAULT) | ||||
| #endif | #endif | ||||