Surface#
- class genesis.options.surfaces.Surface(*, color: tuple[float, ...] | None = None, opacity: float | None = None, roughness: float | None = None, metallic: float | None = None, emissive: tuple[float, ...] | None = None, ior: float | None = None, default_roughness: float = 1.0, vis_mode: typing.Literal['visual', 'collision', 'particle', 'sdf', 'recon'] | None = None, smooth: bool = True, double_sided: bool | None = None, cutoff: float = 180.0, normal_diff_clamp: float = 180.0, recon_backend: typing.Literal['splashsurf', 'openvdb'] = 'splashsurf', generate_foam: bool = False, foam_options: genesis.options.misc.FoamOptions = <factory>) 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 of textures depending on the surface type (e.g. diffuse, specular, roughness, metallic, normal, emissive). Each one of them is ags.textures.Textureobject.Tip
If any of the textures only has single value (instead of a map), you can use the shortcut parameter (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) – Color of the surface. Shortcut for the primary texture with a single color.
opacity (float | None, optional) – Opacity of the surface. Shortcut for
opacity_texturewith a single value.roughness (float | None, optional) – Roughness of the surface. Shortcut for
roughness_texturewith a single value.metallic (float | None, optional) – Metalness of the surface. Shortcut for
metallic_texturewith a single value.emissive (tuple | None, optional) – Emissive color of the surface. Shortcut for
emissive_texturewith a single color.ior (float, optional) – Index of Refraction.
default_roughness (float, optional) – Default roughness value when
roughnessis 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.