gs.surfaces.Surface#
- class genesis.options.surfaces.Surface(*, color: tuple | None = None, opacity: float | None = None, roughness: float | None = None, metallic: float | None = None, emissive: tuple | None = None, ior: float | None = None, opacity_texture: Texture | None = None, roughness_texture: Texture | None = None, metallic_texture: Texture | None = None, normal_texture: Texture | None = None, emissive_texture: Texture | None = None, default_roughness: float = 1.0, vis_mode: str | None = None, smooth: bool = True, double_sided: bool | None = None, cutoff: float = 180.0, normal_diff_clamp: float = 180.0, recon_backend: str = 'splashsurf', generate_foam: bool = False, foam_options: FoamOptions | None = None)[source]#
Base class for all surfaces types in Genesis.
A
Surfaceobject encapsulates all visual information used for rendering an entity or its sub-components (links, geoms, …). The surface contains different types textures: diffuse_texture, specular_texture, roughness_texture, metallic_texture, transmission_texture, normal_texture, and emissive_texture. Each one of them is a gs.textures.Texture object.Tip
If any of the textures only has single value (instead of a map), you can use the shortcut attribute (e.g., color, roughness, metallic, emissive) instead of creating a texture object.
Note
This class should not be instantiated directly.
- Parameters:
color (tuple | None, optional) – Diffuse color of the surface. Shortcut for diffuse_texture with a single color.
opacity (float | None, optional) – Opacity of the surface. Shortcut for opacity_texture with a single value.
roughness (float | None, optional) – Roughness of the surface. Shortcut for roughness_texture with a single value.
metallic (float | None, optional) – Metallicness of the surface. Shortcut for metallic_texture with a single value.
emissive (tuple | None, optional) – Emissive color of the surface. Shortcut for emissive_texture with a single color.
ior (float, optional) – Index of Refraction.
opacity_texture (gs.textures.Texture | None, optional) – Opacity texture of the surface.
roughness_texture (gs.textures.Texture | None, optional) – Roughness texture of the surface.
metallic_texture (gs.textures.Texture | None, optional) – Metallic texture of the surface.
normal_texture (gs.textures.Texture | None, optional) – Normal texture of the surface.
emissive_texture (gs.textures.Texture | None, optional) – Emissive texture of the surface.
default_roughness (float, optional) – Default roughness value when roughness is not set and the asset does not have a roughness texture. Defaults to 1.0.
vis_mode (str | None, optional) – How the entity should be visualized, e.g. - ‘visual’: Render the entity’s visual geometry. - ‘collision’: Render the entity’s collision geometry. - ‘particle’: Render the entity’s particle representation (if applicable). - ‘sdf’: Render the reconstructed surface mesh of the entity’s sdf. - ‘recon’: Render the reconstructed surface mesh of the entity’s particle representation.
smooth (bool, optional) – Whether to smooth face normals by interpolating vertex normals.
double_sided (bool | None, optional) – Whether to render both sides of the surface. Useful for non-watertight 2D objects. Defaults to True for Cloth material and False for others.
cutoff (float) – The cutoff angle of emission. Defaults to 180.0.
normal_diff_clamp (float, optional) – Controls the threshold for computing surface normals by interpolating vertex normals.
recon_backend (str, optional) – Backend for surface reconstruction. Possible values are [‘splashsurf’, ‘openvdb’]. Defaults to ‘splashsurf’.
generate_foam (bool, optional) – Whether to generate foam particles for visual effects for particle-based entities.
foam_options (gs.options.FoamOptions, optional) – Options for foam generation.