trimesh.visual.gloss module¶
- trimesh.visual.gloss.specular_to_pbr(specularFactor: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None, glossinessFactor: float | floating | int | integer | unsignedinteger | None = None, specularGlossinessTexture: Image | None = None, diffuseTexture: Image | None = None, diffuseFactor: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None = None, **kwargs) dict ¶
Convert the KHR_materials_pbrSpecularGlossiness to a metallicRoughness visual.
- Parameters:
specularFactor (list[float]) – Specular color values. Ignored if specularGlossinessTexture is present and defaults to [1.0, 1.0, 1.0].
glossinessFactor (float) – glossiness factor in range [0, 1], scaled specularGlossinessTexture if present. Defaults to 1.0.
specularGlossinessTexture (PIL.Image) – Texture with 4 color channels. With [0,1,2] representing specular RGB and 3 glossiness.
diffuseTexture (PIL.Image) – Texture with 4 color channels. With [0,1,2] representing diffuse RGB and 3 opacity.
diffuseFactor (float) – Diffuse RGBA color. scales diffuseTexture if present. Defaults to [1.0, 1.0, 1.0, 1.0].
- Returns:
kwargs – Constructor args for a PBRMaterial object. Containing:
either baseColorTexture or baseColorFactor
either metallicRoughnessTexture or metallicFactor and roughnessFactor
- Return type:
dict