Scripting API

Scripting API

CameraSky

Record struct in Abyss.Core, from Abyss.Core.

A sky drawn behind everything a camera sees, where its clear color would show: a color straight up, one at the horizon and one straight down, blended by how high the camera looks, and a glow toward each directional light. Colors are sRGB and drawn as given, so a fog of the horizon's color fades the far world into the sky; the glow is the fog's (CameraFog.SunColor), so a sky and a fog given the same glow glow alike. Mapped as the camera maps its materials, whatever its Tonemapping.

public readonly record struct CameraSky

Remarks

Laid out as abyss_core::sky::CameraSky is, 60 bytes.

Constructors

CameraSky

public CameraSky(Vector3 Top, Vector3 Horizon, Vector3 Bottom, Vector4 SunColor, float SunExponent, float HorizonReach)

A sky drawn behind everything a camera sees, where its clear color would show: a color straight up, one at the horizon and one straight down, blended by how high the camera looks, and a glow toward each directional light. Colors are sRGB and drawn as given, so a fog of the horizon's color fades the far world into the sky; the glow is the fog's (CameraFog.SunColor), so a sky and a fog given the same glow glow alike. Mapped as the camera maps its materials, whatever its Tonemapping.

Parameters

  • Top: The color straight up.
  • Horizon: The color at the horizon.
  • Bottom: The color straight down.
  • SunColor: What it glows looking toward a directional light, alpha how strongly; nothing for no glow.
  • SunExponent: How tight the glow is: higher, smaller; 1 or more.
  • HorizonReach: How far above and below the horizon its color reaches, in degrees, from 1 to 90: past it the sky is the top's color or the bottom's.

Laid out as abyss_core::sky::CameraSky is, 60 bytes.

Properties

Top

public Vector3 Top { get; init; }

The color straight up.

Horizon

public Vector3 Horizon { get; init; }

The color at the horizon.

Bottom

public Vector3 Bottom { get; init; }

The color straight down.

SunColor

public Vector4 SunColor { get; init; }

What it glows looking toward a directional light, alpha how strongly; nothing for no glow.

SunExponent

public float SunExponent { get; init; }

How tight the glow is: higher, smaller; 1 or more.

HorizonReach

public float HorizonReach { get; init; }

How far above and below the horizon its color reaches, in degrees, from 1 to 90: past it the sky is the top's color or the bottom's.

Methods

Gradient

public static CameraSky Gradient(Vector3 top, Vector3 horizon, Vector3 bottom, float reach = 45)

A sky from top through horizon to bottom, the horizon's color reaching reach degrees, no glow.

Parameters

  • top
  • horizon
  • bottom
  • reach