Commit eb1b785
committed
Fix specular artifacts for (NdotV < 0)
Cost: 1 VGPR.
We clamp NdotV between 0.0001 and 1 as we fill the PreLightData.
However, for direct lighting, this changes neither N nor V. Therefore, when we try to use this clamped NdotV value in other geometric calculations, results occasionally make no sense.
Caveat: if (NdotV < 0) and (NdotL -> 0), H may point in the opposite hemisphere from N. Clamped XdotH products appear to take care of this issue.1 parent ffa106e commit eb1b785Copy full SHA for eb1b785
File tree
Expand file treeCollapse file tree
2 files changed
+16
-13
lines changedOpen diff view settings
Filter options
- Assets/ScriptableRenderPipeline
- HDRenderPipeline/Material/Lit
- ShaderLibrary
Expand file treeCollapse file tree
2 files changed
+16
-13
lines changedOpen diff view settings
Collapse file
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
Copy file name to clipboardExpand all lines: Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl+15-11Lines changed: 15 additions & 11 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
503 | 503 | |
504 | 504 | |
505 | 505 | |
506 | | - |
| 506 | + |
| 507 | + |
| 508 | + |
507 | 509 | |
508 | 510 | |
509 | 511 | |
| ||
534 | 536 | |
535 | 537 | |
536 | 538 | |
| 539 | + |
| 540 | + |
537 | 541 | |
538 | 542 | |
539 | | - |
| 543 | + |
540 | 544 | |
541 | 545 | |
542 | 546 | |
| ||
635 | 639 | |
636 | 640 | |
637 | 641 | |
638 | | - |
| 642 | + |
639 | 643 | |
640 | 644 | |
641 | 645 | |
| ||
661 | 665 | |
662 | 666 | |
663 | 667 | |
664 | | - |
665 | | - |
| 668 | + |
| 669 | + |
666 | 670 | |
667 | 671 | |
668 | | - |
669 | | - |
| 672 | + |
| 673 | + |
670 | 674 | |
671 | 675 | |
672 | 676 | |
| ||
676 | 680 | |
677 | 681 | |
678 | 682 | |
679 | | - |
| 683 | + |
680 | 684 | |
681 | | - |
| 685 | + |
682 | 686 | |
683 | 687 | |
684 | 688 | |
| ||
687 | 691 | |
688 | 692 | |
689 | 693 | |
690 | | - |
| 694 | + |
691 | 695 | |
692 | | - |
| 696 | + |
693 | 697 | |
694 | 698 | |
695 | 699 | |
|
Collapse file
Assets/ScriptableRenderPipeline/ShaderLibrary/CommonLighting.hlsl
Copy file name to clipboardExpand all lines: Assets/ScriptableRenderPipeline/ShaderLibrary/CommonLighting.hlsl+1-2Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
188 | 188 | |
189 | 189 | |
190 | 190 | |
191 | | - |
| 191 | + |
192 | 192 | |
193 | | - |
194 | 193 | |
195 | 194 | |
196 | 195 | |
|
0 commit comments