medusa.render.lights#

Adapted from pomelyu/SHLight_pytorch, by Chien Chin-yu.

Module Contents#

class medusa.render.lights.SphericalHarmonicsLights(sh_params, ambient_color=(0.5, 0.5, 0.5), device=DEVICE)[source]#

An implementation of spherical harmonics lighting, adapted to work with the SH parameters returned by DECA/EMOCA.

Parameters:
  • sh_params (torch.Tensor) – Tensor of shape (B, 9, 3) containing SH parameters

  • ambient_color (tuple) – Color of ambient light

  • device (str) – Device to use (e.g., “cuda”, “cpu”)

clone()[source]#

Clones the object.

diffuse(normals, points) torch.Tensor[source]#

Computes diffuse lighting.

specular(normals, points, camera_position, shininess) torch.Tensor[source]#

Computes specular lighting.