facebookresearch / pytorch3d

PyTorch3D is FAIR's library of reusable components for deep learning with 3D data
https://pytorch3d.org/
Other
8.84k stars 1.32k forks source link

Add EnvMapLights Class for Environment Map Lighting #1819

Closed ostapagon closed 3 months ago

ostapagon commented 5 months ago

🚀 Feature

Introduce an EnvMapLights class that illuminates a scene using a 2D discrete environment map. This environment map can be derived from spherical harmonics.

Motivation

Currently, PyTorch3D supports various types of lights, but there is no direct way to use 2D discrete environment maps for scene illumination. Adding this feature would enhance the lighting capabilities of PyTorch3D, making it easier to achieve realistic lighting effects in 3D scenes. This is particularly useful for applications in computer graphics and vision where environment lighting plays a crucial role.

Pitch

The EnvMapLights class will allow users to illuminate scenes using a 2D discrete environment map. The environment map can be obtained from spherical harmonics, offering a versatile and efficient way to simulate complex lighting conditions.

Implementation links:

Here is a link to a commit on forked repo with class and notebook. Google Colab Notebook

ostapagon commented 2 weeks ago

If someone will be interested in using Spherical Harmonics to illuminate scene, I created a small blogpost with Colab that you can use to render scene with SH lighting.