mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 12:12:28 +00:00
Merge pull request #11694 from tagcup/lambert_normalization
Ensure that Lambert is energy conserving.
This commit is contained in:
commit
99a464ceb4
@ -932,7 +932,7 @@ LIGHT_SHADER_CODE
|
||||
vec3 A = 1.0 + sigma2 * (- 0.5 / (sigma2 + 0.33) + 0.17*diffuse_color / (sigma2 + 0.13) );
|
||||
float B = 0.45 * sigma2 / (sigma2 + 0.09);
|
||||
|
||||
light_amount = diffuse_color * dotNL * (A + vec3(B) * s / t) / M_PI;
|
||||
light_amount = dotNL * (A + vec3(B) * s / t) / M_PI;
|
||||
}
|
||||
|
||||
#elif defined(DIFFUSE_TOON)
|
||||
@ -965,7 +965,7 @@ LIGHT_SHADER_CODE
|
||||
}
|
||||
#else
|
||||
//lambert
|
||||
light_amount = dotNL;
|
||||
light_amount = dotNL / M_PI;
|
||||
#endif
|
||||
|
||||
#if defined(TRANSMISSION_USED)
|
||||
|
Loading…
Reference in New Issue
Block a user