irtk.scene.MicrofacetBRDF

class irtk.scene.MicrofacetBRDF(d: torch.Tensor | ndarray | List | Tuple, s: torch.Tensor | ndarray | List | Tuple, r: torch.Tensor | ndarray | List | Tuple)

A class representing a microfacet BRDF.

__init__(d: torch.Tensor | ndarray | List | Tuple, s: torch.Tensor | ndarray | List | Tuple, r: torch.Tensor | ndarray | List | Tuple) None

Initializes a MicrofacetBRDF object.

Parameters:
  • d (TensorLike) – The diffuse reflectance (float, shape (3, ) or (m, n, 3)).

  • s (TensorLike) – The specular reflectance (float, shape (3, ) or (m, n, 3)).

  • r (TensorLike) – The roughness (float, shape (1, ) or (m, n, 1)).

classmethod from_file(d_filename: str, s_filename: str, r_filename: str, d_is_srgb: bool | None = None, s_is_srgb: bool | None = None, r_is_srgb: bool | None = None) MicrofacetBRDF

Creates a MicrofacetBRDF object from files.

Parameters:
  • d_filename (str) – The filename of the diffuse texture.

  • s_filename (str) – The filename of the specular texture.

  • r_filename (str) – The filename of the roughness texture.

  • d_is_srgb (Optional[bool]) – Whether the diffuse texture is in sRGB format.

  • s_is_srgb (Optional[bool]) – Whether the specular texture is in sRGB format.

  • r_is_srgb (Optional[bool]) – Whether the roughness texture is in sRGB format.

Returns:

A MicrofacetBRDF object.

Return type:

MicrofacetBRDF