Skip to content

Materials

Material definition, derived from Eradiate/Mitsuba

s2gos_utils.scene.materials.Material pydantic-model

Bases: BaseModel

Base material class with Pydantic validation and auto-registration.

Provides factory method to create material instances from dictionary specifications with automatic type registration and precise validation based on Eradiate and Mitsuba BSDF specifications.

Fields:

  • id (str)

Attributes

id pydantic-field

id: str

Unique material identifier

mat_id property

mat_id: str

Material ID for use in scene dictionaries.

Functions

__init_subclass__

__init_subclass__(material_type: str = None, **kwargs)

Auto-register material types when classes are defined.

from_dict classmethod

from_dict(data: Dict[str, Any], **kwargs) -> Material

Create material instance from dictionary with automatic type dispatch.

Parameters:

Name Type Description Default
data Dict[str, Any]

Dictionary with 'type' key and material parameters

required
**kwargs

Additional arguments passed to material constructor

{}

Returns:

Type Description
Material

Material instance of appropriate subtype

Raises:

Type Description
ValueError

If material type is unknown

get_registered_types classmethod

get_registered_types() -> List[str]

Get list of all registered material types.

to_dict

to_dict() -> Dict[str, Any]

Convert to dictionary for serialization.

s2gos_utils.scene.materials.DiffuseMaterial pydantic-model

Bases: Material

Perfectly diffuse material (Lambertian reflectance).

Based on Mitsuba specification: - Optional reflectance parameter with default 0.5 - Reflectance must be in [0,1] for physical validity

Fields:

Validators:

Attributes

reflectance pydantic-field

reflectance: Dict[str, Any] = {
    "type": "uniform",
    "value": 0.5,
}

Diffuse reflectance [0,1]

s2gos_utils.scene.materials.BilambertianMaterial pydantic-model

Bases: Material

Bilambertian material with energy conservation validation.

Based on Eradiate specification: - Mandatory reflectance and transmittance parameters - Energy conservation: reflectance + transmittance ≤ 1

Fields:

Validators:

Attributes

reflectance pydantic-field

reflectance: Dict[str, Any]

Spectral reflectance [0,1]

transmittance pydantic-field

transmittance: Dict[str, Any]

Spectral transmittance [0,1]

Functions

validate_energy_conservation pydantic-validator

validate_energy_conservation()

Validate reflectance + transmittance ≤ 1 for uniform values.

s2gos_utils.scene.materials.RPVMaterial pydantic-model

Bases: Material

RPV (Rahman-Pinty-Verstraete) reflection model with physical bounds.

Based on Eradiate specification: - All parameters are mandatory - Physical bounds: rho_0,rho_c ∈ [0,1], k ≥ 0, Theta ∈ [-1,1] - k=1 corresponds to Lambertian surface

Fields:

  • id (str)
  • rho_0 (Dict[str, Any])
  • k (Dict[str, Any])
  • Theta (Dict[str, Any])
  • rho_c (Dict[str, Any])

Validators:

Attributes

Theta pydantic-field

Theta: Dict[str, Any]

Forward/backward scattering asymmetry [-1,1]

k pydantic-field

k: Dict[str, Any]

Bowl/bell shape parameter (k=1 is Lambertian, k≥0)

rho_0 pydantic-field

rho_0: Dict[str, Any]

Surface reflectance parameter [0,1]

rho_c pydantic-field

rho_c: Dict[str, Any]

Hot spot parameter [0,1]

Functions

validate_k_parameter pydantic-validator

validate_k_parameter(v)

Validate k parameter physical bounds (k ≥ 0).

validate_theta_parameter pydantic-validator

validate_theta_parameter(v)

Validate Theta parameter bounds [-1,1].

s2gos_utils.scene.materials.OceanLegacyMaterial pydantic-model

Bases: Material

Ocean legacy material with realistic oceanographic parameter bounds.

Based on Eradiate specification: - All parameters are mandatory - Physical bounds based on oceanographic measurements

Fields:

