diffrp.materials.default_material#
- class diffrp.materials.default_material.DefaultMaterial(tint: Tensor | None = None)#
Bases:
SurfaceMaterialDefault material.
Outputs the interpolated vertex color attributes combined with an optional tint as the albedo, and other attributes remain the default.
- Parameters:
tint (Optional[torch.Tensor]) – Linear multipliers for colors. Defaults to
None.
- __init__(tint: Tensor | None = None) None#
- shade(su: SurfaceUniform, si: SurfaceInput) SurfaceOutputStandard#
The interface for implementing materials. It takes a fragment batch specified as
SurfaceUniformandSurfaceInput.You shall not assume any order or shape of the fragment batch. In other words, the method should be trivial on the batch dimension, that is, the method should return batched outputs equivalent to concatenated outputs from the same batch of input but split into multiple sub-batches.
Most functions implemented with attribute accesses, element/vector-wise operations and DiffRP utility functions naturally have this property.