diff options
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_occlusion.c | 2 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_occlusion.c b/source/blender/draw/engines/eevee/eevee_occlusion.c index 3f198063c47..19f34fa6108 100644 --- a/source/blender/draw/engines/eevee/eevee_occlusion.c +++ b/source/blender/draw/engines/eevee/eevee_occlusion.c @@ -61,7 +61,7 @@ int EEVEE_occlusion_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) const int fs_size[2] = {(int)viewport_size[0], (int)viewport_size[1]}; common_data->ao_dist = scene_eval->eevee.gtao_distance; - common_data->ao_factor = scene_eval->eevee.gtao_factor; + common_data->ao_factor = max_ff(1e-4f, scene_eval->eevee.gtao_factor); common_data->ao_quality = scene_eval->eevee.gtao_quality; if (scene_eval->eevee.flag & SCE_EEVEE_GTAO_ENABLED) { diff --git a/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl b/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl index 69b9ecaf77d..bf5b63cba65 100644 --- a/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl @@ -386,7 +386,8 @@ float specular_occlusion( float specular_solid_angle = spherical_cap_intersection(M_PI_2, spec_angle, cone_nor_dist); float specular_occlusion = isect_solid_angle / specular_solid_angle; /* Mix because it is unstable in unoccluded areas. */ - visibility = mix(specular_occlusion, 1.0, pow(visibility, 8.0)); + float tmp = saturate(pow8(visibility)); + visibility = mix(specular_occlusion, 1.0, tmp); /* Scale by user factor */ visibility = pow(saturate(visibility), aoFactor); |