CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 17:43:23 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/facebookresearch/pytorch3d.git
etag: W/"4c6fa20de0378bd939c88816cd66a33c"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=IXbxrHKKFGp4aqntZyvnjkl68OKkdBdEoVSKQOsbAfI2GJlp18zoAYabbKm406hzPNxytjOvBwCf9IW%2BhMC05E4cv6OghpyQNdibZnPnjXRO3v3xoRTTQJQu4%2FUJKbqM0K3%2BhpAyBtqQMsNHaUqpHkr3C81hdB8trU2Y%2B4mU%2FVUWJ7XEiyTzy%2BLBYjGflMVaguPaE7DEY9aHks3BUpNp439XH%2FtLKq%2BE05fetp3Akfx5pEyEaYCKEWx0O5xN4ERbu0w6r%2FA3iakwdfVCCCzIsQ%3D%3D--KajVxu3bPBXSujHs--EiEjPsui9V2AZLZgauMV6A%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1659274917.1753638202; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 17:43:22 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 17:43:22 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: E57A:3C6DB4:71C10E:94F4A4:6886653A
Non square image rasterization for meshes · facebookresearch/pytorch3d@d07307a · GitHub
Copy file name to clipboardExpand all lines: docs/notes/renderer_getting_started.md
Copy file name to clipboardExpand all lines: pytorch3d/csrc/rasterize_meshes/rasterize_meshes.cu
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit d07307a
Non square image rasterization for meshes
Summary:
There are a couple of options for supporting non square images:
1) NDC stays at [-1, 1] in both directions with the distance calculations all modified by (W/H). There are a lot of distance based calculations (e.g. triangle areas for barycentric coordinates etc) so this requires changes in many places.
2) NDC is scaled by (W/H) so the smallest side has [-1, 1]. In this case none of the distance calculations need to be updated and only the pixel to NDC calculation needs to be modified.
I decided to go with option 2 after trying option 1!
API Changes:
- Image size can now be specified optionally as a tuple
TODO:
- add a benchmark test for the non square case.
Reviewed By: jcjohnson
Differential Revision: D24404975
fbshipit-source-id: 545efb67c822d748ec35999b35762bce58db2cf41 parent 0216e46 commit d07307aCopy full SHA for d07307a
File tree
Expand file treeCollapse file tree
13 files changed
+774
-115
lines changedFilter options
- docs/notes
- pytorch3d
- csrc
- rasterize_meshes
- rasterize_points
- ops
- renderer
- mesh
- tests
- data
Expand file treeCollapse file tree
13 files changed
+774
-115
lines changeddocs/notes/renderer_getting_started.md
Copy file name to clipboardExpand all lines: docs/notes/renderer_getting_started.md+17Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
55 | 55 |
| |
56 | 56 |
| |
57 | 57 |
| |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
58 | 71 |
| |
59 | 72 |
| |
60 | 73 |
| |
| |||
75 | 88 |
| |
76 | 89 |
| |
77 | 90 |
| |
| 91 | + | |
| 92 | + | |
78 | 93 |
| |
79 | 94 |
| |
80 | 95 |
| |
| |||
108 | 123 |
| |
109 | 124 |
| |
110 | 125 |
| |
| 126 | + | |
| 127 | + | |
111 | 128 |
| |
112 | 129 |
| |
113 | 130 |
| |
|
pytorch3d/csrc/rasterize_meshes/rasterize_meshes.cu
Copy file name to clipboardExpand all lines: pytorch3d/csrc/rasterize_meshes/rasterize_meshes.cu+83-46Lines changed: 83 additions & 46 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
234 | 234 |
| |
235 | 235 |
| |
236 | 236 |
| |
237 |
| - | |
238 |
| - | |
| 237 | + | |
| 238 | + | |
239 | 239 |
| |
240 | 240 |
| |
241 | 241 |
| |
| |||
262 | 262 |
| |
263 | 263 |
| |
264 | 264 |
| |
| 265 | + | |
265 | 266 |
| |
266 | 267 |
| |
267 | 268 |
| |
| |||
280 | 281 |
| |
281 | 282 |
| |
282 | 283 |
| |
| 284 | + | |
283 | 285 |
| |
284 | 286 |
| |
285 | 287 |
| |
| |||
296 | 298 |
| |
297 | 299 |
| |
298 | 300 |
| |
299 |
| - | |
| 301 | + | |
300 | 302 |
| |
301 | 303 |
| |
302 | 304 |
| |
| |||
332 | 334 |
| |
333 | 335 |
| |
334 | 336 |
| |
335 |
| - | |
336 |
| - | |
| 337 | + | |
| 338 | + | |
337 | 339 |
| |
338 | 340 |
| |
339 | 341 |
| |
| |||
405 | 407 |
| |
406 | 408 |
| |
407 | 409 |
| |
408 |
| - | |
409 |
| - | |
| 410 | + | |
| 411 | + | |
410 | 412 |
| |
411 | 413 |
| |
412 | 414 |
| |
| |||
589 | 591 |
| |
590 | 592 |
| |
591 | 593 |
| |
592 |
| - | |
593 |
| - | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
594 | 609 |
| |
595 | 610 |
| |
596 | 611 |
| |
597 |
| - | |
| 612 | + | |
598 | 613 |
| |
599 | 614 |
| |
600 | 615 |
| |
| |||
641 | 656 |
| |
642 | 657 |
| |
643 | 658 |
| |
644 |
| - | |
| 659 | + | |
645 | 660 |
| |
646 | 661 |
| |
647 | 662 |
| |
648 | 663 |
| |
649 |
| - | |
650 |
| - | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
651 | 668 |
| |
652 | 669 |
| |
653 |
| - | |
| 670 | + | |
654 | 671 |
| |
655 | 672 |
| |
656 | 673 |
| |
657 |
| - | |
658 |
| - | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
659 | 677 |
| |
660 | 678 |
| |
661 | 679 |
| |
| |||
668 | 686 |
| |
669 | 687 |
| |
670 | 688 |
| |
671 |
| - | |
672 |
| - | |
673 |
| - | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
674 | 693 |
| |
675 | 694 |
| |
676 |
| - | |
| 695 | + | |
677 | 696 |
| |
678 | 697 |
| |
679 | 698 |
| |
| |||
683 | 702 |
| |
684 | 703 |
| |
685 | 704 |
| |
686 |
| - | |
687 |
| - | |
| 705 | + | |
| 706 | + | |
688 | 707 |
| |
689 | 708 |
| |
690 | 709 |
| |
| |||
703 | 722 |
| |
704 | 723 |
| |
705 | 724 |
| |
706 |
| - | |
| 725 | + | |
707 | 726 |
| |
708 | 727 |
| |
709 | 728 |
| |
| |||
725 | 744 |
| |
726 | 745 |
| |
727 | 746 |
| |
728 |
| - | |
729 |
| - | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
730 | 750 |
| |
731 | 751 |
| |
732 |
| - | |
733 | 752 |
| |
734 | 753 |
| |
735 |
| - | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
736 | 759 |
| |
737 |
| - | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
738 | 763 |
| |
739 | 764 |
| |
740 | 765 |
| |
741 |
| - | |
742 |
| - | |
| 766 | + | |
| 767 | + | |
743 | 768 |
| |
744 | 769 |
| |
745 | 770 |
| |
746 | 771 |
| |
747 | 772 |
| |
748 | 773 |
| |
749 | 774 |
| |
750 |
| - | |
| 775 | + | |
751 | 776 |
| |
752 | 777 |
| |
753 | 778 |
| |
| |||
782 | 807 |
| |
783 | 808 |
| |
784 | 809 |
| |
785 |
| - | |
| 810 | + | |
| 811 | + | |
786 | 812 |
| |
787 | 813 |
| |
788 | 814 |
| |
| |||
793 | 819 |
| |
794 | 820 |
| |
795 | 821 |
| |
796 |
| - | |
| 822 | + | |
797 | 823 |
| |
798 | 824 |
| |
799 | 825 |
| |
| |||
803 | 829 |
| |
804 | 830 |
| |
805 | 831 |
| |
806 |
| - | |
807 |
| - | |
808 |
| - | |
809 |
| - | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
810 | 838 |
| |
| 839 | + | |
811 | 840 |
| |
| 841 | + | |
| 842 | + | |
812 | 843 |
| |
813 | 844 |
| |
814 | 845 |
| |
815 | 846 |
| |
816 | 847 |
| |
817 | 848 |
| |
818 |
| - | |
819 |
| - | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
820 | 852 |
| |
821 | 853 |
| |
822 | 854 |
| |
| |||
828 | 860 |
| |
829 | 861 |
| |
830 | 862 |
| |
831 |
| - | |
| 863 | + | |
832 | 864 |
| |
833 | 865 |
| |
834 | 866 |
| |
| |||
858 | 890 |
| |
859 | 891 |
| |
860 | 892 |
| |
861 |
| - | |
| 893 | + | |
| 894 | + | |
862 | 895 |
| |
863 | 896 |
| |
864 | 897 |
| |
| |||
874 | 907 |
| |
875 | 908 |
| |
876 | 909 |
| |
877 |
| - | |
| 910 | + | |
878 | 911 |
| |
879 | 912 |
| |
880 | 913 |
| |
| |||
897 | 930 |
| |
898 | 931 |
| |
899 | 932 |
| |
| 933 | + | |
900 | 934 |
| |
901 |
| - | |
| 935 | + | |
| 936 | + | |
902 | 937 |
| |
903 | 938 |
| |
904 |
| - | |
905 |
| - | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
906 | 942 |
| |
907 | 943 |
| |
908 | 944 |
| |
| |||
932 | 968 |
| |
933 | 969 |
| |
934 | 970 |
| |
935 |
| - | |
| 971 | + | |
| 972 | + | |
936 | 973 |
| |
937 | 974 |
| |
938 | 975 |
| |
|
You can’t perform that action at this time.
0 commit comments