TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

interface IEnvironmentMap in Tinman.Engine.Components

Base interface for classes that compute color samples of an environment map.

interface IEnvironmentMap extends ILightProvider
  IResourceHandle
  IVersioned
  base of EnvironmentMap

Remarks

An environment map uses a horizontal coordinate system with altitude and azimuth coordinates, interpreted as follows, with respect to the view direction:

Usually, environment maps are associated with some topocentric coordinate system in a 3D scene.

Environment maps are used to render background skies and to model the visual appearance of material reflectivity and gloss. For this purpose, an environment map is rasterized into a ColorCube and then encoded as a mipmapped cubemap texture, which in turn is used during rendering. Ambient lighting is computed from the smallest mipmaps, thus mimicking hemispheric sampling. If an environment map contains a single prominent light feature, it may expose it via the LightAltitude, LightAzimuth and LightSize properties. These will be then used for diffuse lighting.

IEnvironmentMap objects act as resource handles and produce EnvironmentMapResource resource objects.

Attributes

LightAltitude

Altitude angle of the prominent light in the environment map, if applicable.

property LightAltitude { get }
type float64
value [-90..90] The altitude angle in degrees or NanD if there is no prominent light.
inherited ILightProvider.LightAltitude

LightAzimuth

Azimuth angle of the prominent light in the environment map, if applicable.

property LightAzimuth { get }
type float64
value [-180..180] The longitude angle in degrees or NanD if there is no prominent light.
inherited ILightProvider.LightAzimuth

LightSize

Apparent size of prominent light in the environment map, if applicable.

property LightSize { get }
type float64
value [>=0] The apparent diameter of the prominent light, given as an angle in degrees. Will be NanD if there is no prominent light.
inherited ILightProvider.LightSize

SetLightMask

Can the SetLight method be used to configure the prominent light?

property SetLightMask { get }
type int32
value Zero or more of the following bits:
1: LightAltitude can be configured.
2: LightAzimuth can be configured.
4: LightSize can be configured.
inherited ILightProvider.SetLightMask

Version

Returns the current version of object.

property Version { get }
type int32
value The current version number.
inherited IVersioned.Version

Remarks:

For each modification, the version is incremented by at least one.

Extensions

Rasterize

Rasterizes this environment map into the given color cube.

method Rasterize (ColorCube cube, bool edgeFixup = true)
params cube [not-null] The output color cube.
  edgeFixup Perform edge fixup during rasterization? During rendering, the non-principal axes of the cubemap texture coordinates then need to be scaled by the factor 1-0.5/n, where n is the cubemap texture size, divided by two. Defaults to true.

Methods

ComputeEnvironmentColor

Computes the environment color at the given coordinates.

[Pure]
method ComputeEnvironmentColor (float64 altitude, float64 azimuth)
type int64
params altitude Altitude angle of the view direction, in the range [-90..90] degrees.
  azimuth Azimuth angle of the view direction, in the range [-180..180] degrees.
returns The computed environment map color.

See also:

Colors

CreateResource

Creates a new resource object, using the given graphics context.

[OwnerReturn]
method CreateResource (Graphics graphics)
type IResource
params graphics [not-null] The graphics context to use.
returns [not-null] The resource object.
inherited IResourceHandle.CreateResource

Remarks:

Resource objects may implement the IMemoryConsumption interface. In this case, the reported memory consumption will be interpreted as an estimate on how much GPU memory is consumed by the resource. This estimate can then be used for resource caching (e.g. CacheMemory).

Exceptions:

Equals

Compares this object with the given one.

[Pure]
method Equals (IResourceHandle other)
type bool
params other The object to compare to.
returns true if this object is equal to other, false if not.
inherited IEquatable.Equals

SetLight

Configures the prominent light.

method SetLight (float64 altitude, float64 azimuth, float64 size)
params altitude Latitude of the prominent light in this environment map (see LightAltitude).
  azimuth Longitude of the prominent light in this environment map (see LightAzimuth).
  size Apparent size of prominent light in this environment map, in degrees (see LightSize).
inherited ILightProvider.SetLight