Compute horizon so threshold before transformation
This commit is contained in:
parent
1ed00dca88
commit
bccc4cd735
@ -900,6 +900,7 @@ void main() {
|
|||||||
|
|
||||||
if (scene_data.use_reflection_cubemap) {
|
if (scene_data.use_reflection_cubemap) {
|
||||||
vec3 ref_vec = reflect(-view, normal);
|
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;
|
ref_vec = scene_data.radiance_inverse_xform * ref_vec;
|
||||||
#ifdef USE_RADIANCE_CUBEMAP_ARRAY
|
#ifdef USE_RADIANCE_CUBEMAP_ARRAY
|
||||||
|
|
||||||
@ -912,7 +913,6 @@ void main() {
|
|||||||
specular_light = textureLod(samplerCube(radiance_cubemap, material_samplers[SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP]), ref_vec, roughness * MAX_ROUGHNESS_LOD).rgb;
|
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
|
#endif //USE_RADIANCE_CUBEMAP_ARRAY
|
||||||
float horizon = min(1.0 + dot(ref_vec, normal), 1.0);
|
|
||||||
specular_light *= horizon * horizon;
|
specular_light *= horizon * horizon;
|
||||||
specular_light *= scene_data.ambient_light_color_energy.a;
|
specular_light *= scene_data.ambient_light_color_energy.a;
|
||||||
}
|
}
|
||||||
|
@ -840,6 +840,7 @@ void main() {
|
|||||||
|
|
||||||
if (scene_data.use_reflection_cubemap) {
|
if (scene_data.use_reflection_cubemap) {
|
||||||
vec3 ref_vec = reflect(-view, normal);
|
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;
|
ref_vec = scene_data.radiance_inverse_xform * ref_vec;
|
||||||
#ifdef USE_RADIANCE_CUBEMAP_ARRAY
|
#ifdef USE_RADIANCE_CUBEMAP_ARRAY
|
||||||
|
|
||||||
@ -852,7 +853,6 @@ void main() {
|
|||||||
specular_light = textureLod(samplerCube(radiance_cubemap, material_samplers[SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP]), ref_vec, roughness * MAX_ROUGHNESS_LOD).rgb;
|
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
|
#endif //USE_RADIANCE_CUBEMAP_ARRAY
|
||||||
float horizon = min(1.0 + dot(ref_vec, normal), 1.0);
|
|
||||||
specular_light *= horizon * horizon;
|
specular_light *= horizon * horizon;
|
||||||
specular_light *= scene_data.ambient_light_color_energy.a;
|
specular_light *= scene_data.ambient_light_color_energy.a;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user