Attributes

chlorinity pydantic-field

chlorinity: float

Water chlorinity in g/kg

pigmentation pydantic-field

pigmentation: float

Pigmentation concentration in mg/m³

wind_direction pydantic-field

wind_direction: float

Wind direction in degrees [0,360)

wind_speed pydantic-field

wind_speed: float

Wind speed in m/s

s2gos_utils.scene.materials.DielectricMaterial pydantic-model

Bases: Material

Dielectric material (glass, plastic) based on Mitsuba specification.

Based on Mitsuba specification: - All parameters optional with physical defaults - IOR values must be > 1.0 for physical validity

Fields:

Validators:

Attributes

ext_ior pydantic-field

ext_ior: Union[float, str] = 1.000277

Exterior IOR or preset name

int_ior pydantic-field

int_ior: Union[float, str] = 1.5046

Interior IOR (>1.0) or preset name

specular_reflectance pydantic-field

specular_reflectance: Optional[Dict[str, Any]] = None

Spectral reflectance override

specular_transmittance pydantic-field

specular_transmittance: Optional[Dict[str, Any]] = None

Spectral transmittance override

s2gos_utils.scene.materials.ConductorMaterial pydantic-model

Bases: Material

Conductor material with mutually exclusive parameter validation.

Based on Mitsuba specification: - Mutually exclusive: material preset XOR manual eta/k - Energy conservation: specular_reflectance ≤ 1

Fields:

Validators:

Attributes

eta pydantic-field

eta: Optional[Dict[str, Any]] = None

Real part of complex IOR

k pydantic-field

k: Optional[Dict[str, Any]] = None

Imaginary part of complex IOR

material pydantic-field

material: Optional[str] = None

Material preset (Al, Cu, Au, etc.)

specular_reflectance pydantic-field

specular_reflectance: Optional[Dict[str, Any]] = None

Spectral reflectance override

Functions

validate_mutually_exclusive_params pydantic-validator

validate_mutually_exclusive_params()

Validate material preset XOR manual eta/k.

s2gos_utils.scene.materials.RoughConductorMaterial pydantic-model

Bases: Material

Rough conductor with anisotropic roughness validation.

Based on Mitsuba specification: - Inherits conductor parameter validation - Mutually exclusive roughness: roughness XOR (alpha_u AND/OR alpha_v) - Distribution validation: beckmann or ggx only

Fields:

Validators:

Attributes

alpha_u pydantic-field

alpha_u: Optional[float] = None

U-direction roughness [0,1]

alpha_v pydantic-field

alpha_v: Optional[float] = None

V-direction roughness [0,1]

distribution pydantic-field

distribution: Literal['beckmann', 'ggx'] = 'beckmann'

Microfacet distribution

eta pydantic-field

eta: Optional[Dict[str, Any]] = None

Real part of complex IOR

k pydantic-field

k: Optional[Dict[str, Any]] = None

Imaginary part of complex IOR

material pydantic-field

material: Optional[str] = None

Material preset

roughness pydantic-field

roughness: Optional[float] = None

Isotropic roughness [0,1]

specular_reflectance pydantic-field

specular_reflectance: Optional[Dict[str, Any]] = None

Spectral reflectance

Functions

validate_conductor_params pydantic-validator

validate_conductor_params()

Validate conductor parameter mutual exclusion.

validate_roughness_params pydantic-validator

validate_roughness_params()

Validate roughness parameter mutual exclusion.

s2gos_utils.scene.materials.PlasticMaterial pydantic-model

Bases: Material

Plastic material based on Eradiate specification.

Fields:

Validators:

Attributes

diffuse_reflectance pydantic-field

diffuse_reflectance: Dict[str, Any]

Diffuse reflectance component

ext_ior pydantic-field

ext_ior: Union[float, str] = 1.000277

Exterior IOR

int_ior pydantic-field

int_ior: Union[float, str] = 1.49

Interior IOR

nonlinear pydantic-field

nonlinear: bool = False

Enable nonlinear effects