This release includes several very significant bug fixes and performance improvements as well as some new features for rendering, dataloading and visualization. Please read the breaking changes carefully and update your code accordingly for this new PyTorch3D version.
Breaking changes
- [This commit](https://github.com/facebookresearch/pytorch3d/commit/0c32f094afbb5c7206589e4a5516b6836d1d7f2a) changes the cameras objects and will affect you if (a) you use a cameras object with non-square images, (b) you call the transform_points_screen method, (c) you initialise a cameras object in screen space, i.e. you have been specifying image_size. See [here](https://github.com/facebookresearch/pytorch3d/discussions/783) for more details on the changes and how to update your code.
- The functions `random_rotations`, `random_rotation` and `random_quaternions` no longer have a potentially confusing `requires_grad` parameter. | [commit](https://github.com/facebookresearch/pytorch3d/commit/ce60d4b00e1dc975af49c99b7e6ebe0b4c997f8f)
- The call `pytorch3d.loss.mesh_laplacian_smoothing.laplacian_cot(meshes)` should now be `pytorch3d.ops.cot_laplacian(meshes.verts_packed(), meshes.faces_packed())` | [commit](https://github.com/facebookresearch/pytorch3d/commit/07a5a68d5034da9507a7fae1cf0717247ab255ba)
New deprecations
- The function `so3_exponential_map` deprecated in favor of new function so3_exp_map | [commit](https://github.com/facebookresearch/pytorch3d/commit/5284de6e97f1a206526045349beb3b11b8568238)
New features
- Cameras can be defined and used regardless of coordinate system conventions. They can be defined in NDC or screen space and are converted appropriately to interface with the PyTorch3D renderers according to their conventions | [commit](https://github.com/facebookresearch/pytorch3d/commit/0c32f094afbb5c7206589e4a5516b6836d1d7f2a)
- The standard mesh laplacian calculation has been added and now all three laplacians (standard, cot, norm) live in `pytorch3d.ops.laplacian_matrices` | [commit](https://github.com/facebookresearch/pytorch3d/commit/07a5a68d5034da9507a7fae1cf0717247ab255ba)
- RayBundles can be viewed in `plotly_vis` | [commit](https://github.com/facebookresearch/pytorch3d/commit/4426a9d12c16751c3afe5a4f5de8db89d58e6811)
- Support for the OFF file format for loading meshes | [commit](https://github.com/facebookresearch/pytorch3d/commit/0345f860d4d44e0a36b3a366644f6432458ae5cc)
- Experimental support for loading some glTF files | [commit](https://github.com/facebookresearch/pytorch3d/commit/ed6983ea843590c05593fcd4c8de40f5c7bb0970)
- PLY format now supports mesh vertex colors, i.e. `TexturesVertex` | [commit](https://github.com/facebookresearch/pytorch3d/commit/6c3fe952d1a65696701bba1b037a1b34ba33e4fc)
- Saving a mesh to an OBJ file can include `TexturesUV` data | [commit](https://github.com/facebookresearch/pytorch3d/commit/542e2e7c07fdeef815312b087acfa58094a7aa1e)
- User can now specify vertex normals explicitly on a Meshes object | [commit]( https://github.com/facebookresearch/pytorch3d/commit/2bbca5f2a7de1db1e398d0c50ce4242871957965)
- Pointcloud normals and mesh vertex normals can now be [saved to](https://github.com/facebookresearch/pytorch3d/commit/b314beeda1092337458fca8cd993536463172f8e) and [loaded from](https://github.com/facebookresearch/pytorch3d/commit/6fa66f55341fe1fa8c84c2611a6ec57c1d83b4fb) PLY files
- New `rotate_on_spot` function to relatively rotate a camera position | [commit](https://github.com/facebookresearch/pytorch3d/commit/61e38de034b57f3c703d5049a117764e78f72fe2)
- New `AmbientLights` object for ambient-only lighting | [commit](https://github.com/facebookresearch/pytorch3d/commit/0e85652f07ecca0da06146895921e008e8b839c8)
- Updated the alpha channel in the `hard_rgb_blend` function to return the mask of the pixels which have overlapping mesh faces | [commit](https://github.com/facebookresearch/pytorch3d/commit/a15c33a3cc8857e282d535e27821e8304a4f146d)
- Camera conversions [from](https://github.com/facebookresearch/pytorch3d/commit/8006842f2a5ab1546a90797a6394f875adce045c) and [to](https://github.com/facebookresearch/pytorch3d/commit/da9974b4160b6afe2587b473cdd471d4e299b323) OpenCV cameras
- SE3 exponential and logarithm maps | [commit](https://github.com/facebookresearch/pytorch3d/commit/b2ac2655b3b5a95eea49e72a543f06be4c18e688)
- `TensorProperties` classes (e.g. `Pointclouds` and `Cameras`) now have a cuda() function. | [commit](https://github.com/facebookresearch/pytorch3d/commit/0c02ae907edc2db9aee7d5bda1159814ce06ee56)
Internal-facing new features
- New linearly extrapolated acos function | [commit](https://github.com/facebookresearch/pytorch3d/commit/dd45123f202441e7539c4af9b35d07317b786528)
- New custom 3x3 determinant calculation | [commit](https://github.com/facebookresearch/pytorch3d/commit/bcee361d048f14b3d1fbfa2c3e498d64c06a7612)
- New function Meshes.has_verts_normals | [commit](https://github.com/facebookresearch/pytorch3d/commit/66b97a0c2825ff576df77c510530dbd8e6bac2b6)
- Features for enhanced type safety
Bug fixes
- Fix to cotcurv method of the mesh_laplacian_smoothing | [commit](https://github.com/facebookresearch/pytorch3d/pull/553)
When a Transform3D is constructed without specifying the device but with tensor data input (e.g. a rotation matrix), it will now default to the device of the tensor. | [commit](https://github.com/facebookresearch/pytorch3d/commit/cd5af2521a56bf3f8feca2926bbaa55cae3b3604)
- Fix to frustrum culling when z_clip_value=None | [commit](https://github.com/facebookresearch/pytorch3d/commit/a0f79318c5b16ef5d14bbff8840bc0dc045d078d)
- Fix to mesh rendering when frustrum culling culls everything | [commit](https://github.com/facebookresearch/pytorch3d/commit/c75ca04cf734d3635e1f41a06906cf83c2cb0f31)
- Mesh renderer stability with very small faces | [commit](https://github.com/facebookresearch/pytorch3d/commit/88f5d790886b26efb9f370fb9e1ea2fa17079d19)
- Transform3d.to() now works to change dtype without changing device | [commit](https://github.com/facebookresearch/pytorch3d/commit/44508ed0db269ed0b7c952fbee6bd09105a1c653)
- Multiple issues with shape broadcasting in lighting, shading and blending | [commit](https://github.com/facebookresearch/pytorch3d/commit/bc8361fa471e39280b1c5e3717309167b08ffed5)
- Rendering a nonsquare image when the H and W are not integer multiples [commit](https://github.com/facebookresearch/pytorch3d/commit/13429640d3dfcdf20dc3645d74b621f5fb4faee5)
- Fix to pulsar non-square image rendering | [commit](https://github.com/facebookresearch/pytorch3d/commit/4bb3fff52b7e26ec0f013021cb26fab7db3d8e0b)
- Pulsar cameras now more reliably match PyTorch3D ones | [commit](https://github.com/facebookresearch/pytorch3d/commit/75432a069503a2a51a79516f10ae8eb246e816d0)
- Pulsar gradient now calculated when no other gradient is needed | [commit](https://github.com/facebookresearch/pytorch3d/commit/fa44a05567ea7e6c18c3e762e1260ade0040f08e)
- TensorProperties classes (e.g. Pointclouds and Cameras) will always remember their device if the default cuda device changes. | [commit](https://github.com/facebookresearch/pytorch3d/commit/0c02ae907edc2db9aee7d5bda1159814ce06ee56)
- Now `matrix_to_quaternion` is correct for rotations by 180˚ | [commit](https://github.com/facebookresearch/pytorch3d/commit/1b39cebe9209172e543bdb9cd4d890d4023d5caf)
- In tutorials: updates for changes to PyTorch | [commit](https://github.com/facebookresearch/pytorch3d/commit/1c45ec9770ee3010477272e4cd5387f9ccb8cb51) (avoiding gradients) and numpy | [commit](https://github.com/facebookresearch/pytorch3d/commit/a343cf534cf906560a28f3a367c6ad1369100059). Load tutorial utils correctly on Colab | [commit](https://github.com/facebookresearch/pytorch3d/commit/10eb3892dac5507ce1fe5a2ecfaaf4a72330b67f)
- Fix to subsampling multiple large pointclouds for plotly visualization | [commit](https://github.com/facebookresearch/pytorch3d/commit/1b6182bac20c96f63b4140b02a794ff05e782e8a)
- Fix bug when join_batch is used to join meshes with TexturesVertex | [commit](https://github.com/facebookresearch/pytorch3d/commit/eb04a488c57da0e4e5651f5f37349e058cbfedc7)
- PLY files with uint8 colors are now scaled correctly | [commit](https://github.com/facebookresearch/pytorch3d/commit/e9f4e0d086a8e8481abbf799692de8bd13ee5c5c)
- Fix save_ply with noncontiguous faces | [commit](https://github.com/facebookresearch/pytorch3d/commit/354a1808ff57cb75461c697b282eac98c9082ea9)
- Fix to ShapeNet dataloader: works when not loading textures, install will not miss the json files | [commit](https://github.com/facebookresearch/pytorch3d/commit/029a9da00b4015b6988a28e353fc389572ac6254)
- Calling `extend()` with a user’s subclass of a `Textures` object respects the subclass (618) | [commit](https://github.com/facebookresearch/pytorch3d/commit/34163326b2681f4eb64db5c57d70abcdcc5b4941)
- `TexturesUV.join_scene` works with any number of channels | [commit](https://github.com/facebookresearch/pytorch3d/commit/2a0660baabc839890363f0fa166efdb3ff15c050)
- Documentation updates for [Volume renderer](https://github.com/facebookresearch/pytorch3d/commit/7c0d307142dd47a8e339b06d82877b20c77c1e45) and [RayBundle](https://github.com/facebookresearch/pytorch3d/commit/e794d062e85a8f5211b68eecb351429aeb065409)
Small improvements including speedups
- Improved so3 functions to make gradient computation stable | [commit](https://github.com/facebookresearch/pytorch3d/commit/9f14e82b5aaabaaff9d63fb04e31702b3246ced6)
- Mesh normal consistency speedup | [commit](https://github.com/facebookresearch/pytorch3d/commit/4bfe7158b17a026e182b37212f4ecb88776f2258)
- Add error checks when texture objects are inconsistent with their meshes | [commit](https://github.com/facebookresearch/pytorch3d/commit/ef16253953b7035da69f25107d83cc402562ce08)
- Speedup checking density bounds in volume renderer | [commit](https://github.com/facebookresearch/pytorch3d/commit/b538f107964964d7e5c67f81dcc9e42b13acbc25)
- More validation of a list of texture maps | [commit](https://github.com/facebookresearch/pytorch3d/commit/279f4a154dbb5a3936a2f4234b9e851648c281ec)
- Transform3D avoids gradient calculation when checking rotation matrix | [commit](https://github.com/facebookresearch/pytorch3d/commit/2f668ecefe9898e2224b35a6608937a44e5d8109)
- Avoid recalculating normals when a mesh is [scaled](https://github.com/facebookresearch/pytorch3d/commit/17633808d88facb4a1016b6b81bf681dfd0fd657) or [translated](https://github.com/facebookresearch/pytorch3d/commit/502f15aca73ffb88286a9341512f78e4a52b1a98)
- When TexturesUVs have a list of maps and some are identical, a subsequent join_scene will detect this and not duplicate the data | [commit](https://github.com/facebookresearch/pytorch3d/commit/e12a08133f4f790e1c36e284ef1903ed92f54a27)