Add horizon specular occlusion

This commit is contained in:
clayjohn
2021-08-08 19:29:02 -07:00
parent 89313b9ed1
commit 1065f8dc86
2 changed files with 4 additions and 0 deletions

View File

@ -1686,6 +1686,8 @@ FRAGMENT_SHADER_CODE
ref_vec.z *= -1.0;
specular_light = textureCubeLod(radiance_map, ref_vec, roughness * RADIANCE_MAX_LOD).xyz * bg_energy;
float horizon = min(1.0 + dot(ref_vec, normal), 1.0);
specular_light *= horizon * horizon;
#ifndef USE_LIGHTMAP
{
vec3 ambient_dir = normalize((radiance_inverse_xform * vec4(normal, 0.0)).xyz);

View File

@ -1882,6 +1882,8 @@ FRAGMENT_SHADER_CODE
ref_vec = normalize((radiance_inverse_xform * vec4(ref_vec, 0.0)).xyz);
vec3 radiance = textureDualParaboloid(radiance_map, ref_vec, roughness) * bg_energy;
env_reflection_light = radiance;
float horizon = min(1.0 + dot(ref_vec, normal), 1.0);
env_reflection_light *= horizon * horizon;
}
}
#ifndef USE_LIGHTMAP