Merge pull request #49549 from clayjohn/VULKAN-roughness-limiter
Fix roughness limiter derivative
This commit is contained in:
commit
bb94344937
2 changed files with 2 additions and 2 deletions
|
@ -850,7 +850,7 @@ void main() {
|
|||
if (scene_data.roughness_limiter_enabled) {
|
||||
//http://www.jp.square-enix.com/tech/library/pdf/ImprovedGeometricSpecularAA.pdf
|
||||
float roughness2 = roughness * roughness;
|
||||
vec3 dndu = dFdx(normal), dndv = dFdx(normal);
|
||||
vec2 dndu = dFdx(normal), dndv = dFdy(normal);
|
||||
float variance = scene_data.roughness_limiter_amount * (dot(dndu, dndu) + dot(dndv, dndv));
|
||||
float kernelRoughness2 = min(2.0 * variance, scene_data.roughness_limiter_limit); //limit effect
|
||||
float filteredRoughness2 = min(1.0, roughness2 + kernelRoughness2);
|
||||
|
|
|
@ -761,7 +761,7 @@ void main() {
|
|||
if (scene_data.roughness_limiter_enabled) {
|
||||
//http://www.jp.square-enix.com/tech/library/pdf/ImprovedGeometricSpecularAA.pdf
|
||||
float roughness2 = roughness * roughness;
|
||||
vec3 dndu = dFdx(normal), dndv = dFdx(normal);
|
||||
vec3 dndu = dFdx(normal), dndv = dFdy(normal);
|
||||
float variance = scene_data.roughness_limiter_amount * (dot(dndu, dndu) + dot(dndv, dndv));
|
||||
float kernelRoughness2 = min(2.0 * variance, scene_data.roughness_limiter_limit); //limit effect
|
||||
float filteredRoughness2 = min(1.0, roughness2 + kernelRoughness2);
|
||||
|
|
Loading…
Reference in a new issue