1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Merge pull request #51417 from clayjohn/Vulkan-horizon-so

Add horizon specular occlusion
This commit is contained in:
Rémi Verschelde
2021-08-10 09:56:02 +02:00
committed by GitHub
2 changed files with 4 additions and 0 deletions

View File

@@ -912,6 +912,8 @@ void main() {
specular_light = textureLod(samplerCube(radiance_cubemap, material_samplers[SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP]), ref_vec, roughness * MAX_ROUGHNESS_LOD).rgb;
#endif //USE_RADIANCE_CUBEMAP_ARRAY
float horizon = min(1.0 + dot(ref_vec, normal), 1.0);
specular_light *= horizon * horizon;
specular_light *= scene_data.ambient_light_color_energy.a;
}

View File

@@ -848,6 +848,8 @@ void main() {
specular_light = textureLod(samplerCube(radiance_cubemap, material_samplers[SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP]), ref_vec, roughness * MAX_ROUGHNESS_LOD).rgb;
#endif //USE_RADIANCE_CUBEMAP_ARRAY
float horizon = min(1.0 + dot(ref_vec, normal), 1.0);
specular_light *= horizon * horizon;
specular_light *= scene_data.ambient_light_color_energy.a;
}