Class ScyllaSkyDomeShape
Parametric sky dome: an inverted hemisphere intended to be rendered from the inside as a sky or background environment. Shares the same vertex layout as ScyllaDomeShape (upper half of a UV sphere with no bottom cap) but uses reversed triangle winding and inward-pointing normals so that a camera placed at or near the dome's center sees the interior surface correctly lit.
Inherited Members
Namespace: Scylla.Core.Util.Geom
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/Geometry/SkyDome")]
public sealed class ScyllaSkyDomeShape : ScyllaShapeBase3D
Remarks
The equator sits at y = -radius/2 and the apex at y = +radius/2, so
the bounding box is symmetric around (0, 0, 0). There is no bottom disc; from
outside the dome is invisible because back-face culling removes all triangles - this
is intentional and correct for a sky-dome use case. To preview the sky dome in the
Unity Scene view, scale it large enough that the Scene camera is inside it, or place
a camera GameObject at its center.
Segments and Rings are clamped to [3, 256] and
[2, 128] respectively at build time. A relatively coarse ring count (the
default is 12) is usually sufficient for a sky dome because the interior is
typically painted with a gradient or a texture rather than relying on fine geometric
detail.
Per-face coloring uses per-vertex dispatch: Resolve(int, int, Vector3) is called once per vertex (passing the vertex index as the face index) rather than once per logical triangle region. Under GradientByY this produces a smooth horizon-to-zenith color gradient across the interior surface, which is the most common use case for a sky dome. Under Cycle or Hash it produces per-vertex color variation. See IFaceColorResolver for the full dispatch contract.
For an outward-facing dome rendered from the outside (with an optional sealed base), use ScyllaDomeShape instead.
Properties
Radius
Sky dome radius in local units. Should be large enough to enclose the camera. Setting this property triggers an immediate mesh rebuild via Rebuild().
Declaration
public float Radius { get; set; }
Property Value
| Type | Description |
|---|---|
| float | The sky dome radius. Default is |
Rings
Number of latitudinal rings (stacks) from equator to apex. The value is clamped to
[2, 128] at build time. Setting this property triggers an immediate mesh
rebuild via Rebuild().
Declaration
public int Rings { get; set; }
Property Value
| Type | Description |
|---|---|
| int | Latitudinal ring count from equator to apex. Default is |
Segments
Number of longitudinal subdivisions (slices) around the Y axis. The value is clamped
to [3, 256] at build time. Setting this property triggers an immediate mesh
rebuild via Rebuild().
Declaration
public int Segments { get; set; }
Property Value
| Type | Description |
|---|---|
| int | Longitudinal slice count. Default is |
Methods
Build(Mesh, float, int, int, IFaceColorResolver)
Populates target with a parametric sky-dome mesh: an inverted
hemisphere with reversed winding, inward-pointing normals, and no bottom cap. Existing
mesh data is overwritten.
Declaration
public static void Build(Mesh target, float radius, int segments, int rings, IFaceColorResolver resolver = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | Destination mesh. Must be non-null. |
| float | radius | Sky dome radius in local units. Clamped to a minimum of |
| int | segments | Longitudinal subdivisions around the Y axis. Clamped to |
| int | rings | Latitudinal rings from equator to apex. Clamped to |
| IFaceColorResolver | resolver | Optional per-vertex color resolver. Uses per-vertex dispatch: called once per
vertex with the vertex index as the face index and the vertex's local position as the
face center. GradientByY is the most natural mode for a
sky dome, painting a smooth horizon-to-zenith gradient across the interior surface.
Under Cycle or Hash it
produces per-vertex color variation. Pass |
Remarks
This static method is the pure mesh-data entry point and may be called without a ScyllaSkyDomeShape component - for example, to bake a sky-dome mesh into a procedural asset at editor time. The component's Rebuild() delegates to this method automatically.
BuildMesh(Mesh)
Subclass extension point: write vertex / triangle / normal / uv data into
target from the shape's serialized parameters. The base class
calls Clear(bool) before invoking this method and
UnityEngine.Mesh.RecalculateBounds() afterwards, so subclasses should not invoke
either themselves.
Declaration
protected override void BuildMesh(Mesh target)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | target | The owned mesh to populate. Already cleared by the base class. |
Overrides
GetMeshName()
Returns the shape's mesh name as it should appear on the generated mesh asset. Defaults to the subclass type name; override to provide a friendlier label.
Declaration
protected override string GetMeshName()
Returns
| Type | Description |
|---|---|
| string | A short identifier for the generated mesh, used as UnityEngine.Object.name. |