EEVEE-Next: Use clamped linear spherical harmonic eval
This can produce ringing but it is usually not noticeable since it is only present in indirect lighting.
This commit is contained in:
@@ -23,6 +23,6 @@ void main()
|
||||
vec3 N = normal_view_to_world(vN);
|
||||
vec3 lN = transform_direction(world_to_grid, N);
|
||||
|
||||
vec3 irradiance = spherical_harmonics_evaluate_lambert_non_linear(lN, sh);
|
||||
vec3 irradiance = spherical_harmonics_evaluate_lambert(lN, sh);
|
||||
out_color = vec4(irradiance, 0.0);
|
||||
}
|
||||
|
||||
@@ -75,5 +75,5 @@ void lightprobe_eval(ClosureDiffuse diffuse,
|
||||
{
|
||||
SphericalHarmonicL1 irradiance = lightprobe_irradiance_sample(irradiance_atlas_tx, P);
|
||||
|
||||
out_diffuse += spherical_harmonics_evaluate_lambert_non_linear(diffuse.N, irradiance);
|
||||
out_diffuse += spherical_harmonics_evaluate_lambert(diffuse.N, irradiance);
|
||||
}
|
||||
@@ -237,20 +237,20 @@ void spherical_harmonics_L2_rotate(mat3x3 rotation, inout SphericalHarmonicBandL
|
||||
vec3 spherical_harmonics_evaluate_lambert(vec3 N, SphericalHarmonicL0 sh)
|
||||
{
|
||||
vec3 radiance = spherical_harmonics_L0_evaluate(N, sh.L0).rgb;
|
||||
return radiance;
|
||||
return max(vec3(0.0), radiance);
|
||||
}
|
||||
vec3 spherical_harmonics_evaluate_lambert(vec3 N, SphericalHarmonicL1 sh)
|
||||
{
|
||||
vec3 radiance = spherical_harmonics_L0_evaluate(N, sh.L0).rgb +
|
||||
spherical_harmonics_L1_evaluate(N, sh.L1).rgb * (2.0 / 3.0);
|
||||
return radiance;
|
||||
return max(vec3(0.0), radiance);
|
||||
}
|
||||
vec3 spherical_harmonics_evaluate_lambert(vec3 N, SphericalHarmonicL2 sh)
|
||||
{
|
||||
vec3 radiance = spherical_harmonics_L0_evaluate(N, sh.L0).rgb +
|
||||
spherical_harmonics_L1_evaluate(N, sh.L1).rgb * (2.0 / 3.0) +
|
||||
spherical_harmonics_L2_evaluate(N, sh.L2).rgb * (1.0 / 4.0);
|
||||
return radiance;
|
||||
return max(vec3(0.0), radiance);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user