mirror of
https://github.com/godotengine/godot.git
synced 2025-01-30 21:33:18 +08:00
Merge pull request #51939 from clayjohn/VULKAN-horizon-so-fix
Compute horizon SO threshold before transformation
This commit is contained in:
commit
078bdef7e9
@ -903,6 +903,7 @@ void main() {
|
||||
|
||||
if (scene_data.use_reflection_cubemap) {
|
||||
vec3 ref_vec = reflect(-view, normal);
|
||||
float horizon = min(1.0 + dot(ref_vec, normal), 1.0);
|
||||
ref_vec = scene_data.radiance_inverse_xform * ref_vec;
|
||||
#ifdef USE_RADIANCE_CUBEMAP_ARRAY
|
||||
|
||||
@ -915,7 +916,6 @@ 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;
|
||||
}
|
||||
|
@ -868,6 +868,7 @@ void main() {
|
||||
|
||||
if (scene_data.use_reflection_cubemap) {
|
||||
vec3 ref_vec = reflect(-view, normal);
|
||||
float horizon = min(1.0 + dot(ref_vec, normal), 1.0);
|
||||
ref_vec = scene_data.radiance_inverse_xform * ref_vec;
|
||||
#ifdef USE_RADIANCE_CUBEMAP_ARRAY
|
||||
|
||||
@ -880,7 +881,6 @@ 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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user