Surface Options¶
Surface options describe how an entity renders (colour, roughness, metalness, emission, textures). Genesis
surfaces cannot be created before gs.init(), so SurfaceOptions records the specification in the config and
creates the Genesis surface when the scene is built. Set one as an entity's surface field.
Surface appearance options (plastic, metal, glass, ...).
Attributes¶
SurfaceLike
module-attribute
¶
SurfaceLike: TypeAlias = SurfaceOptions | Surface
Either an Eden :class:SurfaceOptions (deferred) or a built Genesis :class:Surface.
Classes¶
SurfaceOptions
¶
Bases: ConfigurableOptions
Deferred, serializable description of a Genesis surface.
Genesis surfaces (gs.surfaces.*) cannot be instantiated before gs.init()
(they reference gs.EPS internally), so they cannot be embedded directly in an
EdenConfig that is constructed at import time. SurfaceOptions captures the
surface specification as plain config data and materializes the real Genesis surface
lazily via :meth:to_genesis_surface at build time.
Subclasses set _genesis_surface_cls to the corresponding gs.surfaces.* class;
every non-None field (declared or extra) is forwarded to it.
| PARAMETER | DESCRIPTION |
|---|---|
color
|
Surface color. Shortcut for the primary texture with a single color (RGB or RGBA). |
opacity
|
Opacity of the surface in [0, 1].
TYPE:
|
roughness
|
Roughness of the surface in [0, 1].
TYPE:
|
metallic
|
Metalness of the surface in [0, 1].
TYPE:
|
emissive
|
Emissive color of the surface. |
ior
|
Index of refraction.
TYPE:
|
vis_mode
|
How the entity should be visualized ('visual', 'collision', 'particle', 'sdf', 'recon').
TYPE:
|
double_sided
|
Whether to render both sides of the surface.
TYPE:
|
smooth
|
Whether to smooth face normals by interpolating vertex normals. Default True.
TYPE:
|
Source code in eden/options/options.py
Attributes¶
vis_mode
class-attribute
instance-attribute
¶
vis_mode: Literal['visual', 'collision', 'particle', 'sdf', 'recon'] | None = None
Methods:¶
to_genesis_surface
¶
Materialize the Genesis surface. Must be called after gs.init().
Source code in eden/options/surfaces.py
DefaultSurfaceOptions
¶
Bases: SurfaceOptions
Options for gs.surfaces.Default.
Source code in eden/options/options.py
PlasticSurfaceOptions
¶
Bases: SurfaceOptions
Options for gs.surfaces.Plastic.
Source code in eden/options/options.py
MetalSurfaceOptions
¶
Bases: SurfaceOptions
Options for gs.surfaces.Metal.
Source code in eden/options/options.py
BSDFSurfaceOptions
¶
Bases: SurfaceOptions
Options for gs.surfaces.BSDF — a general PBR surface (color / metallic / roughness).
Source code in eden/options/options.py
GlassSurfaceOptions
¶
Bases: SurfaceOptions
Options for gs.surfaces.Glass.
Source code in eden/options/options.py
EmissionSurfaceOptions
¶
Bases: SurfaceOptions
Options for gs.surfaces.Emission.
Source code in eden/options/options.py
Functions:¶
resolve_surface
¶
resolve_surface(surface: SurfaceLike | None) -> Surface | None
Resolve a surface spec to a Genesis surface, building deferred SurfaceOptions.