mirror of
https://projects.blender.org/blender/blender.git
synced 2025-01-22 15:32:15 -05:00
Fix: EEVEE: AO: Only clip occluders based on front sample
This is cheaper but avoid loosing the sample influence when thickness is large.
This commit is contained in:
parent
3112799804
commit
90c1d5832e
1 changed files with 4 additions and 8 deletions
|
@ -156,16 +156,12 @@ HorizonScanResult horizon_scan_eval(vec3 vP,
|
|||
const float bias = 2.0 * 2.4e-7;
|
||||
sample_depth += reversed ? -bias : bias;
|
||||
|
||||
vec3 vP_sample = drw_point_screen_to_view(vec3(sample_uv, sample_depth));
|
||||
vec3 vP_sample_front = drw_point_screen_to_view(vec3(sample_uv, sample_depth));
|
||||
vec3 vP_sample_back = vP_sample_front - vV * thickness_near;
|
||||
|
||||
float sample_distance;
|
||||
vec3 vL_front = normalize_and_get_length(vP_sample - vP, sample_distance);
|
||||
if (sample_distance > search_distance) {
|
||||
continue;
|
||||
}
|
||||
|
||||
vec3 vL_back = normalize_and_get_length((vP_sample - vV * thickness_near) - vP,
|
||||
sample_distance);
|
||||
vec3 vL_front = normalize_and_get_length(vP_sample_front - vP, sample_distance);
|
||||
vec3 vL_back = normalize(vP_sample_back - vP);
|
||||
if (sample_distance > search_distance) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue